how to configure iptables automatically at bootup?
I have my RedHat 9.0 system up and configured as a gateway for my home network. The only trouble is that I have to run the following script as root every time the system starts:
/sbin/iptables --table nat --flush
/sbin/iptables --table nat --delete-chain
/sbin/iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
/sbin/iptables --append FORWARD --in-interface eth0 -j ACCEPT
Once this script is run as root, all of the other computers can access the internet properly. However, I really want to have this system configure itself when it starts up, so when it reboots (and I'm not home) someone doesn't have to log in, su, and run the script. After a little research, I tried putting this script into the /etc/rc.d/rc3.d, but I believe that script cannot access things forbidden to mere users.
So my question is...can I make that script execute properly in the rc3.d by chmodding something? Or is there some intelligent way to make this happen transparently?
By the way, I don't know what the hell I'm doing. :)