iptalbes -F
-F, --flush [chain]
       Flush  the  selected  chain (all the chains in the table if none is given).  This is equivalent to deleting all the rules one by one.

如果没有指定具体的chain,默认将表中的所有的chains刷新,即逐个删除所有的规则。

有的linux发行版上这个命令不会清除NAT表中的规则,此时只能手动清除

(警告:这只适合在没有配置防火墙的环境中,如果已经配置过默认规则为deny的环境,此步骤将使系统的所有网络访问中断)

 

iptables -F的时候是不能改变原来设置的默认规则的,如果原来设置的iptables -P INPUT DROP ,现在在远程运行一下iptables -F的话,远程连接就会立即中断,只能到本地登陆运行iptables -P INPUT ACCEPT ,这样才能再从远端连接进来。

 

使用/sbin/iptables -F要小心

如果想清空的话,先执行

/sbin/iptables -P INPUT ACCEPT

然后执行

/sbin/iptables -F

相关文章:

  • 2022-01-08
  • 2022-12-23
  • 2021-09-26
  • 2021-08-20
  • 2021-07-29
  • 2021-09-06
猜你喜欢
  • 2021-06-01
  • 2021-08-20
  • 2022-01-12
  • 2021-07-04
  • 2021-11-18
  • 2021-12-05
相关资源
相似解决方案