Prev | Current Page 921 | Next

Christopher Negus

"Linux Bible, 2008 Edition: Boot up to Ubuntu, Fedora, KNOPPIX, Debian, openSUSE, and 11 Other Distributions"

The following section discusses saving your firewall settings
so you can use them permanently.
Saving Firewall Settings
If you think you have a good set of rules in your current kernel, you can save those rules using the
iptables-save command so they can be reloaded later using the iptables-restore command.
Here??™s an example of how to use the iptables-save command:
# iptables-save > /root/iptables
In this example, the current firewall rules are stored in the /root/iptables file (you can put
them anywhere you like for the time being). These rules can be copied to a location where they can
be loaded automatically on some Linux systems. For example, in Fedora systems, copy this file to
/etc/sysconfig/iptables, and the rules are installed when the computer reboots. If they
don??™t load automatically, you can restore them yourself as follows:
# iptables-restore < /root/iptables
The previously saved rules are now restored to the currently running kernel.
Remember that if you are using a bootable Linux, you need to be sure to save the iptables
rules file to a location (such as a directory on a USB pen drive or hard disk partition) that
will not disappear when you reboot.
Checking Your Firewall
Now that your firewall is configured, you should check it to make sure that it appears to the outside
world??”in our example, to the Internet on eth0 and your local LAN on eth1??”as you would
like it to.


Pages:
909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933