Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables: Protocol wrong type for socket
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mauricev
Tux's lil' helper
Tux's lil' helper


Joined: 22 Mar 2004
Posts: 149

PostPosted: Wed Oct 11, 2017 5:31 pm    Post subject: iptables: Protocol wrong type for socket Reply with quote

I'm getting this error on running certain commands with iptables

Code:

iptables -A INPUT -p tcp ! --syn -m state --state NEW -j missingsynpackets
iptables -A INPUT -i eth0 -p tcp --sport 20 --dport 1024:65535 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT


The kernel is 4.13.4-gentoo
iptables is 1.6.1-r1.

Loaded iptables-related modules are
Code:

nf_conntrack_ftp
xt_state
nf_conntrack
nf_log_ipv4
nf_log_common
xt_LOG
iptable_filter
ip_tables


Is a module missing?
Back to top
View user's profile Send private message
mauricev
Tux's lil' helper
Tux's lil' helper


Joined: 22 Mar 2004
Posts: 149

PostPosted: Wed Oct 11, 2017 8:09 pm    Post subject: Reply with quote

The error is caused by the fact that "state" is no longer a valid keyword. Now, for example, the line

Code:
 iptables -A INPUT -p tcp ! --syn -m state --state NEW -j missingsynpackets


should be replaced with

Code:
 iptables -A INPUT -p tcp ! --syn -m conntrack --ctstate NEW -j missingsynpackets
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Thu Oct 12, 2017 8:16 pm    Post subject: Reply with quote

Interesting.... State has been an alias for contrack for ages. Actually I came to expect it would stay this way, because breaking compatibility for sake of changing the module name didn't seem beneficial.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5587

PostPosted: Thu Oct 12, 2017 8:45 pm    Post subject: Reply with quote

It looks like that hasn't changed, and even the ebuild has gone untouched for 10 months. The problem lies somewhere else.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum