LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-19-2007, 12:45 PM   #1
rcm_b05
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.

problem:
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
helptonewbie
Member
 
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:

Code:
#!/bin/bash
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
DONE

OR

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
/bin/bash
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 >iptables.save
The next time you boot:
/sbin/iptables-restore <iptables.save
If you change any rules you have to do a iptables-save again.
 
  


Reply



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 LinuxQuestions.org 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:00 PM.

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