VPS侦探论坛

 找回密码
 注册
查看: 7959|回复: 4

[总结] [已解决]求解 iptables connlimit为啥会有这么奇葩的提示...

[复制链接]
发表于 2013-6-6 00:36:38 | 显示全部楼层 |阅读模式

  1. # iptables -I FORWARD -p tcp --syn --dport 80 -m connlimit --connlimit-above 20 -j DROP
  2. iptables: Protocol wrong type for socket.
复制代码
语法明显没错...
但就是会说Protocol wrong type for socket.,理解不能...


系统:CentOS6.2(32位)(3.9.3-x86-linode52)
lnmp0.8

已解决:https://bbs.vpser.net/viewthread.php?tid=9649&pid=28453&page=1&extra=page%3D1#pid28453

[ 本帖最后由 Sonic1997 于 2013-6-6 17:10 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-6-6 08:50:43 | 显示全部楼层


这个好像是内核的问题
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-6-6 13:28:54 | 显示全部楼层

回复 2# 的帖子


然后用kernel-patch?
(然后这个内核真心不知道是啥= =

[ 本帖最后由 Sonic1997 于 2013-6-5 21:48 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-6-6 14:07:00 | 显示全部楼层

回复 3# 的帖子




问问linode客服看哪个内核的支持,然后换过去
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-6-7 09:09:14 | 显示全部楼层

CentOS's userspace tools are also incompatible with the connlimit module in our latest 3.x series kernels because the version of 'iptables' that is installed is too old:
//CentOS的用户空间工具在我们最新的3.x系列核心中与connlimit模块不兼容因为所安装的iptables版本太旧了:
-----
# iptables -V
iptables v1.4.7
-----

Please issue these commands, and again, remember that building from source means that this package will no longer be managed by your package management system (yum):
//输入以下指令,后面的懒得翻译,注意这会覆盖掉你的东西就行了
  1. yum update
  2. rpm -e --nodeps iptables-1.4.7-9.el6.i686
  3. rpm -e --nodeps iptables-ipv6-1.4.7-9.el6.i686
  4. yum groupinstall 'Development Tools'
  5. wget http://www.netfilter.org/projects/iptables/files/iptables-1.4.19.tar.bz2
  6. tar jxvf iptables-1.4.19.tar.bz2
  7. cd iptables-1.4.19
  8. 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
  9. make
  10. make install
复制代码
When the installation is complete, run "iptables -V" and you should see the following output:
//当你完成安装时,输入“iptables -V” 然后你会看到下面的内容
-----
iptables v1.4.19
-----

Now try to load that iptables rule:
//现在你可以用了

iptables -I FORWARD -p tcp --syn --dport 80 -m connlimit --connlimit-above 20 -j DROP

It should succeed with no error message. You can verify that the rule was loaded with either of these commands:
//下载应该能运行的了,你可以通过以下任意一个指令来验证你的规矩是否已经加载

iptables-save
iptables -L -n -v





搞定,感谢军哥提出指引&Linode客服

[ 本帖最后由 Sonic1997 于 2013-6-6 17:19 编辑 ]

军哥运维代购:http://shop63846532.taobao.com/

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-17 03:04 , Processed in 0.026866 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表