|
楼主 |
发表于 2005-1-21 09:51:41
|
显示全部楼层
这是官方关于限制P2P下载上传速度的资料,我按下面的方法做了以后并没有发现有效果,我限制BT下载为56K,可是用Bitcomet实际下载速度却可以上到100K以上,禁止BT的设置我已经做成功了,但是有些游戏,比如大话西游II是用BT更新的,所以不能完全禁止。有做成功过的兄弟来指点一下啊!Peer-to-Peer Limitation with PCQLet us consider a situation where the limited network is 192.168.0.0/24 (see the picture above). Wewill limit the p2p download traffic to 256kbit/s and upload to 128kbit/sThe 192.168.0.0/24 network has to be masquaraded in order to get public access (it will use theaddress 10.0.0.217). To do so, we will masquerade this network.[admin@MikroTik] ip firewall src-nat> add src-address=192.168.0.0/24 \\... action=masquerade[admin@MikroTik] ip firewall src-nat> printFlags: X - disabled, I - invalid, D - dynamic0 src-address=192.168.0.0/24 action=masquerade[admin@MikroTik] ip firewall src-nat>Then we have to mark download and upload traffic. To do so with masqueraded traffic, let's add 2mangle rules - the first one stands for marking the p2p connection with the mark p2p_con which iscomming from the local network (192.168.0.0/24) , the second one will mark all packets whithinthis connection with mark p2p_limit, which will be used for limiting the upload and downloadtraffic.[admin@MikroTik] ip firewall mangle> add src-address=192.168.0.0/24 p2p=all-p2p \\... mark-connection=p2p_con action=passthrough[admin@MikroTik] ip firewall mangle> add connection=p2p_con action=acceptmark-flow=p2p_limit[admin@MikroTik] ip firewall mangle>Next, we will make two PCQ types - one for download (pcq-download), and one for upload(pcq-upload).[admin@MikroTik] queue type> add kind=pcq name=pcq-download \\... pcq-rate=256000 pcq-classifier=dst-address[admin@MikroTik] queue type> add kind=pcq name=pcq-upload \\... pcq-rate=128000 pcq-classifier=src-address[admin@MikroTik] queue type> print0 name="default" kind=pfifo bfifo-limit=15000 pfifo-limit=50 red-limit=60red-min-threshold=10 red-max-threshold=50 red-burst=20 sfq-perturb=5sfq-allot=1514 pcq-rate=0 pcq-limit=50 pcq-classifier1 name="ethernet-default" kind=pfifo bfifo-limit=15000 pfifo-limit=50Page 432 of 545red-limit=60 red-min-threshold=10 red-max-threshold=50 red-burst=20sfq-perturb=5 sfq-allot=1514 pcq-rate=0 pcq-limit=50 pcq-classifier2 name="wireless-default" kind=sfq bfifo-limit=15000 pfifo-limit=50red-limit=60 red-min-threshold=10 red-max-threshold=50 red-burst=20sfq-perturb=5 sfq-allot=1514 pcq-rate=0 pcq-limit=50 pcq-classifier3 name="synchronous-default" kind=red bfifo-limit=15000 pfifo-limit=50red-limit=60 red-min-threshold=10 red-max-threshold=50 red-burst=20sfq-perturb=5 sfq-allot=1514 pcq-rate=0 pcq-limit=50 pcq-classifier4 name="pcq-download" kind=pcq bfifo-limit=15000 pfifo-limit=50 red-limit=60red-min-threshold=10 red-max-threshold=50 red-burst=20 sfq-perturb=5sfq-allot=1514 pcq-rate=256000 pcq-limit=50 pcq-classifier=dst-address5 name="pcq-upload" kind=pcq bfifo-limit=15000 pfifo-limit=50 red-limit=60red-min-threshold=10 red-max-threshold=50 red-burst=20 sfq-perturb=5sfq-allot=1514 pcq-rate=128000 pcq-limit=50 pcq-classifier=src-address[admin@MikroTik] queue type>And finally, add the queue rules.[admin@MikroTik] queue tree> add name=down parent=Local \\... flow=p2p_limit queue=pcq-download[admin@MikroTik] queue tree> add name=up parent=Public \\... flow=p2p_limit queue=pcq-upload[admin@MikroTik] queue tree> printFlags: X - disabled, I - invalid, D - dynamic0 name="down" parent=Local flow=p2p_limit limit-at=0queue=pcq-download priority=8 max-limit=0 burst-limit=0burst-threshold=0 burst-time=01 name="up" parent=Public flow=p2p_limit limit-at=0 queue=pcq-uploadpriority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0[admin@MikroTik] queue tree>Page 433 of 545 |
|