帶寬均分+小包優先

網上的類似的東西太多了,結合起來,簡化了一下

v0.1 (2010.05.24)

1.帶寬均分:(mangle 中 chain 可以選擇prerouting 或者forward)
# 標記所有的包 mark connection
/ip firewall mangle add chain=forward src-address=192.168.0.0/22 \
action=mark-connection new-connection-mark=users-con
# 標記 user-con 的packet 包 標記爲user
/ip firewall mangle add connection-mark=users-con action=mark-packet \
new-packet-mark=users chain=forward

# 定義下載的pcq ,注意選擇pcq-classifier爲dst-address ,區別於上傳
/queue type add name=pcq-download kind=pcq pcq-classifier=dst-address

#定義上傳的pcq

/queue type add name=pcq-upload kind=pcq pcq-classifier=src-address
#定義下載的最大帶寬,lan爲局域網接口
/queue tree add name=Download parent=lan max-limit=100M
/queue tree add parent=Download queue=pcq-download packet-mark=users
#定義上傳的最大帶寬,Wan爲internet接口,如果多線,依次定義
/queue tree add name=Upload parent=wan max-limit=40M
/queue tree add parent=Upload queue=pcq-upload packet-mark=users

#定義 上傳,限速在40M,我這裏有雙線,所以都定義了。

 /queue tree

name="upload-cnc" parent=cnc limit-at=0 priority=8 max-limit=40M
     burst-limit=0 burst-threshold=0 burst-time=0s

  name="queue1" parent=upload-cnc packet-mark=users limit-at=0 queue=defaul>
     priority=8 max-limit=0 burst-limit=0 burst-threshold=0 burst-time=0s

   name="upload-tel" parent=tel limit-at=0 priority=8 max-limit=40M
     burst-limit=0 burst-threshold=0 burst-time=0s

   name="queue3" parent=upload-tel packet-mark=users limit-at=0
     queue=pcq-upload priority=8 max-limit=0 burst-limit=0 burst-threshold=0
     burst-time=0s

2.小包策略

# mark small packet
add chain=forward packet-size=32-512 action=mark-packet new-packet-mark=small    passthrough=yes comment="" disabled=no
# mark big packet
add chain=forward packet-size=512-1200 action=mark-packet new-packet-mark=big    passthrough=yes comment="" disabled=no
 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章