IPTABLES script to run boot time with Debian


In order to get Debian to start a firewall script on boot up, get the script to run before the network interface starts.

Edit /etc/network/interfaces
and place the script at the start with the path and the pre-up command e.g.
pre-up /etc/fwr.sh

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
pre-up /etc/fwr.sh
address 10.10.10.100
netmask 255.255.255.0
network 10.10.10.0
broadcast 10.10.10.255
gateway 10.10.10.254
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 10.10.10.2
dns-search winnetworks.com

Note: the fwr.sh is the IPTABLES Script, see IPTABLES posts for details about this.

Bookmark the permalink.