User Tools

Site Tools


Persistent rules

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

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

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

pre-up iptables-restore < /etc/

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)