iptables-write 389 B

123456789101112131415
  1. #!/bin/sh
  2. # Save current rules to file
  3. iptables-save > /etc/iptables.up.rules
  4. cat /etc/iptables.up.rules
  5. # Add auto load at server startup
  6. ifprefile="/etc/network/if-pre-up.d/iptables-load"
  7. if [ ! -f "$ifprefile" ]; then
  8. touch $ifprefile
  9. echo "#!/bin/sh" > $ifprefile
  10. echo "" > $ifprefile
  11. echo "/sbin/iptables-restore < /etc/iptables.up.rules" > $ifprefile
  12. chmod 0744 $ifprefile
  13. fi