作者: wsgtrsys
例子:
禁止關鍵字「sina",禁止訪問所有包含sina字符的網站。
iptables -I FORWARD -s 192.168.2.0/24 -m string --string "sina" -j DROP
限制某一個IP訪問端口23的並發數在2以內(不過好象不太正常):
iptables -A FORWARD -p tcp --syn --dport 23 -m connlimit --connlimit-above 2 -j DROP
設置IP 192.168.2.3在周一到周五早上8點到下午6點能訪問互聯網
iptables -I FORWARD -s 192.168.2.3 -m time --timestart 8:00 --timestop 18:00 --days Mon,Tue,Wed,Thu,Fri -j ACCEPT
阻止bittorretn協議:
iptables -t mangle -A POSTROUTING -m layer7 --l7proto bittorrent -j DROP
阻止MSN:
iptables -t mangle -A POSTROUTING -m layer7 --l7proto msnmessenger -j DROP
阻止QQ協議:
iptables -t mangle -A POSTROUTING -m layer7 --l7proto qq -j DROP
阻止CS:
iptables -t mangle -A POSTROUTING -m layer7 --l7proto counterstrike -j DROP
阻止雅虎通:
iptables -t mangle -A POSTROUTING -m layer7 --l7proto yahoo -j DROP
阻止socks代理:
iptables -t mangle -A POSTROUTING -m layer7 --l7proto socks -j DROP
限制BT協議的帶寬:
iptables -t mangle -A POSTROUTING -m layer7 --l7proto imap -j MARK --set-mark 3
tc filter add dev eth0 protocol ip parent 1:0 prio 1 handle 3 fw flowid 1:3
歡迎光臨 x2bbs (http://wen-jos.idv.tw/) | Powered by Discuz! 7.0.0 |