CentOS iptables 报错解决办法
浏览:1887次 出处信息
启动iptables时,出现了Setting chains to policy ACCEPT: security raw nat filter [FAILED]
Google 之后发现是CentOS 的iptables多了一个security 表,而 /etc/init.d/iptables 中却没有该表的规则定义字段,所以需要手工添加。
wget https://www.dropbox.com/s/nrbvbe2veypdqz6/centos.iptables.patch -O centos.iptables.patch patch p1 < centos.iptables.patch #在要求输入文件路径是输入 /etc/init.d/iptables、 |
如果无法访问dropbox 或者对patch 命令不熟悉可以手工修改 /etc/init.d/iptables 文件,方法如下:
编辑 /etc/init.d/iptables 找到
for i in $tables; do echo -n "$i " case "$i" in raw) $IPTABLES -t raw -P PREROUTING $policy \ && $IPTABLES -t raw -P OUTPUT $policy \ || let ret+=1 ;; |
加入以下内容到“case "$i" in”下面:
security) $IPTABLES -t filter -P INPUT $policy \ && $IPTABLES -t filter -P OUTPUT $policy \ && $IPTABLES -t filter -P FORWARD $policy \ || let ret+=1 ;; |
最终结果:
for i in $tables; do echo -n "$i " case "$i" in security) $IPTABLES -t filter -P INPUT $policy \ && $IPTABLES -t filter -P OUTPUT $policy \ && $IPTABLES -t filter -P FORWARD $policy \ || let ret+=1 ;; raw) $IPTABLES -t raw -P PREROUTING $policy \ && $IPTABLES -t raw -P OUTPUT $policy \ || let ret+=1 ;; |
保存后重启Iptables即可。
建议继续学习:
QQ技术交流群:445447336,欢迎加入!
扫一扫订阅我的微信号:IT技术博客大学习
扫一扫订阅我的微信号:IT技术博客大学习
<< 前一篇:web业务尽快升级到centos 6.4的理由
后一篇:如何在Redis里按模式删除数据 >>
文章信息
- 作者:xiao H 来源: LinuxByte
- 标签: iptables
- 发布时间:2014-04-07 22:48:15
近3天十大热文
-
[85] memory prefetch浅析
-
[53] 基本排序算法的PHP实现
-
[51] 深入浅出cassandra 4 数据一致性问
-
[50] 转载:cassandra读写性能原理分析
-
[43] MySQL半同步存在的问题
-
[41] javascript插入样式
-
[41] 字符引用和空白字符
-
[40] Inline Form Labels
-
[39] JS中如何判断字符串类型的数字
-
[38] 获取Dom元素的X/Y坐标