User Tools

Site Tools


iptables

Persistent rules

To keep our rules between reboots, we first have to save them:

sudo sh -c "iptables-save > /etc/iptables.sv"

We can then have them apply at reboot by different manners, by adding

pre-up iptables-restore < /etc/iptables.sv

either to

  • Root crontab (use @reboot)
  • /etc/rc.local
  • /etc/network/interfaces (add line to main interface, e.g. eth0)
iptables.txt · Last modified: 2013/12/25 16:47 (external edit)