码迷,mamicode.com
首页 > 其他好文 > 详细

openwrt l7过滤qos配置

时间:2016-06-30 23:02:42      阅读:283      评论:0      收藏:0      [点我收藏+]

标签:

openwrt l7过滤qos配置 


   
技术分享
1#
本帖最后由 木鸟 于 2010-7-27 10:22 编辑

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。

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
安装组件
  1. opkg update
  2. 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配置文件
提供给大家参考
  1. config ‘interface‘ ‘wan‘
  2.         option ‘classgroup‘ ‘Default‘
  3.         option ‘enabled‘ ‘1‘
  4.         option ‘overhead‘ ‘1‘
  5.         option ‘download‘ ‘2048‘
  6.         option ‘upload‘ ‘1000‘
  7. config ‘classify‘
  8.         option ‘target‘ ‘Priority‘
  9.         option ‘ports‘ ‘22,23,53,3389,5060,5900,8000‘
  10. config ‘classify‘
  11.         option ‘target‘ ‘Priority‘
  12.         option ‘layer7‘ ‘dazhihui‘
  13. config ‘classify‘
  14.         option ‘target‘ ‘Priority‘
  15.         option ‘layer7‘ ‘h323‘
  16. config ‘classify‘
  17.         option ‘target‘ ‘Priority‘
  18.         option ‘layer7‘ ‘msnmessenger‘
  19. config ‘classify‘
  20.         option ‘target‘ ‘Priority‘
  21.         option ‘layer7‘ ‘pcanywhere‘
  22. config ‘classify‘
  23.         option ‘target‘ ‘Priority‘
  24.         option ‘layer7‘ ‘qq‘
  25. config ‘classify‘
  26.         option ‘target‘ ‘Priority‘
  27.         option ‘layer7‘ ‘radmin‘
  28. config ‘classify‘
  29.         option ‘target‘ ‘Priority‘
  30.         option ‘layer7‘ ‘rdp‘
  31. config ‘classify‘
  32.         option ‘target‘ ‘Priority‘
  33.         option ‘layer7‘ ‘rlogin‘
  34. config ‘classify‘
  35.         option ‘target‘ ‘Priority‘
  36.         option ‘layer7‘ ‘sip‘
  37. config ‘classify‘
  38.         option ‘target‘ ‘Priority‘
  39.         option ‘layer7‘ ‘skypeout‘
  40. config ‘classify‘
  41.         option ‘target‘ ‘Priority‘
  42.         option ‘layer7‘ ‘skypetoskype‘
  43. config ‘classify‘
  44.         option ‘target‘ ‘Priority‘
  45.         option ‘layer7‘ ‘tonghuashun‘
  46. config ‘classify‘
  47.         option ‘target‘ ‘Priority‘
  48.         option ‘layer7‘ ‘vnc‘
  49. config ‘classify‘
  50.         option ‘target‘ ‘Express‘
  51.         option ‘layer7‘ ‘html‘
  52. config ‘classify‘
  53.         option ‘target‘ ‘Express‘
  54.         option ‘layer7‘ ‘jpeg‘
  55. config ‘classify‘
  56.         option ‘target‘ ‘Express‘
  57.         option ‘layer7‘ ‘png‘
  58. config ‘classify‘
  59.         option ‘target‘ ‘Express‘
  60.         option ‘layer7‘ ‘gif‘
  61. config ‘classify‘
  62.         option ‘target‘ ‘Express‘
  63.         option ‘layer7‘ ‘flash‘
  64. config ‘classify‘
  65.         option ‘target‘ ‘Express‘
  66.         option ‘ports‘ ‘500,1194,1701,1720,1723,4500,5000‘
  67. config ‘classify‘
  68.         option ‘target‘ ‘Express‘
  69.         option ‘layer7‘ ‘msn-filetransfer‘
  70. config ‘classify‘
  71.         option ‘target‘ ‘Express‘
  72.         option ‘layer7‘ ‘socks‘
  73. config ‘classify‘
  74.         option ‘target‘ ‘Express‘
  75.         option ‘layer7‘ ‘ssl‘
  76. config ‘classify‘
  77.         option ‘target‘ ‘Express‘
  78.         option ‘layer7‘ ‘ciscovpn‘
  79. config ‘classify‘
  80.         option ‘target‘ ‘Normal‘
  81.         option ‘srchost‘ ‘192.168.0.100‘
  82. config ‘classify‘
  83.         option ‘target‘ ‘Normal‘
  84.         option ‘proto‘ ‘tcp‘
  85.         option ‘ports‘ ‘20,21,25,80,110,443,993,995‘
  86. config ‘classify‘
  87.         option ‘target‘ ‘Normal‘
  88.         option ‘layer7‘ ‘rtp‘
  89. config ‘classify‘
  90.         option ‘target‘ ‘Normal‘
  91.         option ‘layer7‘ ‘rtsp‘
  92. config ‘reclassify‘
  93.         option ‘target‘ ‘Express‘
  94.         option ‘proto‘ ‘udp‘
  95.         option ‘pktsize‘ ‘-500‘
  96. config ‘default‘
  97.         option ‘target‘ ‘Priority‘
  98.         option ‘proto‘ ‘icmp‘
  99. config ‘reclassify‘
  100.         option ‘target‘ ‘Priority‘
  101.         option ‘proto‘ ‘tcp‘
  102.         option ‘mark‘ ‘!Bulk‘
  103.         option ‘tcpflags‘ ‘SYN‘
  104.         option ‘pktsize‘ ‘-128‘
  105. config ‘classgroup‘ ‘Default‘
  106.         option ‘classes‘ ‘Priority Express Normal Bulk Drop‘
  107.         option ‘default‘ ‘Bulk‘
  108. config ‘class‘ ‘Priority‘
  109.         option ‘packetsize‘ ‘400‘
  110.         option ‘maxsize‘ ‘400‘
  111.         option ‘avgrate‘ ‘10‘
  112.         option ‘priority‘ ‘20‘
  113. config ‘class‘ ‘Priority_down‘
  114.         option ‘packetsize‘ ‘1000‘
  115.         option ‘avgrate‘ ‘10‘
  116. config ‘class‘ ‘Express‘
  117.         option ‘packetsize‘ ‘1000‘
  118.         option ‘maxsize‘ ‘800‘
  119.         option ‘avgrate‘ ‘50‘
  120.         option ‘priority‘ ‘10‘
  121. config ‘class‘ ‘Normal‘
  122.         option ‘packetsize‘ ‘1500‘
  123.         option ‘packetdelay‘ ‘100‘
  124.         option ‘avgrate‘ ‘10‘
  125.         option ‘priority‘ ‘5‘
  126. config ‘class‘ ‘Normal_down‘
  127.         option ‘avgrate‘ ‘20‘
  128. config ‘class‘ ‘Bulk‘
  129.         option ‘avgrate‘ ‘5‘
  130.         option ‘packetdelay‘ ‘100‘
  131. config ‘class‘ ‘Drop‘
  132.         option ‘avgrate‘ ‘1‘
  133.         option ‘packetdelay‘ ‘200‘
  134. config ‘classify‘
  135.         option ‘layer7‘ ‘xunlei‘
  136.         option ‘target‘ ‘Drop‘
  137. config ‘classify‘
  138.         option ‘layer7‘ ‘bittorrent‘
  139.         option ‘target‘ ‘Drop‘
  140. config ‘classify‘
  141.         option ‘layer7‘ ‘edonkey‘
  142.         option ‘target‘ ‘Drop‘
  143. config ‘classify‘
  144.         option ‘layer7‘ ‘directconnect‘
  145.         option ‘target‘ ‘Drop‘
  146. config ‘classify‘
  147.         option ‘ipp2p‘ ‘all‘
  148.         option ‘target‘ ‘Bulk‘

openwrt l7过滤qos配置

标签:

原文地址:http://www.cnblogs.com/destim/p/5631453.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!