iptables save config

Post Reply
mister_v
Posts: 122
Joined: Sat Jun 20, 2009 5:42 pm

iptables save config

Post 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,
Chris
Site Admin
Posts: 115
Joined: Mon Jul 21, 2008 9:45 am
Location: Leuven, Belgium
Contact:

Re: iptables save config

Post 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
Post Reply