多用户平等分享带宽
本帖最后由 bob2016 于 2009-7-29 22:26 编辑Equal bandwidth sharing among users
多用户平等分享带宽
This example shows how to equally share 10Mibps download and 2Mibps upload among active users in the network 192.168.0.0/24. If Host A is downloading 2 Mibps, Host B gets 8 Mibps and vice versa. There might be situations when both hosts want to use maximum bandwidth (10 Mibps), then they will receive 5 Mibps each, the same goes for upload. This setup is also valid for more than 2 users.
这个例子说明的是如何使多个在线用户平等分享10M下载和2M上传带宽,这些用户所在的网络是192.168.0.0/24。如果主机A正以2M速度下载文件,那么主机B就可以得到8M的下载带宽,反之亦然。有可能这这么一种情况,两台主机都想以最大速度下载,这时每台主机只能得到5M的下载速度。上传的情形和下载的情形一样。下面这个设置也适合多于2个用户的情况。
At first, mark all traffic, coming from local network 192.168.0.0/24 with a mark users:
首先,标记所有来自本地网络192.168.0.0/24的数据,标记名为users。
/ip firewall mangle add chain=forward src-address=192.168.0.0/24 \
action=mark-connection new-connection-mark=users-con
/ip firewall mangle add connection-mark=users-con action=mark-packet \
new-packet-mark=users chain=forward
Now we will add 2 new PCQ types. The first, called pcq-download will group all traffic by destination address. As we will attach this queue type to the Local interface, it will create a dynamic queue for each destination address (user) which is downloading to the network 192.168.0.0/24. The second type, called pcq-upload will group the traffic by source address. We will attach this queue to the Public interface so it will make one dynamic queue for each user who is uploading to Internet from the local network 192.168.0.0/24.
现在我们将添加2个新的PCQ类型。第一PCQ类型命名为pcq-download,它根据目的地址把所有的数据流分组。当我们把pcq-download这个PCQ类型附加到Local接口,它将为每一个向192.168.0.0/24网络下载数据的目的地址(用户)创建一个动态的队列。第二QCQ类型命名为pcq-upload,它将根据源地址对数据交流进行分组。我们将把这个PCQ类型附加到Public接口上,然后它会为每个从192.168.0.0/24本地网络向Internet上传数据的用户创建一个动态的队列。
/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address
/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address
Finally, make a queue tree for download traffic:
最后,创建一个队列树用来下载数据:
/queue tree add name=Download parent=Local max-limit=10240000
/queue tree add parent=Download queue=pcq-download packet-mark=users
And for upload traffic:
再创建一个队列树用来上传数据:
/queue tree add name=Upload parent=Public max-limit=2048000
/queue tree add parent=Upload queue=pcq-upload packet-mark=users
Note! If your ISP cannot guarantee you a fixed amount of traffic, you can use just one queue for upload and one for download, attached directly to the interface:
注意:如果你的网络服务提供商不能保证提供给你一个固定带宽的线路,你可以为上传和下载各使用一个队列,每个队列直接附加到各自的接口上。
/queue tree add parent=Local queue=pcq-download packet-mark=users
/queue tree add parent=Public queue=pcq-upload packet-mark=users
{:3_65:} 没说明什么版本?编辑也很乱.也没有效果图 拿来主义,它还会说什么 顶一下
页:
[1]