Advertisement
albspirit86

Limit Download Layer 7 Mikrotik

Jul 16th, 2014
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.52 KB | None | 0 0
  1. Limit Download Layer 7 Mikrotik
  2.  
  3. FOR LIMIT EXTENTION DOWNLOAD
  4.  
  5. FOR LAYER7
  6. ==========================================================
  7. /ip firewall layer7-protocol
  8. add name="YOUTUBE DOWNLOAD" regexp="http/(0\\.9|1\\.0|1\\.1)[\\x09-\\x0d ][1-5\
  9. ][0-9][0-9][\\x09-\\x0d -~]*(content-type: video)"
  10. add name=EXE regexp="\\.(exe)"
  11. add name=RAR regexp="\\.(rar)"
  12. add name=ZIP regexp="\\.(zip)"
  13. add name=7z regexp="\\.(7z)"
  14. add name=WMV regexp="\\.(wmv)"
  15. add name=MPG regexp="\\.(mpg)"
  16. add name=MPEG regexp="\\.(mpeg)"
  17. add name=AVI regexp="\\.(avi)"
  18. add name=FLV regexp="\\.(flv)"
  19. add name=WAV regexp="\\.(wav)"
  20. add name=MP3 regexp="\\.(mp3)"
  21. add name=MP4 regexp="\\.(mp4)"
  22. add name=ISO regexp="\\.(iso)"
  23. add name=3GP regexp="\\.(3gp)"
  24. add name=MOV regexp="\\.(mov)"
  25. add name=MKV regexp="\\.(mkv)"
  26. add name="YOUTUBE STREAMING" regexp=youtube
  27. add name=PORN regexp=porn
  28. add name=TUBE regexp=tube
  29. add name=VIDEO regexp=video
  30. add name=MOVIE regexp=movie
  31.  
  32. FOR MANGLE
  33. =================================================
  34. /ip firewall mangle
  35. add action=mark-connection chain=forward comment="LIMIT EXTENTION" disabled=\
  36. no layer7-protocol="YOUTUBE DOWNLOAD" new-connection-mark=\
  37. "YOUTUBE DOWNLOAD" passthrough=yes
  38. add action=mark-packet chain=forward connection-mark="YOUTUBE DOWNLOAD" \
  39. disabled=no new-packet-mark="YOUTUBE DOWNLOAD" \
  40. passthrough=no
  41. add action=mark-connection chain=forward disabled=no layer7-protocol=\
  42. "YOUTUBE STREAMING" new-connection-mark="YOUTUBE STREAMING" passthrough=\
  43. yes
  44. add action=mark-packet chain=forward connection-mark="YOUTUBE STREAMING" \
  45. disabled=no new-packet-mark="YOUTUBE STREAMING" \
  46. passthrough=no
  47. add action=mark-connection chain=forward disabled=no layer7-protocol=TUBE \
  48. new-connection-mark=PORN1 passthrough=yes
  49. add action=mark-packet chain=forward connection-mark=PORN1 disabled=no \
  50. new-packet-mark=PORN1 passthrough=no
  51. add action=mark-connection chain=forward disabled=no layer7-protocol=PORN \
  52. new-connection-mark=PORN2 passthrough=yes
  53. add action=mark-packet chain=forward connection-mark=PORN2 disabled=no \
  54. new-packet-mark=PORN2 passthrough=no
  55. add action=mark-connection chain=forward disabled=no layer7-protocol=VIDEO \
  56. new-connection-mark=PORN3 passthrough=yes
  57. add action=mark-packet chain=forward connection-mark=PORN3 disabled=no \
  58. new-packet-mark=PORN3 passthrough=no
  59. add action=mark-connection chain=forward disabled=no layer7-protocol=MOVIE \
  60. new-connection-mark=PORN4 passthrough=yes
  61. add action=mark-packet chain=forward connection-mark=PORN4 disabled=no \
  62. new-packet-mark=PORN4 passthrough=no
  63. add action=mark-connection chain=forward disabled=no layer7-protocol=MKV \
  64. new-connection-mark=MKV passthrough=yes
  65. add action=mark-packet chain=forward connection-mark=MKV disabled=no \
  66. new-packet-mark=MKV passthrough=no
  67. add action=mark-connection chain=forward disabled=no layer7-protocol=MP3 \
  68. new-connection-mark=MP3 passthrough=yes
  69. add action=mark-packet chain=forward connection-mark=MP3 disabled=no \
  70. new-packet-mark=MP3 passthrough=no
  71. add action=mark-connection chain=forward disabled=no layer7-protocol=MP4 \
  72. new-connection-mark=MP4 passthrough=yes
  73. add action=mark-packet chain=forward connection-mark=MP4 disabled=no \
  74. new-packet-mark=MP4 passthrough=no
  75. add action=mark-connection chain=forward disabled=no layer7-protocol=ZIP \
  76. new-connection-mark=ZIP passthrough=yes
  77. add action=mark-packet chain=forward connection-mark=ZIP disabled=no \
  78. new-packet-mark=ZIP passthrough=no
  79. add action=mark-connection chain=forward disabled=no layer7-protocol=EXE \
  80. new-connection-mark=EXE passthrough=yes
  81. add action=mark-packet chain=forward connection-mark=EXE disabled=no \
  82. new-packet-mark=EXE passthrough=no
  83. add action=mark-connection chain=forward disabled=no layer7-protocol=FLV \
  84. new-connection-mark=FLV passthrough=yes
  85. add action=mark-packet chain=forward connection-mark=FLV disabled=no \
  86. new-packet-mark=FLV passthrough=no
  87. add action=mark-connection chain=forward disabled=no layer7-protocol=ISO \
  88. new-connection-mark=ISO passthrough=yes
  89. add action=mark-packet chain=forward connection-mark=ISO disabled=no \
  90. new-packet-mark=ISO passthrough=no
  91. add action=mark-connection chain=forward disabled=no layer7-protocol=MOV \
  92. new-connection-mark=MOV passthrough=yes
  93. add action=mark-packet chain=forward connection-mark=MOV disabled=no \
  94. new-packet-mark=MOV passthrough=no
  95. add action=mark-connection chain=forward disabled=no layer7-protocol=MPEG \
  96. new-connection-mark=MPEG passthrough=yes
  97. add action=mark-packet chain=forward connection-mark=MPEG disabled=no \
  98. new-packet-mark=MPEG passthrough=no
  99. add action=mark-connection chain=forward disabled=no layer7-protocol=MPG \
  100. new-connection-mark=MPG passthrough=yes
  101. add action=mark-packet chain=forward connection-mark=MPG disabled=no \
  102. new-packet-mark=MPG passthrough=no
  103. add action=mark-connection chain=forward disabled=no layer7-protocol=WAV \
  104. new-connection-mark=WAV passthrough=yes
  105. add action=mark-packet chain=forward connection-mark=WAV disabled=no \
  106. new-packet-mark=WAV passthrough=no
  107. add action=mark-connection chain=forward disabled=no layer7-protocol=RAR \
  108. new-connection-mark=RAR passthrough=yes
  109. add action=mark-packet chain=forward connection-mark=RAR disabled=no \
  110. new-packet-mark=RAR passthrough=no
  111. add action=mark-connection chain=forward disabled=no layer7-protocol=WMV \
  112. new-connection-mark=WMV passthrough=yes
  113. add action=mark-packet chain=forward connection-mark=WMV disabled=no \
  114. new-packet-mark=WMV passthrough=no
  115. add action=mark-connection chain=forward disabled=no layer7-protocol=3GP \
  116. new-connection-mark=3GP passthrough=yes
  117. add action=mark-packet chain=forward connection-mark=3GP disabled=no \
  118. new-packet-mark=3GP passthrough=no
  119. add action=mark-connection chain=forward disabled=no layer7-protocol=7z \
  120. new-connection-mark=7z passthrough=yes
  121. add action=mark-packet chain=forward connection-mark=7z disabled=no \
  122. new-packet-mark=7z passthrough=no
  123.  
  124. FOR QUEUE TYPE
  125. ====================================================
  126. /queue type
  127. add kind=pcq name=DOWN pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=\
  128. 5s pcq-classifier=dst-address,dst-port pcq-dst-address-mask=32 \
  129. pcq-dst-address6-mask=128 pcq-limit=50 pcq-rate=0 pcq-src-address-mask=32 \
  130. pcq-src-address6-mask=128 pcq-total-limit=3000
  131.  
  132. FOR QUEUE TREE
  133. =====================================================
  134. /queue tree
  135. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  136. max-limit=2800k name="4.ALL DOWN" packet-mark="" parent=global-out \
  137. priority=3
  138.  
  139. /queue tree
  140. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  141. max-limit=1500k name="D.LIMIT EXTENTION" packet-mark="" parent=\
  142. "4.ALL DOWN" priority=4
  143.  
  144. /queue tree
  145. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  146. max-limit=0 name=YOUTUBE packet-mark="" parent="D.LIMIT EXTENTION" \
  147. priority=4
  148.  
  149. /queue tree
  150. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  151. max-limit=0 name=PORN packet-mark="" parent="D.LIMIT EXTENTION" priority=\
  152. 4
  153.  
  154. /queue tree
  155. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  156. max-limit=0 name="YOUTUBE STREAMING" packet-mark="YOUTUBE STREAMING" \
  157. parent=YOUTUBE priority=4 queue=DOWN
  158. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  159. max-limit=0 name=MKV packet-mark=MKV parent="D.LIMIT EXTENTION" priority=\
  160. 4 queue=DOWN
  161. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  162. max-limit=0 name=MP3 packet-mark=MP3 parent="D.LIMIT EXTENTION" priority=\
  163. 4 queue=DOWN
  164. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  165. max-limit=0 name=MP4 packet-mark=MP4 parent="D.LIMIT EXTENTION" priority=\
  166. 4 queue=DOWN
  167. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  168. max-limit=0 name=ZIP packet-mark=ZIP parent="D.LIMIT EXTENTION" priority=\
  169. 4 queue=DOWN
  170. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  171. max-limit=0 name=EXE packet-mark=EXE parent="D.LIMIT EXTENTION" priority=\
  172. 4 queue=DOWN
  173. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  174. max-limit=0 name=ISO packet-mark=ISO parent="D.LIMIT EXTENTION" priority=\
  175. 4 queue=DOWN
  176. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  177. max-limit=0 name=AVI packet-mark=AVI parent="D.LIMIT EXTENTION" priority=\
  178. 4 queue=DOWN
  179. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  180. max-limit=0 name=MOV packet-mark=MOV parent="D.LIMIT EXTENTION" priority=\
  181. 4 queue=DOWN
  182. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  183. max-limit=0 name=MPEG packet-mark=MPEG parent="D.LIMIT EXTENTION" \
  184. priority=4 queue=DOWN
  185. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  186. max-limit=0 name=MPG packet-mark=MPG parent="D.LIMIT EXTENTION" priority=\
  187. 4 queue=DOWN
  188. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  189. max-limit=0 name=RAR packet-mark=RAR parent="D.LIMIT EXTENTION" priority=\
  190. 4 queue=DOWN
  191. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  192. max-limit=0 name=WAV packet-mark=WAV parent="D.LIMIT EXTENTION" priority=\
  193. 4 queue=DOWN
  194. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  195. max-limit=0 name=WMV packet-mark=WMV parent="D.LIMIT EXTENTION" priority=\
  196. 4 queue=DOWN
  197. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  198. max-limit=0 name=3GP packet-mark=3GP parent="D.LIMIT EXTENTION" priority=\
  199. 4 queue=DOWN
  200. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  201. max-limit=0 name=7z packet-mark=7z parent="D.LIMIT EXTENTION" priority=4 \
  202. queue=DOWN
  203. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  204. max-limit=0 name="YOUTUBE DOWNLOAD" packet-mark="YOUTUBE DOWNLOAD" \
  205. parent=YOUTUBE priority=4 queue=DOWN
  206. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  207. max-limit=0 name=PORN1 packet-mark=PORN1 parent=PORN priority=4 queue=\
  208. DOWN
  209. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  210. max-limit=0 name=PORN2 packet-mark=PORN2 parent=PORN priority=4 queue=\
  211. DOWN
  212. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  213. max-limit=0 name=PORN3 packet-mark=PORN3 parent=PORN priority=4 queue=\
  214. DOWN
  215. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  216. max-limit=0 name=PORN4 packet-mark=PORN4 parent=PORN priority=4 queue=\
  217. DOWN
  218. add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \
  219. max-limit=0 name=FLV packet-mark=FLV parent="D.LIMIT EXTENTION" priority=\
  220. 4 queue=DOWN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement