1. 程式人生 > >Linux系統下iptables(防火牆)的有關操作命令

Linux系統下iptables(防火牆)的有關操作命令

1、檢視當前iptables(防火牆)規則

      可使用"iptables –L –n"檢視當前iptables規則

      例如:

       

2、新增指定埠到防火牆中

      iptables -I INPUT -p 協議 --dport 埠號 -j ACCEPT

    例如:

  1. iptables -I INPUT -p udp --dport 161 -j ACCEPT
  2. iptables -I INPUT -p tcp --dport 8080 -j ACCEPT

3、清除iptables(防火牆)規則列表中的所有規則

     iptables –F

4、關閉和啟動防火牆

    參考:https://blog.csdn.net/qq_35971258/article/details/79318842

 

Linux下防火牆的基本知識:

參考:https://www.cnblogs.com/longhao/p/3993011.html