iptables won't restore on reboot ?
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 :/
4 Replies
– David
@db3l:
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 ?
@romy:
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" in the rules, for example.
> 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
Thanks!