iptables-restore command failed in iptables v1.4.16.2

349 views Asked by At

I am currently have iptables v1.4.16.2 installed. when I try to run iptables-restore command for the following set of rules

*filter

-I FORWARD 1 -s 192.168.0.0/16 -d 0.0.0.0/0 -o vlan2753 -j DROP -m conntrack --ctstate NEW

-I FORWARD 2 -s 10.10.0.0/16 -d 0.0.0.0/0 -o vlan2753 -j DROP -m conntrack --ctstate NEW

COMMIT

It fails with 'iptables-restore: line 4 failed'

But, the same set of rules work fine, if set in machine having iptables v1.4.9.

Can anyone help out in figuring out what has changed in two versions and what I need to change to make it work. I am very new to using iptables commands.

1

There are 1 answers

0
mHxDave On

is this generated by iptables-save? how about you try this instead for iptables-restore:

*filter
-A FORWARD -s 192.168.0.0/16 -o vlan2753 -m conntrack --ctstate NEW -j DROP
-A FORWARD -s 10.10.0.0/16 -o vlan2753 -m conntrack --ctstate NEW -j DROP
COMMIT

worked for me ;)