Posted on 2012-02-27 10:41
Milo的海域 阅读(225)
评论(0) 编辑 收藏 所属分类:
Linux
Disable/Enable PORT
#disable port 29600
iptables -I INPUT -p tcp --dport 29600 -j DROP
iptables -I OUTPUT -p tcp --dport 29600 -j DROP
#enable port 29600 after disabled
iptables -D INPUT -p tcp --dport 29600 -j DROP
iptables -D OUTPUT -p tcp --dport 29600 -j DROP
Block Ipaddress
# Block comming packets of ipaddress, then all packets come from this address will be dropped
iptables -A INPUT -s 192.168.1.5 -j DROP
# Block outgoing packets of ipaddress, then all packets sent to that address will be dropped
iptables -A OUTPUT -p tcp -d 192.168.1.2 -j DROP
Disable NIC traffic
# disable
iptables -A INPUT -jDROP -i eth1
iptables -A OUTPUT -jDROP -o eth1
# enable back
iptables -D INPUT -jDROP -i eth1
iptables -D OUTPUT -jDROP -o eth1
links
http://wiki.centos.org/HowTos/Network/IPTableshttp://www.thegeekstuff.com/2011/06/iptables-rules-examples/