新买的Linode启动 iptables 出错。(附解决方法)

林继 VPS 知识 9,468 共写了1178个字 (2012-03-16 0:47:04) 没有评论 打印 扫描二维码 百度已收录

启动提示:
Flushing firewall rules: [ OK ]
Setting chains to policy ACCEPT: security raw nat mangle fi[FAILED]
Unloading iptables modules: [ OK ]
Applying iptables firewall rules: [ OK ]
Loading additional iptables modules: ip_conntrack_netbios_n[FAILED]

官方解决方法:

I’m sorry to hear this! The issues you’re experiencing with “iptables” is due to our paravirt kernel having a “security” chain compiled into it, and the default “iptables” init script included with CentOS does not know how to handle it. You are able to resolve this issue by downloading an amended version of the “iptables” init script. Please issue the following commands as the “root” user:

  1. cd /etc/init.d
  2. mv iptables ~/iptables.bak
  3. wget http://epoxie.net/14867.txt && cat 14867.txt | tr -d '\r' > iptables
  4. chmod +x iptables
  5. rm -rf 14867.txt
  6.  
  7. [root@li407-231 init.d]# service iptables restart
  8. Flushing firewall rules:                                   [  OK  ]
  9. Setting chains to policy ACCEPT: security raw nat mangle fi[  OK  ]
  10. Unloading iptables modules:                                [  OK  ]
  11. Applying iptables firewall rules:                          [  OK  ]

“iptables” should now start successfully:

  1. service iptables restart

I hope this helps! If we can be of any further assistance, please don’t hesitate to let us know.

可是根据修改提示Loading additional iptables modules: ip_conntrack_netbios_n [FAILED] 正在费解中。。。

NAT的东东没用 可以注释掉。

注释方法

  1. vi /etc/sysconfig/iptables-config

找到

  1. IPTABLES_MODULES=”ip_conntrack_netbios_ns”

在前面加上#号

  1. #IPTABLES_MODULES=”ip_conntrack_netbios_ns”

重启iptables 就OK了。

—————————————————  亲,这是分割线  —————————————————

使用centos 6 安装vpn服务时,在配置ipstables时会遇到如下错误提示:

  1. Iptables error – Setting chains to policy ACCEPT: security raw nat mangle filter [FAILED]

多方查找,终于找到解决的方法,如下:

编辑/etc/init.d/iptables 找到

  1.     echo -n $"${IPTABLES}: Setting chains to policy $policy: "
  2.     ret=0
  3.     for i in $tables; do
  4. 	echo -n "$i "
  5. 	case "$i" in
  6.            +++++++++++++++++++
  7. 	   security)
  8.            $IPTABLES -t filter -P INPUT $policy \
  9.            && $IPTABLES -t filter -P OUTPUT $policy \
  10.            && $IPTABLES -t filter -P FORWARD $policy \
  11.            || let ret+=1
  12.            ;;
  13.            +++++++++++++++++++
  14. 	    raw)
  15. 		$IPTABLES -t raw -P PREROUTING $policy \
  16. 		    && $IPTABLES -t raw -P OUTPUT $policy \
  17. 		    || let ret+=1
  18. 		;;

注意,带+号的行是后添加的。

  1. service iptables restart

修改后重新启动ipstables服务即可。

如果觉得我的文章对您有用,请随意赞赏。您的支持将鼓励我继续创作!

发表评论

电子邮件地址不会被公开。 必填项已用*标注

< >