查看完整版本: 解决 iptables Setting chains to policy ACCEPT: security raw nat[FAILED]filter


dyson6 2016-10-28 17:36

解决 iptables Setting chains to policy ACCEPT: security raw nat[FAILED]filter

Linode VPS 主機有时候在重启iptables的時候總是會出現<br>iptables: Setting chains to policy ACCEPT: security raw nat[FAILED]filter <br>對運作是沒什麼影響,但看了總是覺得怪怪的~<br><br>錯誤訊息:<br><br>[root@www ~]# service iptables restart<br>iptables: Setting chains to policy ACCEPT: security raw nat[FAILED]filter <br>iptables: Flushing firewall rules:&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&nbsp;&nbsp;OK&nbsp;&nbsp;]<br>iptables: Unloading modules:&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&nbsp;&nbsp;OK&nbsp;&nbsp;]<br>iptables: Applying firewall rules:&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&nbsp;&nbsp;OK&nbsp;&nbsp;]<br><br>錯誤原因:<br><br>Linode官方在iptables裡面加了一個security的規則鏈,但是centos不支持,既然不支持,那就修復囉<br><br><br>解决iptables: Setting chains to policy ACCEPT: security raw nat[FAILED]filter<br><br>找到如下case段,在raw後面加上security)段,修改後如下。<br><br># vi /etc/init.d/iptables<br>[quote]<br><br>for i in $tables; do<br> echo -n "$i "<br> case "$i" in<br> raw)<br> $IPTABLES -t raw -P PREROUTING $policy \<br> &amp;&amp; $IPTABLES -t raw -P OUTPUT $policy \<br> || let ret+=1<br> ;;<br><font color="Red">security)<br> $IPTABLES -t filter -P INPUT $policy \<br> &amp;&amp; $IPTABLES -t filter -P OUTPUT $policy \<br> &amp;&amp; $IPTABLES -t filter -P FORWARD $policy \<br> || let ret+=1<br> ;;</font><br>[/quote]<br><br><br>重啟 iptables<br><br>[root@www ~]# service iptables restart<br>iptables: Setting chains to policy ACCEPT: security raw nat[&nbsp;&nbsp;OK&nbsp;&nbsp;]filter <br>iptables: Flushing firewall rules:&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&nbsp;&nbsp;OK&nbsp;&nbsp;]<br>iptables: Unloading modules:&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&nbsp;&nbsp;OK&nbsp;&nbsp;]<br>iptables: Applying firewall rules:&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; [&nbsp;&nbsp;OK&nbsp;&nbsp;] <br><br>這樣就搞定了~
頁: [1]
查看完整版本: 解决 iptables Setting chains to policy ACCEPT: security raw nat[FAILED]filter