WIFIHELL - 科技改变生活

 找回密码
 注册WIFIHELL

QQ登录

只需一步,快速开始

开启左侧

ROS高级限速脚本

[复制链接]
222ba 发表于 2016-10-26 20:27:37 | 显示全部楼层 |阅读模式

注册WIFIHELL,浏览更多技术贴!

您需要 登录 才可以下载或查看,没有账号?注册WIFIHELL

x


  1. ##作者测试过几个企业,1个网吧(游戏下行都走小包了),反应不错,HTB没有限速,要限速自己调整,调整后效果更理想.

  2. /ip firewall layer7-protocol
  3. add name=Tencent_qq regexp="^.\?.\?[\\x02|\\x05]\\x22\\x27.+|^.\?.\?[\\x02|\\x\
  4.     05]\\x22\\x27.+[\\x03|\\x09]\$|^.\?.\?\\x02.+\\x03\$|^/xFE/x42../x42/x02/x\
  5.     0B/x7D/x98/x38/xE4.+"
  6. add name=Tencent_qqgame regexp="^.\?.\?\\x2D.+[\\x25\\x62\\x0E\\xC1\\x5F\\x6C|\
  7.     \\xFF\\xFF\\x20\\xCF\\x42\\x53|\\xFF\\xFF\\x10\\x17\\x87\\xA3|\\x3E\\x7F\\\
  8.     x20\\xCF\\x42\\x53|\\x1F\\x43\\x10\\x17\\x87\\xA3]|^\\x05\\x22.+\\x03\[        DISCUZ_CODE_1        ]quot;
  9. add name=PPStream regexp="^.\?.\?\\c.+\\c"
  10. add name=QQMusic regexp=\
  11.     "(^\\xFE.\?.\?.\?.\?\\xCF|^get.+\\qqmusic.\?\\qq.+\\qqmusic)"
  12. add name=QQLive regexp="(^get.+\\video.\?\\qq.+\\flv|^\\xFE.\?.\?.\?.\?\\xD3|^\
  13.     get.+\\video.\?\\qq.+\\mp4)"
  14. add name=Kugou regexp=\
  15.     "(^post.+\\x0D\\x0A\\x0D\\x0A|^http.+\\x0D\\x0A\\x0D\\x0A|^e)"
  16. add name=Http regexp="http/(0\\.9|1\\.0|1\\.1) [1-5][0-9][0-9] [\t-\r -~]*(con\
  17.     nection:|content-type:|content-length:|date:)|post [\t-\r -~]* http/[01]\\\
  18.     .[019]"
  19. add name=Http-img regexp="\\.jpg|\\.png|\\.gif|\\.bmp|\\.jpeg"
  20. add name=Http-web regexp=\
  21.     "\\.jsp|\\.shtml|\\.html|\\.htm|\\.php|\\.asp|\\.aspx|\\.cgi"
  22. add name=NetTV regexp=\
  23.     "^.*get.+(\\.flv|\\.f4v|\\.hlv|\\.rm|\\.swf|\\.wma|\\.mp4|\\.mp3).*\[        DISCUZ_CODE_1        ]quot;
  24. add name=File regexp="^.*get.+(\\.iso|\\.exe|\\.zip|\\.rar|\\.7z|\\.gho|\\.pdf\
  25.     |\\.avi|\\.mkv|\\.wmv|\\.wav|\\.flac|\\.ape|\\.msi).*\[        DISCUZ_CODE_1        ]quot;
  26. add name=QQsp regexp="(^\\x03.\?\\xE1\\x8D|^\\x02\\x02|^\\x04\\x1E)"
  27. add name=DNS regexp="^.\?.\?.\?.\?[\\x01\\x02].\?.\?.\?.\?.\?.\?[\\x01-\?][a-z\
  28.     0-9][\\x01-\?a-z]*[\\x02-\\x06][a-z][a-z][fglmoprstuvz]\?[aeop]\?(um)\?[\\\
  29.     x01-\\x10\\x1c][\\x01\\x03\\x04\\xFF]"
  30. add name=Http-jpg regexp="^.*(post|POST|get|GET).+\\.jpg.+\\http"
  31. /ip firewall address-list
  32. add address=10.0.0.0/24 list=OnLineClient
  33. /ip firewall filter
  34. add action=drop chain=input dst-port=22 protocol=tcp
  35. /ip firewall mangle
  36. add action=change-ttl chain=forward new-ttl=set:128
  37. add action=change-mss chain=forward new-mss=1440 protocol=tcp tcp-flags=syn \
  38.     tcp-mss=1441-65535
  39. add action=mark-connection chain=forward comment="DNS\BA\CDICMP" \
  40.     layer7-protocol=DNS new-connection-mark=dns&icmp
  41. add action=mark-connection chain=forward new-connection-mark=dns&icmp \
  42.     protocol=icmp
  43. add action=mark-packet chain=forward connection-mark=dns&icmp \
  44.     new-packet-mark=DNS&ICMP_up passthrough=no src-address-list=OnLineClient
  45. add action=mark-packet chain=forward connection-mark=dns&icmp \
  46.     dst-address-list=OnLineClient new-packet-mark=DNS&ICMP_down passthrough=\
  47.     no
  48. add action=mark-connection chain=forward comment=http layer7-protocol=Http \
  49.     new-connection-mark=http
  50. add action=mark-connection chain=forward layer7-protocol=Http-web \
  51.     new-connection-mark=http
  52. add action=mark-connection chain=forward layer7-protocol=Http-jpg \
  53.     new-connection-mark=http
  54. add action=mark-connection chain=forward layer7-protocol=Http-img \
  55.     new-connection-mark=http
  56. add action=mark-packet chain=forward connection-mark=http dst-address-list=\
  57.     OnLineClient new-packet-mark=http_down passthrough=no
  58. add action=mark-packet chain=forward connection-mark=http new-packet-mark=\
  59.     http_up passthrough=no src-address-list=OnLineClient
  60. add action=mark-connection chain=forward comment="\B4\F3\D0\A1\B0\FC 0-511" \
  61.     new-connection-mark=small511_conn packet-size=0-511 protocol=tcp \
  62.     src-port=!80
  63. add action=mark-connection chain=forward new-connection-mark=small511_conn \
  64.     packet-size=0-511 protocol=udp
  65. add action=mark-packet chain=forward connection-mark=small511_conn \
  66.     new-packet-mark=small511_u packet-size=128-511 passthrough=no \
  67.     src-address-list=OnLineClient
  68. add action=mark-packet chain=forward connection-mark=small511_conn \
  69.     new-packet-mark=small511_d packet-size=128-511 passthrough=no
  70. add action=mark-connection chain=forward comment=vido layer7-protocol=NetTV \
  71.     new-connection-mark=vido
  72. add action=mark-connection chain=forward layer7-protocol=PPStream \
  73.     new-connection-mark=vido
  74. add action=mark-connection chain=forward layer7-protocol=QQLive \
  75.     new-connection-mark=vido
  76. add action=mark-packet chain=forward connection-mark=vido dst-address-list=\
  77.     OnLineClient new-packet-mark=vido_down passthrough=no
  78. add action=mark-packet chain=forward connection-mark=vido new-packet-mark=\
  79.     vidio_up passthrough=no src-address-list=OnLineClient
  80. add action=mark-connection chain=forward comment=file layer7-protocol=File \
  81.     new-connection-mark=file
  82. add action=mark-connection chain=forward layer7-protocol=QQMusic \
  83.     new-connection-mark=file
  84. add action=mark-connection chain=forward layer7-protocol=Kugou \
  85.     new-connection-mark=file
  86. add action=mark-packet chain=forward connection-mark=file dst-address-list=\
  87.     OnLineClient new-packet-mark=file_down passthrough=no
  88. add action=mark-packet chain=forward new-packet-mark=file_up passthrough=no \
  89.     src-address-list=OnLineClient
  90. add action=mark-connection chain=forward comment=\
  91.     "\B4\F3\D0\A1\B0\FC 1301-1500" new-connection-mark=big1500_conn \
  92.     packet-size=1301-1500
  93. add action=mark-packet chain=forward connection-mark=big1500_conn \
  94.     new-packet-mark=big1500_u packet-size=1301-1500 passthrough=no \
  95.     src-address-list=OnLineClient
  96. add action=mark-packet chain=forward connection-mark=big1500_conn \
  97.     dst-address-list=OnLineClient new-packet-mark=big1500_d packet-size=\
  98.     1301-1500 passthrough=no
  99. add action=mark-connection chain=forward comment=other new-connection-mark=\
  100.     other
  101. add action=mark-packet chain=forward connection-mark=other dst-address-list=\
  102.     OnLineClient new-packet-mark=other_down passthrough=no
  103. add action=mark-packet chain=forward comment="\BD\E1\CA\F8" connection-mark=\
  104.     other new-packet-mark=other_up passthrough=no src-address-list=\
  105.     OnLineClient
  106. # jan/27/2015 01:53:30 by RouterOS 6.22.1
  107. # software id = TAYM-FTBN
  108. #
  109. /queue type
  110. add kind=pcq name=0m_down pcq-classifier=dst-address pcq-total-limit=10000
  111. add kind=pcq name=0m_up pcq-classifier=src-address pcq-total-limit=10000
  112. /queue tree
  113. add name=down parent=global queue=default
  114. add name=icmp@dns_down packet-mark=DNS&ICMP_down parent=down priority=1 \
  115.     queue=0m_down
  116. add name=http_down packet-mark=http_down parent=down priority=3 queue=0m_down
  117. add name=vido packet-mark=vido_down parent=down priority=5 queue=0m_down
  118. add name=file packet-mark=file_down parent=down priority=7 queue=0m_down
  119. add name=other packet-mark=other_down parent=down priority=4 queue=0m_down
  120. add name=up parent=global queue=default
  121. add name=icmp&dns_up packet-mark=DNS&ICMP_up parent=up priority=1 queue=0m_up
  122. add name=http_up packet-mark=http_up parent=up priority=3 queue=0m_up
  123. add name=vido_up packet-mark=vidio_up parent=up priority=5 queue=0m_up
  124. add name=file_up packet-mark=file_up parent=up priority=7 queue=0m_up
  125. add name=other_up packet-mark=other_up parent=up priority=4 queue=0m_up
  126. add name=big_packet packet-mark=big1500_d parent=down priority=6 queue=\
  127.     0m_down
  128. add name=small_packet packet-mark=small511_d parent=down priority=2 queue=\
  129.     0m_down
  130. add name=small_packet_up packet-mark=small511_u parent=up priority=2 queue=\
  131.     0m_up
  132. /queue interface
  133. set WAN queue=default
复制代码


WIFIHELL | 万丰乐活 2020开启新的征程,好货不断!
关闭

站点推荐上一条 /1 下一条

万丰乐活

GMT+8, 2024-4-25 12:10

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表