Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-19-2007, 12:45 PM   #1
LQ Newbie
Registered: Oct 2007
Posts: 9

Rep: Reputation: 0
Store IPtables forever

I hav a gateway runnig on SUSE 10.2 uses IPTABLES for firewall.

Evrytime i reboot machine i have to write commands of Iptables. Is there anyway by wich i can store these table forever in system.

With thanks,
Ravi Chandra.M
Old 10-19-2007, 01:07 PM   #2
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
You can either put the commands into a file...
text file:

iptables -I input blah 
blah blah
Make sure the file has execute permissions and then put into /etc/init.d/filename

then chkconfig on filename
this method makes it easier to change and set iptable entries how you want them


i beleive you can do iptables-save > /path/filename or something similar and it saves the current ip tables config to a file which then

then i beleive restore is possible by doing
iptables-restore < /path/filename

and then get that command to run on boot by entering it into the network set-up file or /etc/rc.d/rc.local

or something similar, rc.local method is better if you can't find it run a
find /etc/* -name 'rc.local'

hope this helps

Last edited by helptonewbie; 10-19-2007 at 01:22 PM.
Old 10-19-2007, 01:12 PM   #3
Senior Member
Registered: Jul 2003
Location: Indiana
Distribution: Mandrake Slackware-current QNX4.25
Posts: 1,802

Rep: Reputation: 47
I think after you load all rules:
/sbin/iptables-save >
The next time you boot:
/sbin/iptables-restore <
If you change any rules you have to do a iptables-save again.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Metallica FOREVER!!! SoldierJan Member Success Stories 1 11-24-2006 09:09 AM
Seems forever to update? Frank Soranno Debian 1 07-27-2006 11:14 PM
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
'alsactrl store' doesn't seem to store... endfx Slackware 1 08-20-2004 01:30 AM
Iptables, where do i store NAT lines? d33pdream Linux - Software 1 03-18-2003 12:20 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:32 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration