Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Drop your iptables.rules into /etc/iptables.rules
- Create service template like so:
- sudo nano /etc/systemd/system/restore-iptables-rules.service
- Copy-paste this:
- [Unit]
- Description = Apply iptables rules
- [Service]
- Type=oneshot
- ExecStart=/bin/sh -c 'iptables-restore < /etc/iptables.rules'
- [Install]
- WantedBy=network-pre.target
- Enable service like so:
- sudo systemctl enable restore-iptables-rules.service
- Reboot and check that the rules have been applied:
- sudo iptables -L
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement