0% found this document useful (0 votes)
13K views2 pages

1

This document configures traffic shaping and packet marking on a MikroTik router. It defines firewall rules to mark traffic for downloading, browsing, gaming, video streaming, and P2P/torrents. It then creates priority queues for each traffic type and assigns them to nodes in the queue tree for downstream and upstream traffic.

Uploaded by

Marya Novelo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13K views2 pages

1

This document configures traffic shaping and packet marking on a MikroTik router. It defines firewall rules to mark traffic for downloading, browsing, gaming, video streaming, and P2P/torrents. It then creates priority queues for each traffic type and assigns them to nodes in the queue tree for downstream and upstream traffic.

Uploaded by

Marya Novelo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

/ip firewall mangle

add action=mark-connection chain=prerouting disabled=no in-interface=ether1 new-


connection-mark=all-inconn passthrough=yes comment="CONNECTION-IN"
add action=mark-packet chain=prerouting connection-mark=all-inconn disabled=no new-
packet-mark=all-inpkt passthrough=yes comment="UPLOAD"
add action=mark-connection chain=forward disabled=no out-interface=wlan1 new-
connection-mark=all-outconn passthrough=yes comment="CONNECTION-OUT"
add action=mark-packet chain=forward connection-mark=all-outconn disabled=no new-
packet-mark=all-outpkt passthrough=yes comment="DOWNLOAD"

/ip firewall layer7-protocol
add comment="download" name=high regexp="^.*get.+\\.(exe|rar|iso|zip|7zip|0[0-9][1-
9]|flv|mkv|avi|mp4|3gp|rmvb|mp3|img|dat|mov).*\$"
add comment="download" name=document regexp="^.*get.+\\.(pdf|doc|docx|xlsx|xls|rtf|
ppt|ppt).*\$"
add comment="video" name=youtube regexp="^.*get.+\\.(c.youtube.com|
cdn.dailymotion.com|metacafe.com|mccont.com).*\$"
add comment="video" name=streaming regexp="videoplayback|video"

/ip firewall mangle
add action=mark-packet chain=forward layer7-protocol=high new-packet-mark=dpkt
packet-mark=all-outpkt passthrough=no comment="CLIENT DOWNLOAD"
add action=mark-packet chain=forward layer7-protocol=document new-packet-mark=dpkt
packet-mark=all-outpkt passthrough=no comment=""

/ip firewall mangle
add action=mark-packet chain=forward layer7-protocol=youtube new-packet-mark=spkt
packet-mark=all-outpkt passthrough=no comment="CLIENT VIDEO"
add action=mark-packet chain=forward layer7-protocol=streaming new-packet-mark=spkt
packet-mark=all-outpkt passthrough=no comment=""

/ip firewall mangle
add action=mark-packet chain=forward packet-mark=all-outpkt new-packet-mark=gpkt
passthrough=yes protocol=tcp dst-port=5340-5352,6000-6152,10001-10011,14009-
14030,18901-18909 comment="CLIENT ONLINE GAMES"
add action=mark-packet chain=forward packet-mark=all-outpkt new-packet-mark=gpkt
passthrough=yes protocol=tcp dst-
port=39190,27780,29000,22100,10009,4300,15001,15002,7341,7451
add action=mark-packet chain=forward packet-mark=all-outpkt new-packet-mark=gpkt
passthrough=yes protocol=tcp dst-port=40000,9300,9400,9700,7342,8005-
8010,37466,36567,8822
add action=mark-packet chain=forward packet-mark=all-outpkt new-packet-mark=gpkt
passthrough=yes protocol=tcp dst-port=47611,16666,20000,5105,29000,18901-18909,9015
add action=mark-packet chain=forward packet-mark=all-outpkt new-packet-mark=gpkt
passthrough=yes protocol=udp dst-port=27005,27015
add action=mark-packet chain=forward packet-mark=all-outpkt new-packet-mark=gpkt
passthrough=yes protocol=udp dst-port=27005-27020,13055,7800-7900,12060-12070
add action=mark-packet chain=forward packet-mark=all-outpkt new-packet-mark=gpkt
passthrough=yes protocol=udp dst-port=8005-8010,9068,1293,1479,9401,9600,30000
add action=mark-packet chain=forward packet-mark=all-outpkt new-packet-mark=gpkt
passthrough=yes protocol=udp dst-port=14009-14030,42051-42052,40000-40050,13000-
13080

