iptables -L -n --line-number
- iptables端口配置(不開通3389沒法遠程鏈接,不開通icmp沒法ping)
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 443 -j ACCEPT
iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 3306 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
iptables -D INPUT 1
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
service iptables save && service iptables restart
chkconfig iptables off && service iptables stop