sudo iptables-save > /etc/iptables/rules.v4

Category: Self-Hosting

sudo iptables-save > /etc/iptables/rules.v4

Save current iptables rules to a file so they persist across reboots

Writes the current iptables ruleset to a file. Without this, all rules are lost on reboot. The 'iptables-persistent' package restores them automatically.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.