Advertisement
Guest User

Untitled

a guest
Apr 11th, 2012
3,621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. # QoS configuration for OpenWrt
  2.  
  3. # INTERFACES:
  4. config interface wan
  5. option classgroup "Default"
  6. option enabled 1
  7. option overhead 1
  8. option upload 1024
  9. option download 1024
  10.  
  11. # RULES:
  12. config classify
  13. option target "Bulk"
  14. option srchost "192.168.1.20"
  15.  
  16. config classify
  17. option target "Bulk"
  18. option dsthost "192.168.1.20"
  19.  
  20. config classify
  21. option target "Bulk"
  22. option ipp2p "all"
  23.  
  24. config classify
  25. option target "Bulk"
  26. option layer7 "edonkey"
  27.  
  28. config classify
  29. option target "Bulk"
  30. option layer7 "bittorrent"
  31.  
  32. config classify
  33. option target "Priority"
  34. option ports "22,53"
  35.  
  36. config classify
  37. option target "Normal"
  38. option proto "tcp"
  39. option ports "20,21,25,80,110,443,993,995"
  40.  
  41. config classify
  42. option target "Express"
  43. option ports "5190"
  44.  
  45. config default
  46. option target "Express"
  47. option proto "udp"
  48. option pktsize "-500"
  49.  
  50. config default
  51. option target "Express"
  52. option proto "udp"
  53. option srcports "27000-27030"
  54.  
  55. config default
  56. option target "Express"
  57. option proto "udp"
  58. option dstports "27000-27030"
  59.  
  60. config default
  61. option target "Express"
  62. option proto "udp"
  63. option srcports "6112-6113"
  64.  
  65. config default
  66. option target "Express"
  67. option proto "udp"
  68. option dstports "6112-6113"
  69.  
  70. config default
  71. option target "Bulk"
  72. option portrange "1024-65535"
  73.  
  74. config reclassify
  75. option target "Priority"
  76. option proto "icmp"
  77.  
  78. config reclassify
  79. option target "Priority"
  80. option proto "tcp"
  81. option pktsize "-128"
  82. option mark "!Bulk"
  83. option tcpflags "SYN"
  84.  
  85. config reclassify
  86. option target "Priority"
  87. option proto "tcp"
  88. option pktsize "-128"
  89. option mark "!Bulk"
  90. option tcpflags "ACK"
  91.  
  92.  
  93. # Don't change the stuff below unless you
  94. # really know what it means :)
  95.  
  96. config classgroup "Default"
  97. option classes "Priority Express Normal Bulk"
  98. option default "Normal"
  99.  
  100. ### Params:
  101. #
  102. # maxsize:
  103. # limits packet size in iptables rule
  104. #
  105. # avgrate: (note: sum(avgrates) ~ 100)
  106. # rt m1 = avgrate / sum (avgrate) * max_bandwidth
  107. # rt m2 = avgrate * max_bandwidth / 100
  108. # ls m1 = rt m1
  109. #
  110. # packetsize & packetdelay: (only works if avgrate is present)
  111. # rt d = max( packetdelay, 'time required for packetsize to transfer' ) (smaller ps -> smaller d)
  112. # ls d = rt d
  113. #
  114. # priority:
  115. # ls m2 = priority / sum (priority) * max_bandwidth
  116. #
  117. # limitrate:
  118. # ul rate = limitrate * max_bandwidth / 100
  119.  
  120.  
  121. config class "Priority"
  122. option packetsize 400
  123. option maxsize 400
  124. option avgrate 49
  125. option priority 10
  126.  
  127. # u/d sum_avgrate = 10/10
  128.  
  129. config class "Express"
  130. option packetsize 1000
  131. option maxsize 800
  132. option avgrate 49
  133. option priority 10
  134.  
  135. # u/d sum_avgrate = 60/60
  136.  
  137. config class "Normal"
  138. option avgrate 1
  139. option packetsize 1500
  140. option packetdelay 100
  141. option priority 5
  142.  
  143. config class "Bulk"
  144. option avgrate 1
  145. option packetdelay 300
  146. option priority 1
  147.  
  148.  
  149. # [EOF]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement