Reload iptables on every boot

Hi,

To be able to load your iptables ruled every time your Linux system is restarted just follow these commands.

$ sudo iptables-save /etc/firewall.conf

Open /etc/network/if-up.d/iptables and add:
#!/bin/sh
iptables-restore /etc/firewall.conf

Provide executable permission:
$ sudo chmod +x /etc/network/if-up.d/iptable

Now, your iptable rules will be loaded every time your Linux box is booted.

If you need to modify your rules just execute:
$ sudo iptables-save /etc/firewall.conf

Regards,
Rubén

Show Comments