what is the difference between /etc/iptables-rules and /etc/iptables/rules.v4?

February 11, 2015 2.3k views

I have installed iptables and iptables-persistent in debian .
There are two iptables-rules in /etc : /etc/iptables-rules and /etc/iptables/rules.v4 .
What is the difference between /etc/iptables-rules and /etc/iptables/rules.v4?

1 Answer

When you first install iptables-persistent it will ask you if you want to save your existing rules in /etc/iptables/rules.v4 and /etc/iptables/rules.v6 These are for your IPv4 and IPv6 rulesets respectively. iptables-persistent will run both of these commands on boot:

iptables-restore < /etc/iptables/rules.v4 
ip6tables-restore < /etc/iptables/rules.v6

The file /etc/iptables-rules is not part of the standard setup.

Have another answer? Share your knowledge.