1.永久性生效,重啟后不會復原
開啟: chkconfig iptables on
關閉: chkconfig iptables off
2.即時生效,重啟后復原
開啟: service iptables start
關閉: service iptables stop
3.查詢TCP連接情況:
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
4.查詢端口占用情況:
netstat -anp | grep portno(例如:netstat –apn | grep 80)