【防火墙】iptables查看、添加、删除规则

root@ROUTER:~# iptables -t -nvL

查看到当前我的端口映射下有很多规则。

1.删除端口映射规则和端口映射的链

①先删除子链里的所有规则

iptables -t nat -F port_mapping

 

②再删除这条链

iptables -t nat -X port_mapping

如果子链规则未删除干净就删除链 则当前的会提示错误如下:

 

posted @ 2018-12-03 21:03  陈晓猛  阅读(1496)  评论(0编辑  收藏  举报