Other toolsBash

Linux – iptables Backup & Restore (Bash)

Save and restore Linux iptables rules.

Bash
#!/usr/bin/env bash
iptables-save > /root/iptables-$(date +%F).rules
# Restore: iptables-restore < /root/iptables-YYYY-MM-DD.rules
  

From Joseph Nakhle's automation workbench.

More Other tools scripts