1. 程式人生 > >iptables -F 與 -X 區別

iptables -F 與 -X 區別

test:

1、iptables 初始化

 

2、iptables -X (第一次)

錯誤原因是自定義連結串列(test)不為空

3、iptables -F

4、iptables -X

ok,實驗結束

實驗報告:

-F 是清空指定某個 chains 內所有的 rule 設定。比方 iptables -F -t filter,那就是把 filter table 內所有的INPUT/OUTPUT/FORWARD chain 設定的規則都清空。

-X 是刪除使用者自訂 table 專案,一般使用 iptables -N xxx 新增自訂 chain 後,可以使用 iptables -X xxx 刪除之。