跳至主要内容

Blocking China

The last few days there are so many connections to our mirror server from China that I started to block certain subnets. There are usually around 10 clients connecting via HTTP and each is opening over 50 connections to our server. They are downloading mainly ISO images and other big files. I can see that each client is starting to download lots of different things. From Fedora 3 to Fedora 7 ISO images, Ubuntu ISO images, openSUSE ISO images and other old and large files.
I started to block individual IP addresses but there are just too many so that I started to block whole subnets. I am using the following command to get an overview about which clients are opening many connections at once:
lynx -dump -width=2000 http://localhost/server-status awk -F\ '{ print $11} ' sort -n uniq -c sort -n.
The output looks something like this: 21 122.48.129.75
23 210.21.106.229
24 218.17.228.216
26 220.175.101.252
27 222.67.18.227
30 222.27.89.136
39 123.116.101.186
52 121.231.17.153
63
63 ::1
With the following command I am calculating the netmask which will be blocked:
$ whois 121.231.17.153 grep inetn sed -e "s, - ,:,g" awk ' { print "netmask "$2 }' sh
121.224.0.0/12
And then I am using a simple iptables rule to drop any traffic coming from that network:
iptables -A INETIN -s 121.224.0.0/12 -j DROP
Currently this is the only idea I have how to get rid of those ~500 connections which seem to be some kind of abuse.
-------------------------------
今天早上看cnBeta得到的消息,Adrian doing the blog 的BLOG来的,迅雷带来的影响看来波及国外了,无节制的获取而不付出,不知道是为了什么。

评论

此博客中的热门博文

Python学习笔记20100117

映射list   Dictionary 是用{}. list 是一那个[]. turple是用() 当你定义过dictionary后,你可以使用d.keys(), d.values(),d.items()将定义后的时候分别显示出来 当然可以将list里的值加减乘除,也可以如一般的定义直接重新复制这个list. 链接与分割字符串的 li=";", join(li) 则显示的就是 分隔符为;的数 如果使用li=li.split(";")则将刚刚;的分隔符删除,而split里也可定义域,如li.split(";",1)   自省 <---这是啥 之前在使用的时候发觉有些书本上的模块不能调用,很多是py脚本定义过的函数。 下载该脚本s,然后上传至指定位置。 >>>import sys >>>sys.path >>>sys.path.append("绝对位置")然后就能调用这些脚本和参数了。 删除 >>>sys.path.pop() 定义一个参数是 def info(test, test1=10.test2=12): info是函数名,test是必备参数,因为没有定义值,test1和test2是可选参数,定义了初始值   以上是外部函数的调用,下面转到内部函数 内部函数有type,str,dir及其他   ---type 返回任意字符的类型,模块也可以。types模块 >>> type(1) <type 'int'> >>> li=[] >>> type(li) <type 'list'> >>> import odbchelper >>> type(odbchelper) <type 'module'> >>> type(sys) <type 'module'> >>> import types ...

4 steps to delete account in Gerrit DB

4 steps to delete account in DB. Delete from accounts where preferred_email=’’; delete from account_ssh_keys where account_id=''; delete from account_external_ids where external_id='gerrit:*’; delete from account_external_ids where external_id='username:*’; whatever it was in H2 database and postgres db . H2: ssh -p 24198 localhost gerrit gsql Postgres: psql