Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IPTables - super easy question from a super newbie

Status
Not open for further replies.

mingtmak

Technical User
Apr 5, 2006
101
0
0
CA
After adding rules to an iptables config (using "iptables -A ...", do they immediately take effect? or do you have to save them first and do a refresh/reload?



- Jon
 
Yes, they have immediate effect but, obviously, they will be erased at restart of iptables or system shutdown.


QatQat

If I could have sex each time I reboot my server, I would definitely prefer Windoz over Linux!
 
Thanks.

Is there way to save them immediately, ala "write mem" in Cisco PIX IOS, in slackware?
I've seen "service iptables save" and "/usr/sbin/iptables save" but I haven't been able to get it to work on a test box.
The only way I've been able to do it, has been to do a 'iptables-save > [filename]' and then have it restored at start up, which I would prefer not to do.

Can I just save it to the 'rc.firewall' file?

- Jon
 
WHat distro are you using?

QatQat

If I could have sex each time I reboot my server, I would definitely prefer Windoz over Linux!
 
slackware 9 and 10 (two machines)

- Jon
 
/etc/init.d/iptables save


QaTQat

If I could have sex each time I reboot my server, I would definitely prefer Windoz over Linux!
 
Quick questions

what's the best way to remove a rule for iptables?
 
Update from my situation. the "iptables save" didn't work.
Had to edit the rc.firewall script and save it using pico/vi.

to remove a rule:
"iptables -D <chain name> <line number>"

you can view the iptables with line-numbers with:
"iptables -L --line-numbers"

- Jon
 
if you want to remove it from the startup, find the script and just comment it out with " # ".

- Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top