iptables-restore

Load iptables rules from a file

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
iptables-restore --test < <file>Validate first
iptables-save > /root/iptables.beforeSave current rules
What it does

Atomically loads rules produced by iptables-save.

Common flags
FlagMeaning
-t --testParse only, do not commit
-nDo not flush existing rules
Examples
iptables-restore --test < rules.v4Syntax check · explain & risk-check →
iptables-restore < /root/iptables.backupRoll back · explain & risk-check →
Related
iptables-save iptables
Open the full explainer →More in Networking

Reference text is hand-written and may be incomplete — check man iptables-restore for your version. Test destructive commands on a non-production system first.