zionkv

microtik rules 2 voip

Aug 14th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 9.50 KB | None | 0 0
  1. #########################################
  2. #### VOIP                            ####
  3. #########################################
  4.  
  5. /ip firewall layer7-protocol
  6. add name=sip regexp=\
  7.     "^(invite|register|cancel) sip[\t-\r -~]*sip/[0-2]\\.[0-9]"
  8. add name=h323 regexp=\
  9.     "^\03..\?\08...\?.\?.\?.\?.\?.\?.\?.\?.\?.\?.\?.\?.\?.\?.\?\05"
  10. add name=skypeout regexp="^(\01.\?.\?.\?.\?.\?.\?.\?.\?\01|\02.\?.\?.\?.\?.\?.\
  11.    \?.\?.\?\02|\03.\?.\?.\?.\?.\?.\?.\?.\?\03|\04.\?.\?.\?.\?.\?.\?.\?.\?\04|\
  12.    \05.\?.\?.\?.\?.\?.\?.\?.\?\05|\06.\?.\?.\?.\?.\?.\?.\?.\?\06|\07.\?.\?.\?\
  13.    .\?.\?.\?.\?.\?\07|\08.\?.\?.\?.\?.\?.\?.\?.\?\08|\t.\?.\?.\?.\?.\?.\?.\?.\
  14.    \?\t|\
  15.    \n.\?.\?.\?.\?.\?.\?.\?.\?\
  16.    \n|\0B.\?.\?.\?.\?.\?.\?.\?.\?\0B|\0C.\?.\?.\?.\?.\?.\?.\?.\?\0C|\r.\?.\?.\
  17.    \?.\?.\?.\?.\?.\?\r|\0E.\?.\?.\?.\?.\?.\?.\?.\?\0E|\0F.\?.\?.\?.\?.\?.\?.\
  18.    \?.\?\0F|\10.\?.\?.\?.\?.\?.\?.\?.\?\10|\11.\?.\?.\?.\?.\?.\?.\?.\?\11|\12\
  19.    .\?.\?.\?.\?.\?.\?.\?.\?\12|\13.\?.\?.\?.\?.\?.\?.\?.\?\13|\14.\?.\?.\?.\?\
  20.    .\?.\?.\?.\?\14|\15.\?.\?.\?.\?.\?.\?.\?.\?\15|\16.\?.\?.\?.\?.\?.\?.\?.\?\
  21.    \16|\17.\?.\?.\?.\?.\?.\?.\?.\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?.\?\\}|~.\?.\?.\?.\?.\?.\?.\?.\?~|\7F.\?.\?.\?.\?.\?.\?.\?.\?\7F|\80.\?.\
  61.    \?.\?.\?.\?.\?.\?.\?\80|\81.\?.\?.\?.\?.\?.\?.\?.\?\81|\82.\?.\?.\?.\?.\?.\
  62.    \?.\?.\?\82|\83.\?.\?.\?.\?.\?.\?.\?.\?\83|\84.\?.\?.\?.\?.\?.\?.\?.\?\84|\
  63.    \85.\?.\?.\?.\?.\?.\?.\?.\?\85|\86.\?.\?.\?.\?.\?.\?.\?.\?\86|\87.\?.\?.\?\
  64.    .\?.\?.\?.\?.\?\87|\88.\?.\?.\?.\?.\?.\?.\?.\?\88|\89.\?.\?.\?.\?.\?.\?.\?\
  65.    .\?\89|\8A.\?.\?.\?.\?.\?.\?.\?.\?\8A|\8B.\?.\?.\?.\?.\?.\?.\?.\?\8B|\8C.\
  66.    \?.\?.\?.\?.\?.\?.\?.\?\8C|\8D.\?.\?.\?.\?.\?.\?.\?.\?\8D|\8E.\?.\?.\?.\?.\
  67.    \?.\?.\?.\?\8E|\8F.\?.\?.\?.\?.\?.\?.\?.\?\8F|\90.\?.\?.\?.\?.\?.\?.\?.\?\
  68.    \90|\91.\?.\?.\?.\?.\?.\?.\?.\?\91|\92.\?.\?.\?.\?.\?.\?.\?.\?\92|\93.\?.\
  69.    \?.\?.\?.\?.\?.\?.\?\93|\94.\?.\?.\?.\?.\?.\?.\?.\?\94|\95.\?.\?.\?.\?.\?.\
  70.    \?.\?.\?\95|\96.\?.\?.\?.\?.\?.\?.\?.\?\96|\97.\?.\?.\?.\?.\?.\?.\?.\?\97|\
  71.    \98.\?.\?.\?.\?.\?.\?.\?.\?\98|\99.\?.\?.\?.\?.\?.\?.\?.\?\99|\9A.\?.\?.\?\
  72.    .\?.\?.\?.\?.\?\9A|\9B.\?.\?.\?.\?.\?.\?.\?.\?\9B|\9C.\?.\?.\?.\?.\?.\?.\?\
  73.    .\?\9C|\9D.\?.\?.\?.\?.\?.\?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
  112.    .\?.\?.\?.\?.\?\F9|\FA.\?.\?.\?.\?.\?.\?.\?.\?\FA|\FB.\?.\?.\?.\?.\?.\?.\?\
  113.    .\?\FB|\FC.\?.\?.\?.\?.\?.\?.\?.\?\FC|\FD.\?.\?.\?.\?.\?.\?.\?.\?\FD|\FE.\
  114.    \?.\?.\?.\?.\?.\?.\?.\?\FE|\FF.\?.\?.\?.\?.\?.\?.\?.\?\FF)"
  115. add name=skypetoskype regexp="^..\02............."
  116. add name=teamspeak regexp="^\F4\BE\03.*teamspeak"
  117. add name=ventrilo regexp="^..\?v\\\$\CF"
  118. add name=stun regexp="^[\01\02]................\?\$"
  119.  
  120. /ip firewall mangle
  121. add action=set-priority chain=forward comment="Priority - 0 - VOIP - h323" layer7-protocol=h323 new-priority=7
  122. add action=set-priority chain=forward comment="Priority - 0 - VOIP - SIP" layer7-protocol=sip new-priority=7
  123. add action=set-priority chain=forward comment="Priority - 0 - VOIP - Skypeout" layer7-protocol=skypeout new-priority=7
  124. add action=set-priority chain=forward comment="Priority - 0 - VOIP - skypetoskype" layer7-protocol=skypetoskype new-priority=7
  125. add action=set-priority chain=forward comment="Priority - 0 - VOIP - STUN" layer7-protocol=stun new-priority=7
  126. add action=set-priority chain=forward comment="Priority - 0 - VOIP - Teamspeak" layer7-protocol=teamspeak new-priority=7
  127. add action=set-priority chain=forward comment="Priority - 0 - VOIP - Ventrilo" layer7-protocol=ventrilo new-priority=7
  128. /
Advertisement
Add Comment
Please, Sign In to add comment