八月
27
2005

[轉貼] 用iptables封杀qq及msn

Iptables来限制上QQ

2004-04-23 15:18 pm

作者:作者

来自:Linux知识宝库

现载:http://www.douzhe.com/docs/linuxtips/

地址:无名

QQ的是source-port 4000,destination-port 8000

只需要在FORWARD里加入一条规则就可以

iptables -A FORWARD -i eth0 -p udp –dport 8000 -j DROP

这里的eth0是内网网卡.

要删了这条规则只需要输入:

iptables -D FORWARD 1

这里的1是指它的序号

附:

封杀MSN的方法:

/sbin/iptables -I FORWARD -d gateway.messenger.hotmail.com -j DROP

/sbin/iptables -I FORWARD -p tcp –dport 1863 -j DROP

将IP找出来封了,下面的IP几乎包括了QQ的全部,当然可能还有一些漏掉了,大家一起找啦~

iptables -A FORWARD -s 0/0 -d 202.96.170.164 -j DROP

iptables -A FORWARD -s 0/0 -d 202.96.170.165 -j DROP

iptables -A FORWARD -s 0/0 -d 202.96.170.175 -j DROP

iptables -A FORWARD -s 0/0 -d 202.96.170.188 -j DROP

iptables -A FORWARD -s 0/0 -d 61.135.131.240 -j DROP

iptables -A FORWARD -s 0/0 -d 61.141.194.203 -j DROP

iptables -A FORWARD -s 0/0 -d 61.141.194.231 -j DROP

iptables -A FORWARD -s 0/0 -d 61.141.194.224 -j DROP

iptables -A FORWARD -s 0/0 -d 218.18.95.165 -j DROP

iptables -A FORWARD -s 0/0 -d 219.133.40.15 -j DROP

iptables -A FORWARD -s 0/0 -d 61.144.238.137 -j DROP

iptables -A FORWARD -s 0/0 -d 61.144.238.145 -j DROP

iptables -A FORWARD -s 0/0 -d 61.144.238.146 -j DROP

iptables -A FORWARD -s 0/0 -d 61.144.238.150 -j DROP

iptables -A FORWARD -s 0/0 -d 61.144.238.151 -j DROP

iptables -A FORWARD -s 0/0 -d 202.104.129.254 -j DROP

iptables -A FORWARD -s 0/0 -d 202.104.129.252 -j DROP

iptables -A FORWARD -s 0/0 -d 202.104.129.253 -j DROP

iptables -A FORWARD -s 0/0 -d 202.104.129.251 -j DROP

iptables -A FORWARD -s 0/0 -d 202.104.129.242 -j DROP

iptables -A FORWARD -s 0/0 -d 202.104.129.246 -j DROP

iptables -A FORWARD -s 0/0 -d 202.103.190.61 -j DROP

iptables -A FORWARD -s 0/0 -d 202.103.149.40 -j DROP

iptables -A FORWARD -s 0/0 -d 218.18.95.165 -j DROP

iptables -A FORWARD -s 0/0 -d 218.18.95.140 -j DROP

iptables -A FORWARD -s 0/0 -d 218.18.95.153 -j DROP

iptables -A FORWARD -s 0/0 -d 218.17.209.23 -j DROP

iptables -A FORWARD -s 0/0 -d 218.17.217.103 -j DROP

iptables -A FORWARD -s 0/0 -d 218.17.209.42 -j DROP

Comments are closed.