Iptables encounters iptables:protocol wrong type for socket in Linux

Source: Internet
Author: User
Tags bz2 socket vps iptables

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.