###### tags: `Linux` # iptables 1.查看 ``` iptables -nL iptables -nL [-t 表名] [鏈名] iptables -nL --line-number ``` 2-1.清除 ``` iptables -X iptables -F iptables -Z ``` 2-2.清除nat ``` iptables -t nat -X ``` 3.開啟tcp/udp port ``` iptables -A INPUT -p tcp --dport XX -j ACCEPT (chain) (tcp/udp) (port number) (ACCEPT/DROP) ``` 4.刪除 ``` iptables -D INPUT 2 (chain) 第幾條 ``` 5.參數 ``` -d 目的ip -s 來源ip -i 介面 -t 協定 ``` 6.導出 ``` iptables-save >> /PATH/檔案名稱 ``` 7.導入 ``` iptables-restone < /PATH/導出的檔案 ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up