Results 11 to 13 of 13
iptables-save writes to stdout. Typically, the init script for iptables uses it on stopping the service to redirect to /etc/sysconfig/iptables-config (RH-like distros) or /etc/iptables-rules (Debian distros). There are probably scenarios ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-20-2010 #11
Very good how-to in a nutshell, though.
- 02-21-2010 #12
I just did some searching and found the best way to write the config file for iptables is to use the following:
The adventure of a life time.
Linux User #296285
- 02-21-2010 #13
Yes, that's the best way to do it explicitly. That save function of the iptables init script is called by both the stop and restart functions, so any orderly shut down or restart of the service, including an orderly system reboot, will result in saving the current tables and using them on restart. This is probably the best option for most folks, as it ensures that the correct directory/file are used and that the contents are syntactically (though not necessarily logically correct). Experienced engineers can get away with hand-editing because they're prepared to find and fix the problem if they mung up the syntax or misplace the file.