I'd like to know the safest way to load iptables using Debian. Of course, I can use a script that uses iptables-restore :
#!/bin/sh
iptables-restore < /etc/firewall.conf
but : 1) where is the safest place to have it loaded ? /etc/network/if-up.d ? I'm concerned about the script being loaded early enough at boot time, and reliably enough when plugging/unplugging interfaces ...
2) is this script method using iptables-restore the most secure way ?
3) additionnally, how much does the answer validity stretch to other Linux distros ( Ubuntu, Fedora, CentOS ) ?
Thanks ^^
/etc/network/if-up.d/rules.sh
by doingsudo iptables-save > /etc/network/if-up.d/rules.sh
and then add/etc/network/if-up.d/rules.sh
to/etc/rc.local
before the lineexit 0