Linode Forum Index Linode Forum
Linode Community Forums
 


iptables won't restore on reboot ?

Click here to go to the original topic

 
       Linode Forum Index -> Linux Networking
Author Message
romy



Joined: 30 Aug 2011
Posts: 3

Posted: Tue Aug 30, 2011 10:29 pm    Post subject: iptables won't restore on reboot ?  

This is my /etc/network/interfaces (sans IPs):

Code: auto lo
iface lo inet loopback

auto eth0

iface eth0 inet static
 address ...
 netmask ...
 gateway ...
 pre-up iptables-restore < /etc/iptables.saved

Didn't want to paste my iptables.saved, but suffice it to say that if I run iptables-restore < /etc/iptables.saved manually at any point after reboot, it restores the correct rules.

Asked Linode for help, they referred me to forums :/
Back to top  
db3l



Joined: 13 May 2009
Posts: 556

Posted: Tue Aug 30, 2011 11:14 pm    Post subject:  

What if you replace "pre-up" with up/post-up? Perhaps your rules have some interface-specific parameters that won't work if your interface is still down?

-- David
Back to top  
romy



Joined: 30 Aug 2011
Posts: 3

Posted: Tue Aug 30, 2011 11:36 pm    Post subject:  

db3l wrote: What if you replace "pre-up" with up/post-up? Perhaps your rules have some interface-specific parameters that won't work if your interface is still down?

-- David

Ooh, I like where you're going w/ this, will try it (can't reboot production box, though). Is there a set of rules I should look for off the top of your head ?

And is there a difference between up and (EDIT) post-up ?
Back to top  
db3l



Joined: 13 May 2009
Posts: 556

Posted: Wed Aug 31, 2011 12:02 am    Post subject:  

romy wrote: Ooh, I like where you're going w/ this, will try it (can't reboot production box, though). Is there a set of rules I should look for off the top of your head ?
Look for "-i <interface>" in the rules, for example.

Quote: And is there a difference between up and (EDIT) post-up ?
I think they're synonymous.

In terms of testing, you could always spin up a test Linode just long enough to test. Copy over your iptables save file from the production box and do a few tests on it. You could also try installing the rules while on the console with eth0 still down.

-- David
Back to top  
romy



Joined: 30 Aug 2011
Posts: 3

Posted: Thu Sep 01, 2011 9:14 am    Post subject:  

Yup, definitely had a bunch of -i rules in the file. I'll give it a test soon.

Thanks!
Back to top  
 
       Linode Forum Index -> Linux Networking
Page 1 of 1