http://man.chinaunix.net/network/iptables-tutorial-cn-1.1.19.html
我的开发环境提交到svn后别的同事总是连我本机的很多服务器搞的混乱不堪和性能低下,一狠心都给禁了。
http://blog.51yip.com/linux/1404.html
# Generated by iptables-save v1.4.8 on Tue Nov 4 17:49:12 2014
*nat
:PREROUTING ACCEPT [677970:170522786]
:POSTROUTING ACCEPT [13734:839124]
:OUTPUT ACCEPT [13734:839124]
-A PREROUTING -d 192.168.0.240/32 -p tcp -m tcp --dport 5222 -j DNAT --to-destination 192.168.240.4:5222
-A PREROUTING -d 192.168.0.240/32 -p tcp -m tcp --dport 2222 -j DNAT --to-destination 192.168.240.1:5222
COMMIT
# Completed on Tue Nov 4 17:49:12 2014
# Generated by iptables-save v1.4.8 on Tue Nov 4 17:49:12 2014
*filter
:INPUT DROP [81873:6697437]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [1734107:162187546]
-A INPUT -s 192.168.240.0/24 -j ACCEPT
-A INPUT -s 192.168.0.240/32 -j ACCEPT
-A INPUT -s 192.168.0.241/32 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
-A INPUT -s 192.168.55.163/32 -j ACCEPT
-A FORWARD -s 192.168.240.0/24 -j ACCEPT
COMMIT
# Completed on Tue Nov 4 17:49:12 2014