Doing some more testing on this:
Fedora 14
Iptables version 1.4.9
IPTables::Parse version 0.7 installed from Fedora repository perl-IPTables-Parse-0.7-
6.fc14.noarch.rpm
I modified the Parse.pm and added a Data::Dump right before the return just to see what the
module was seeing.
using the following rules
# Generated by iptables-save v1.4.9 on Mon Apr 11 10:36:36 2011
*nat
:PREROUTING ACCEPT [227300:55357302]
:OUTPUT ACCEPT [8416:1100980]
:POSTROUTING ACCEPT [8416:1100980]
COMMIT
# Completed on Mon Apr 11 10:36:36 2011
# Generated by iptables-save v1.4.9 on Mon Apr 11 10:36:36 2011
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [2019:8636337]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Mon Apr 11 10:36:36 2011
dump
Dump
(
{
bytes => "3634M",
d_port => "0:0",
dport => "0:0",
dst => "0.0.0.0/0",
extended => "state RELATED,ESTABLISHED ",
intf_in => "*",
intf_out => "*",
packets => "6226K",
proto => "all",
protocol => "all",
raw => "6226K 3634M ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0
state RELATED,ESTABLISHED ",
s_port => "0:0",
sport => "0:0",
src => "0.0.0.0/0",
state => "",
target => "ACCEPT",
to_ip => "",
to_port => "",
},
{
bytes => "1537K",
d_port => "",
dport => "",
dst => "0.0.0.0/0",
extended => "",
intf_in => "*",
intf_out => "*",
packets => 20856,
proto => "icmp",
protocol => "icmp",
raw => "20856 1537K ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
",
s_port => "",
sport => "",
src => "0.0.0.0/0",
state => "",
target => "ACCEPT",
to_ip => "",
to_port => "",
},
{
bytes => 7376,
d_port => "0:0",
dport => "0:0",
dst => "0.0.0.0/0",
extended => "",
intf_in => "lo",
intf_out => "*",
packets => 119,
proto => "all",
protocol => "all",
raw => " 119 7376 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 ",
s_port => "0:0",
sport => "0:0",
src => "0.0.0.0/0",
state => "",
target => "ACCEPT",
to_ip => "",
to_port => "",
},
{
bytes => 252,
d_port => 22,
dport => 22,
dst => "0.0.0.0/0",
extended => "state NEW tcp dpt:22 ",
intf_in => "*",
intf_out => "*",
packets => 4,
proto => "tcp",
protocol => "tcp",
raw => " 4 252 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state
NEW tcp dpt:22 ",
s_port => "0:0",
sport => "0:0",
src => "0.0.0.0/0",
state => "RELATED,ESTABLISHED",
target => "ACCEPT",
to_ip => "",
to_port => "",
},
{
bytes => "75M",
d_port => "0:0",
dport => "0:0",
dst => "0.0.0.0/0",
extended => "reject-with icmp-host-prohibited ",
intf_in => "*",
intf_out => "*",
packets => "585K",
proto => "all",
protocol => "all",
raw => " 585K 75M REJECT all -- * * 0.0.0.0/0 0.0.0.0/0
reject-with icmp-host-prohibited ",
s_port => "0:0",
sport => "0:0",
src => "0.0.0.0/0",
state => "",
target => "REJECT",
to_ip => "",
to_port => "",
},
)
It sets state to RELATED,ESTABLISHED when state is NEW and to "" when the state should of
been RELATED,ESTABLISHED.