service iptables status|start|stop|restarttcp
service iptables save iptables-saveide
iptables -L #顯示 iptables -F #清空spa
iptables -L -n --line-numberrest
iptables -P INPUT ACCEPT|DROP| REJECT #設置默認規則ip
iptables -A INPUT -s 192.168.1.102 -j DROP #阻止來自於192.168.1.102的數據路由
iptables -D INPUT n(第幾條) #刪除INPUT中的第幾條it
iptables -A INPUT -p tcp --dport 80 -j ACCEPT #容許訪問80端口io
iptables -A INPUT -i eth0 -j DROP #阻止進入eth0網卡table
iptables -A OUTPUT -o eth0 -j DROP #阻止出去eth0網卡class
iptables -A INPUT -p icmp -j DROP #禁ping
iptables -P FORWARD -d X.X.X.X -p tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -P FORWARD -s X.X.X.X -p tcp --dport 80 -m state --state ESTABLISHED -j ACCEPT
iptables -t nat -A PREROUTING -d X.X.X.X -p tcp --dport 80
iptables -t nat -A PREROUTING -d X.X.X.X -p tcp --dport 21 -j DNAT --to-destination Y.Y.Y.Y
iptables -t nat -A PREROUTING -d X.X.X.X -p tcp -m state --state RELATED -j DNAT --to-destination Y.Y.Y.Y
route add -net 192.168.20.0 netmask 255.255.255.0 gw 192.168.10.1 ###添加路由
route add default gw X.X.X.X ####添加默認網關