View previous topic :: View next topic |
Author |
Message |
archrax n00b
Joined: 05 Dec 2011 Posts: 45
|
Posted: Tue Dec 27, 2011 12:05 am Post subject: [SOLVED] iptables Won't Start Automatically |
|
|
Hello everyone,
I wrote a script to setup my iptables. At the end, as per the wiki, I have;
Code: |
/etc/init.d/iptables save
rc-update add iptables boot
|
When I run the script, all the rules therein load as expected. I can start and stop iptables no problem and it works as expected.
However, whenever I reboot and run
Code: |
/sbin/iptables -L -v
|
all I get is the default policy set i.e. all 3 main chains have been set to ACCEPT. All my rules seem to have disappeared.
Any ideas what I'm doing wrong? I'm sure it must be something simple - but clearly too simple for me to figure out!
thanks
Last edited by archrax on Tue Dec 27, 2011 2:29 pm; edited 1 time in total |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23064
|
Posted: Tue Dec 27, 2011 12:15 am Post subject: |
|
|
Does the initscript print any error messages when it runs during boot? |
|
Back to top |
|
|
archrax n00b
Joined: 05 Dec 2011 Posts: 45
|
Posted: Tue Dec 27, 2011 1:35 pm Post subject: |
|
|
Quote: | Does the initscript print any error messages when it runs during boot? |
No. In fact, I get the following message;
Code: |
Loading iptables state and starting firewall... [ok]
|
Clearly then, it's a question of the rules not being saved for some reason. Everything else is working fine. |
|
Back to top |
|
|
archrax n00b
Joined: 05 Dec 2011 Posts: 45
|
Posted: Tue Dec 27, 2011 2:30 pm Post subject: |
|
|
It's working now.
All I did was log in as root, run my script and reboot. Strange. Didn't seem happy to save under sudo.
Thanks for input anyway Hu. |
|
Back to top |
|
|
|