Page 1 of 1

iptables save config

Posted: Sun Oct 27, 2019 10:48 am
by mister_v
Hi,

How do I make a backup of firewall rules in iptables;
And how do I use it to restore it later?

thanks,

Re: iptables save config

Posted: Sun Oct 27, 2019 4:08 pm
by Chris
The command to save the rules is

Code: Select all

iptables-save > save_iptables.txt
To restore :

Code: Select all

iptables-restore < save_iptables.txt
You might want to review your rules before saving:

Code: Select all

iptables -L -nv --line-number