You are on page 1of 6

/ip firewall layer7-protocol

add name=P2P regexp="^(\\x13bittorrent protocol|azver\\x01\$|get /scrape\\\?in\


fo_hash=get /announce\\\?info_hash=|get /client/bitcomet/|GET /data\\\?fid\
=)|d1:ad2:id20:|\\x08'7P\\)[RP]"
add name=Speedtest regexp="^.+(speedtest).*\$"
add name=L7-Streaming/Video regexp=videoplayback|googlevideo|videofbcdn.net
add name=Facebook regexp="^.+(facebook.com).*\$"
add name=torrent-bittorrent regexp="^(\13bittorrent protocol|azver1\$|get /scr\
ape\\\\\?info_hash=)|d1:ad2:id20:|87P\\)[RP]"
add name=torrent-sites2 regexp="^.*(get|GET).+(torrent|thepiratebay|isohunt|en\
tertane|demonoid|btjunkie|mininova|flixflux|torrentz|vertor|h33t|btscene|b\
itunity|bittoxic|thunderbytes|entertane|zoozle|vcdq|bitnova|bitsoup|megano\
va|fulldls|btbot|flixflux|seedpeer|fenopy|gpirate|commonbits).*\$"
add name=download-large regexp="^.*get.+\\.(exe|rar|iso|zip|7zip|0[0-9][1-9]|f\
lv|mkv|avi|mp4|3gp|rmvb|mp3|img|dat|mov).*\$"
add name=download-docs regexp=\
"^.*get.+\\.(pdf|doc|docx|xlsx|xls|rtf|ppt|ppt).*\$"
add name=streaming-video2 regexp="^.*get.+\\.(c.youtube.com|cdn.dailymotion.co\
m|metacafe.com|mccont.com).*\$"
add name=streaming-video regexp=videoplayback|video
add name=streaming-playing regexp="dur="
add comment="block porn" name=Porn regexp="^.+(porn|xnxx|muyzorras|petardas|xh\
amster|tube8|cumlouder|bravoteens|redtube|playboyplus|babesofindia|firstan\
aldate|amateursraw|gfhardcore|).*\$"
add name=rt regexp="\\.(ppft)"
add name=download-ext regexp="^.*get.+\\.(gz|exe|rar|obb|apk|zip|7z|cab|asf|mo\
v|wmv|mpg|mpeg|img|pdf|doc|docx|xlsx|xls|rtf|ppt|pptx|mkv|avi|flv|wav|rm|m\
p3|mp4|ram|rmvb|dat|daa|iso|nrg|bin|vcd|mp2|3gp|mpe|qt|raw|wma|ogg|deb|tar\
|bzip|gzip|gzip2|0[0-9][0-9]).*\$"
add name=streaming-video3 regexp="^.+(c.youtube.com|googlevideo.com|cdn.dailym\
otion.com|metacafe.com|mccont.com|fbcdn-video-a.akamaihd.net|hvideo-xpa1).\
*\$"
add name=download-idm regexp="get /.*(user-agent: mozilla/4.0|range: bytes=)"
/ip firewall mangle
add action=mark-connection chain=prerouting comment="mobile legends" \
dst-port=\
7000,8913,10003,30000-30150,5001-5059,5101-5105,9001,5501-5559,5601-5651 \
new-connection-mark="mobile legends" passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting dst-port=\
7000,8913,10003,30000-30150,5001-5059,5101-5105,9001,5501-5559,5601-5651 \
new-connection-mark="mobile legends" passthrough=yes protocol=udp
add action=mark-packet chain=prerouting connection-mark="mobile legends" \
new-packet-mark=ml-pkt passthrough=no
add action=mark-connection chain=prerouting comment="cross fire" dst-port=\
16666,10008-10009,13006-13008 new-connection-mark="cross fire" \
passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting dst-port=12000-12080,13000-13080 \
new-connection-mark="cross fire" passthrough=yes protocol=udp
add action=mark-packet chain=prerouting connection-mark="cross fire" \
new-packet-mark=crossfire-pkt passthrough=no
add action=mark-connection chain=prerouting comment="rules of survival" \
dst-port=5501-5599,9080,24000-24050 new-connection-mark=ROS passthrough=\
yes protocol=udp
add action=mark-connection chain=prerouting dst-port=9000-9999 \
new-connection-mark=ROS passthrough=yes protocol=tcp
add action=mark-packet chain=prerouting connection-mark=ROS new-packet-mark=\
ros-pkt passthrough=no
add action=mark-connection chain=prerouting comment=dota2 dst-port=\
27015,27036,27037 new-connection-mark=dota2 passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting dst-port=\
4380,4379,3478,27000-28999,27001,27099 new-connection-mark=dota2 \
passthrough=yes protocol=udp
add action=mark-packet chain=prerouting connection-mark=dota2 \
new-packet-mark=dota2-pkt passthrough=no
add action=mark-connection chain=prerouting comment="league of legends " \
dst-port=2099,8088,8393-8400,5222-5227 new-connection-mark=LOL \
passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting dst-port=\
5000-5500,19900,1513,42354 new-connection-mark=LOL passthrough=yes \
protocol=udp
add action=mark-packet chain=prerouting connection-mark=LOL new-packet-mark=\
lol-pkt passthrough=no
add action=mark-connection chain=prerouting comment="call of duty" dst-port=\
3013,18082,65010,65050 new-connection-mark="call of duty" passthrough=yes \
protocol=tcp
add action=mark-connection chain=prerouting dst-port=7500-7650 \
new-connection-mark="call of duty" passthrough=yes protocol=udp
add action=mark-packet chain=prerouting connection-mark="call of duty" \
new-packet-mark=cod-pkt passthrough=no
add action=mark-connection chain=prerouting comment="pubg mobile" dst-port=\
10012,17500 new-connection-mark="pubg mobile" passthrough=yes protocol=\
tcp
add action=mark-connection chain=prerouting dst-port="10010,10013,10039,10096,\
10491,10612,11455,12235,13748,13894,13972,20000-20002" \
new-connection-mark="pubg mobile" passthrough=yes protocol=udp
add action=mark-packet chain=prerouting connection-mark="pubg mobile" \
new-packet-mark=pubg-pkt passthrough=no
add action=fasttrack-connection chain=prerouting comment=dns dst-port=53 \
protocol=udp
add action=mark-connection chain=prerouting comment=Facebook layer7-protocol=\
Facebook new-connection-mark=facebook-conn passthrough=yes
add action=mark-packet chain=prerouting connection-mark=facebook-conn \
new-packet-mark=facebook-pkt passthrough=no
add action=mark-connection chain=prerouting comment=youtube/streaming \
layer7-protocol=L7-Streaming/Video new-connection-mark=streaming \
passthrough=yes
add action=mark-connection chain=prerouting dst-port=443 new-connection-mark=\
streaming passthrough=yes protocol=udp
add action=mark-packet chain=prerouting connection-mark=streaming \
new-packet-mark=streaming-pkt passthrough=no
add action=mark-connection chain=prerouting comment=downloading \
layer7-protocol=download-large new-connection-mark=downloading \
passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting layer7-protocol=download-ext \
new-connection-mark=downloading passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting layer7-protocol=download-docs \
new-connection-mark=downloading passthrough=yes protocol=tcp
add action=mark-packet chain=prerouting connection-mark=downloading \
new-packet-mark=downloading-pkt passthrough=no
add action=mark-connection chain=prerouting comment=browsing dst-port=\
80,443,8080 new-connection-mark=browsing passthrough=yes protocol=tcp
add action=mark-connection chain=prerouting dst-port=80,8080 \
new-connection-mark=browsing passthrough=yes protocol=udp
add action=mark-packet chain=prerouting connection-mark=browsing \
new-packet-mark=browsing-pkt passthrough=no
add action=mark-connection chain=prerouting comment=torrent layer7-protocol=\
P2P new-connection-mark=torrent passthrough=yes
add action=mark-packet chain=prerouting connection-mark=torrent \
new-packet-mark=torrent-pkt passthrough=no
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1-ISP

You might also like