Configuring iptables for start-up in debian
From Notes_Wiki
<yambe:breadcrumb>Debian|Debian</yambe:breadcrumb>
Configuring iptables for start-up in debian
Most probably there is no default iptables configuration file such as '/etc/sysconfig/iptables' of Cent-OS in debian. Hence to enable iptables on start-up a iptables configuration file can be created in /etc and then start-up configuration is done to restore the iptables configuration at start-up.
Steps for configuring start-up iptables on debian are:
- iptables-save > /etc/iptables.up.rules
- Edit '/etc/iptables.up.rules' and configure appropriate rules
- Test with 'iptables-restore < /etc/iptables.up.rules'
- Create '/etc/network/if-pre-up.d/iptables' with following contents:
- #!/bin/bash
- /sbin/iptables-restore < /etc/iptables.up.rules
- (Remove space from first column in both lines)
- chmod +x /etc/network/if-pre-up.d/iptables