Below Yan you to introduce an article about Linode VPS Iptables encountered iptables:protocol wrong type for socket. Wrong solution, I hope the article will help you
To Linode VPS CentOS 6.4 iptables Add a rule that limits the number of IP connections to no more than 100:
Iptables-a input-p TCP--syn--dport 80-m connlimit--connlimit-above 100-j REJECT
Error occurred:
Iptables:protocol wrong type for socket.
Asked Linode customer service, said the kernel and Connlimit module is incompatible, iptables version is too old, need to upgrade.
View Iptables version:
[Root@linode ~]# Iptables-v
Iptables v1.4.7
To view the Iptables installation package:
[Root@linode ~]# Rpm-qa | grep iptables
Iptables-1.4.7-9.el6.x86_64
Iptables-ipv6-1.4.7-9.el6.x86_64
Solve the problem in the following ways, but note that iptables can no longer manage with Yum:
Yum Update
RPM-E--nodeps iptables-1.4.7-9.el6.x86_64
RPM-E--nodeps iptables-ipv6-1.4.7-9.el6.x86_64
Yum Groupinstall ' Development Tools '
wget http://www.netfilter.org/projects/iptables/files/iptables-1.4.19.tar.bz2
Tar jxf iptables-1.4.19.tar.bz2
CD iptables-1.4.19
Ldflags= "-l$pwd/libiptc/.libs"./configure--prefix=/usr--exec-prefix=--bindir=/usr/bin Xtables--with-pkgconfigdir=/usr/lib/pkgconfig--ENABLE-LIBIPQ--enable-devel
Make
Make install
View Iptables version:
[Root@linode ~]# Iptables-v
Iptables v1.4.19
[Root@linode iptables-1.4.19]# iptables-a input-p tcp--syn--dport 80-m connlimit--connlimit-above 100-j
[Root@linode iptables-1.4.19]# Iptables-l
Chain INPUT (Policy ACCEPT)
REJECT TCP--Anywhere anywhere TCP dpt:http Flags:fin,syn,rst,ack/syn #conn src/32 > 100 Reject-with icmp-port-unreachable
You can see there's already a rule on it.