/ip firewall mangle
add action=mark-packet chain=forward connection-bytes=0-1000000 src-port=80,443
passthrough=no new-packet-mark=bpkt packet-mark=all-outpkt protocol=tcp
comment="CLIENT BROWSING"

/ip firewall layer7-protocol
add comment="BIT TORENT" name=bittorrent regexp="^(\13bittorrent protocol|azver1\$|
get /scrape\\\\?info_hash=)|d1:ad2:id20:|8�7P\\)[RP]"
add comment="TORRENT WEBSITES" name=torrentsites regexp="^.*(get|GET).+(torrent|
thepiratebay|isohunt|entertane|demonoid|btjunkie|mininova|flixflux|torrentz|vertor|
h33t|btscene|bitunity|bittoxic|thunderbytes|entertane|zoozle|vcdq|bitnova|bitsoup|
meganova|fulldls|btbot|flixflux|seedpeer|fenopy|gpirate|commonbits).*\$"

/ip firewall mangle
add action=mark-packet chain=forward layer7-protocol=bittorrent new-packet-
mark=tpkt packet-mark=all-outpkt passthrough=no comment="BILLING BIT TORRENT"
add action=mark-packet chain=forward layer7-protocol=torrentsites new-packet-
mark=tpkt packet-mark=all-outpkt passthrough=no comment="BILLING TORRENT WEBSITES"
add action=mark-packet chain=forward p2p=all-p2p new-packet-mark=tpkt packet-
mark=all-outpkt passthrough=no comment="BILLING ALLP2P"
add action=mark-packet chain=forward dst-port=58561,58045,14948,58008,58816,59097
new-packet-mark=tpkt packet-mark=all-outpkt passthrough=no protocol=tcp
comment="BILLING TORRENT PORT"

/queue type
add name=pcq_downstream kind=pcq pcq-rate=256k pcq-classifier=dst-address
add name=pcq_upstream kind=pcq pcq-rate=512k pcq-classifier=src-address
add name=pcq_game kind=pcq pcq-rate=256k pcq-classifier=dst-address
add name=pcq_browsing kind=pcq pcq-rate=256k pcq-classifier=dst-address
add name=pcq_download kind=pcq pcq-rate=256k pcq-classifier=dst-address
add name=pcq_undefined kind=pcq pcq-rate=180k pcq-classifier=dst-address
add name=pcq_extensions kind=pcq pcq-rate=180k pcq-classifier=dst-address
add name=pcq_video kind=pcq pcq-rate=200k pcq-classifier=dst-address
add name=pcq_p2ptorrent kind=pcq pcq-rate=150k pcq-classifier=dst-address

/queue tree
add name=a.Upstream parent=global-in queue=pcq_downstream packet-mark=all-inpkt
priority=8 max-limit=2M
add name=b.Downstream parent=global-out queue=pcq_upstream packet-mark=all-outpkt
priority=8 max-limit=2M
add name=1.Games parent=b.Downstream queue=pcq_game packet-mark=gpkt priority=1
limit-at=125k max-limit=512k
add name=2.Browsing parent=b.Downstream queue=pcq_browsing packet-mark=bpkt
priority=2 limit-at=125k max-limit=512k
add name=3.Download parent=b.Downstream queue=pcq_download packet-mark=all-outpkt
priority=3 limit-at=125k max-limit=512k
add name=3.1.Undefined parent=3.Download queue=pcq_undefined packet-mark=all-outpkt
priority=4 limit-at=75k max-limit=320k
add name=3.2.Extensions parent=3.Download queue=pcq_extensions packet-mark=dpkt
priority=5 limit-at=75k max-limit=320k
add name=3.3.Video parent=3.Download queue=pcq_video packet-mark=spkt priority=6
limit-at=75k max-limit=320k
add name=3.4.P2P&Torrent parent=3.Download queue=pcq_p2ptorrent packet-mark=tpkt
priority=7 limit-at=75k max-limit=320k

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy