Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] iptables Won't Start Automatically
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
archrax
n00b
n00b


Joined: 05 Dec 2011
Posts: 45

PostPosted: Tue Dec 27, 2011 12:05 am    Post subject: [SOLVED] iptables Won't Start Automatically Reply with quote

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
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23064

PostPosted: Tue Dec 27, 2011 12:15 am    Post subject: Reply with quote

Does the initscript print any error messages when it runs during boot?
Back to top
View user's profile Send private message
archrax
n00b
n00b


Joined: 05 Dec 2011
Posts: 45

PostPosted: Tue Dec 27, 2011 1:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
archrax
n00b
n00b


Joined: 05 Dec 2011
Posts: 45

PostPosted: Tue Dec 27, 2011 2:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum