原文地址:
openwrt的qos基于hsfc。提供了分类标记,流量控制等功能,可能还有整形
实际使用下来效果很不错。像是基于优先级的公平队列。
openwrt默认提供了四个队列级别
Class Packets 字节
Priority 17172 1666639 (1.6 MiB)
Express 2784325 270790491 (258.2 MiB)
Normal 3993830 3667146683 (3.4 GiB)
Bulk 7539946 6768585796 (6.3 GiB)
Priority 优先级最高,manrk=01
Express 其次,mark=02
Normal 正常,mark=03
Bulk 可支持延时传输或者丢弃较多的数据,mark=04
L7 识别率较低,主要还是靠ipp2p和默认优先级的方法来控制下载流量。
可以尝试通过编辑/etc/config/qos文件加入更多的优先级。
这里先实行基于l7+ipp2p的过滤。另外配合端口优先级和ip优先级一起使用。
达到的效果,用户可以随意BT或者迅雷下载,在带宽无人使用时,P2P流量可以占满带宽,当用户使用http等高优先级服务时,P2P流量自动被降低速度。
这个QOS不提供针对单独用户的速度控制。
征集白鼠一到两只,要求使用论坛版本的openwrt。
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
安装组件
-
opkg update
-
opkg install iptables-mod-ipp2p kmod-ipt-ipp2p kmod-ipt-ipopt iptables-mod-ipopt luci-app-qos
复制代码
下载l7-protocols_2009-05-28-1_brcm63xx.ipk 包
解压缩之后,提取里面所有的pat文件上传到/etc/l7-protocols目录下
我的QOS配置文件
提供给大家参考
-
-
config 'interface' 'wan'
-
option 'classgroup' 'Default'
-
option 'enabled' '1'
-
option 'overhead' '1'
-
option 'download' '2048'
-
option 'upload' '1000'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'ports' '22,23,53,3389,5060,5900,8000'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'dazhihui'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'h323'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'msnmessenger'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'pcanywhere'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'qq'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'radmin'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'rdp'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'rlogin'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'sip'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'skypeout'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'skypetoskype'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'tonghuashun'
-
-
config 'classify'
-
option 'target' 'Priority'
-
option 'layer7' 'vnc'
-
-
config 'classify'
-
option 'target' 'Express'
-
option 'layer7' 'html'
-
-
config 'classify'
-
option 'target' 'Express'
-
option 'layer7' 'jpeg'
-
-
config 'classify'
-
option 'target' 'Express'
-
option 'layer7' 'png'
-
-
config 'classify'
-
option 'target' 'Express'
-
option 'layer7' 'gif'
-
-
config 'classify'
-
option 'target' 'Express'
-
option 'layer7' 'flash'
-
-
config 'classify'
-
option 'target' 'Express'
-
option 'ports' '500,1194,1701,1720,1723,4500,5000'
-
-
config 'classify'
-
option 'target' 'Express'
-
option 'layer7' 'msn-filetransfer'
-
-
config 'classify'
-
option 'target' 'Express'
-
option 'layer7' 'socks'
-
-
config 'classify'
-
option 'target' 'Express'
-
option 'layer7' 'ssl'
-
-
config 'classify'
-
option 'target' 'Express'
-
option 'layer7' 'ciscovpn'
-
-
config 'classify'
-
option 'target' 'Normal'
-
option 'srchost' '192.168.0.100'
-
-
config 'classify'
-
option 'target' 'Normal'
-
option 'proto' 'tcp'
-
option 'ports' '20,21,25,80,110,443,993,995'
-
-
config 'classify'
-
option 'target' 'Normal'
-
option 'layer7' 'rtp'
-
-
config 'classify'
-
option 'target' 'Normal'
-
option 'layer7' 'rtsp'
-
-
config 'reclassify'
-
option 'target' 'Express'
-
option 'proto' 'udp'
-
option 'pktsize' '-500'
-
-
config 'default'
-
option 'target' 'Priority'
-
option 'proto' 'icmp'
-
-
config 'reclassify'
-
option 'target' 'Priority'
-
option 'proto' 'tcp'
-
option 'mark' '!Bulk'
-
option 'tcpflags' 'SYN'
-
option 'pktsize' '-128'
-
-
config 'classgroup' 'Default'
-
option 'classes' 'Priority Express Normal Bulk Drop'
-
option 'default' 'Bulk'
-
-
config 'class' 'Priority'
-
option 'packetsize' '400'
-
option 'maxsize' '400'
-
option 'avgrate' '10'
-
option 'priority' '20'
-
-
config 'class' 'Priority_down'
-
option 'packetsize' '1000'
-
option 'avgrate' '10'
-
-
config 'class' 'Express'
-
option 'packetsize' '1000'
-
option 'maxsize' '800'
-
option 'avgrate' '50'
-
option 'priority' '10'
-
-
config 'class' 'Normal'
-
option 'packetsize' '1500'
-
option 'packetdelay' '100'
-
option 'avgrate' '10'
-
option 'priority' '5'
-
-
config 'class' 'Normal_down'
-
option 'avgrate' '20'
-
-
config 'class' 'Bulk'
-
option 'avgrate' '5'
-
option 'packetdelay' '100'
-
-
config 'class' 'Drop'
-
option 'avgrate' '1'
-
option 'packetdelay' '200'
-
-
config 'classify'
-
option 'layer7' 'xunlei'
-
option 'target' 'Drop'
-
-
config 'classify'
-
option 'layer7' 'bittorrent'
-
option 'target' 'Drop'
-
-
config 'classify'
-
option 'layer7' 'edonkey'
-
option 'target' 'Drop'
-
-
config 'classify'
-
option 'layer7' 'directconnect'
-
option 'target' 'Drop'
-
-
config 'classify'
-
option 'ipp2p' 'all'
-
option 'target' 'Bulk'
-
-
复制代码
openwrt的QOS默认只有四个级别,我尝试增加了一个Drop
FTTB+LAN上传带宽我设置了在1000K,下载带宽设置了2048
务必根据自己实际带宽情况来配置QOS带宽。不建议将带宽限制过小。
阅读(2757) | 评论(0) | 转发(0) |