micsoftvn

Untitled

Feb 23rd, 2021
780
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Drop your iptables.rules into /etc/iptables.rules
  2. Create service template like so:
  3.  
  4. sudo nano /etc/systemd/system/restore-iptables-rules.service
  5. Copy-paste this:
  6.  
  7. [Unit]
  8. Description = Apply iptables rules
  9.  
  10. [Service]
  11. Type=oneshot
  12. ExecStart=/bin/sh -c 'iptables-restore < /etc/iptables.rules'
  13.  
  14. [Install]
  15. WantedBy=network-pre.target
  16. Enable service like so:
  17.  
  18. sudo systemctl enable restore-iptables-rules.service
  19. Reboot and check that the rules have been applied:
  20.  
  21. sudo iptables -L
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×