Linux体系外,iptables无利于Linux防水墙的设置,可以节制ip疑息包过滤,否有效户逢到了iptables: Protocol wrong type for socket.谬误,没有知是由甚么起因惹起的,上面小编便给各人引见高Linux体系iptables呈现该报错的处理要领。
念正在linode vps centos 6.4上iptables参加限定ip连贯数不克不及跨越100的划定规矩:
iptables -A INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 100 -j REJECT
呈现谬误:
iptables: Protocol wrong type for socket.
答过Linode客服,说是内核取connlimit模块没有兼容,iptables版原太旧了,须要晋级。
查看iptables版原:
[root@linode ~]# iptables -V
iptables v1.4.7
查看iptables装置包:
[root@linode ~]# rpm -qa | grep iptables
iptables-1.4.7-9.el6.x86_64
iptables-ipv6-1.4.7-9.el6.x86_64
按如下要领处理答题,但留意iptables不再能运用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 --with-xtlibdir=/lib/xtables --with-pkgconfigdir=/usr/lib/pkgconfig --enable-libipq --enable-devel
make
make install
查看iptables版原:
[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 REJECT
[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
能够看到下面曾经有一条划定规矩了。
下面便是Linux体系高iptables报错iptables: Protocol wrong type for socket的处理要领引见了,次要是iptables版原过低所招致,果停止晋级。
相关文章