iptables不寫規則

iptables不寫規則

我以 root 身分執行這兩個規則,但是當執行 iptables -L 時,它沒有顯示任何規則,有人知道問題是什麼嗎?

iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 --source 84.244.145.135 -j REDIRECT --to-port 1222
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 --source 243.134.97.194 -j REDIRECT --to-port 1222


duno@Virtual-Box:/home/glennwiz# iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

答案1

您將它們新增至 nat talbe,預設情況下 iptables 會列出過濾表。若要查看您新增的內容,請執行:

iptables -t nat -nL

相關內容