0% found this document useful (0 votes)
224 views3 pages

Ega Channel X Naufal Azkia Script

The document configures traffic shaping and prioritization on a MikroTik router. It defines protocols for speed tests, social media, and video streaming. It marks traffic for these protocols and prioritizes them. It also marks and rates limits regular traffic, gaming traffic, and heavy download/upload traffic. Finally it configures queue trees to apply the priorities and shaping to outgoing and incoming traffic.

Uploaded by

Moh Riski Dewata
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)
224 views3 pages

Ega Channel X Naufal Azkia Script

The document configures traffic shaping and prioritization on a MikroTik router. It defines protocols for speed tests, social media, and video streaming. It marks traffic for these protocols and prioritizes them. It also marks and rates limits regular traffic, gaming traffic, and heavy download/upload traffic. Finally it configures queue trees to apply the priorities and shaping to outgoing and incoming traffic.

Uploaded by

Moh Riski Dewata
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/ 3

/ip firewall layer7-protocol

add name=L7-SPEEDTEST regexp="^.+(speedtest).*\\\$"


add name=L7-SOSMED regexp="^.+(fbcdn.net|twimg.com|cdninstagram.com|tiktokcdn.com|
whatsapp.net|googleusercontent.com|telegram.org|line-scdn.net).*\$"
add name=L7-YOUTUBE regexp="r[0-9]+---[a-z]+-+[a-z0-9-]+\\.googlevideo\\.com"

/ip firewall mangle


add action=mark-connection chain=prerouting comment="ALL HTTP TRAFFIC" \
dst-address-list="!PORT RANDOM" new-connection-mark=HTTP-TRAFFIC \
passthrough=yes protocol=!icmp src-address-list="LOCAL"
add action=mark-packet chain=forward connection-mark=HTTP-TRAFFIC \
dst-address-list="LOCAL" in-interface=ether1 new-packet-mark=\
ALL-HTTP-TRAFFIC-DOWN passthrough=yes protocol=!icmp src-address-list=\
"!PORT RANDOM"
add action=mark-packet chain=forward connection-mark=HTTP-TRAFFIC \
dst-address-list="!PORT RANDOM" new-packet-mark=ALL-HTTP-TRAFFIC-UP \
out-interface=ether1 passthrough=yes protocol=!icmp src-address-list=\
LOCAL
add action=mark-connection chain=prerouting comment=ICMP new-connection-mark=\
ICMP passthrough=yes protocol=icmp
add action=mark-packet chain=forward connection-mark=ICMP in-interface=\
ether1 new-packet-mark=ICMP-DOWN passthrough=no
add action=mark-packet chain=forward connection-mark=ICMP new-packet-mark=\
ICMP-UP out-interface=ether1 passthrough=no
add action=add-dst-to-address-list address-list="PORT RANDOM" \
address-list-timeout=1m chain=prerouting comment="PORT RANDOM" \
dst-address-list="!PENGECUALIAN" dst-port=\
!21,22,23,81,88,5060,843,182,8777,1935,53,8000-8081,443,80 protocol=tcp \
src-address-list="LOCAL"
add action=add-dst-to-address-list address-list="PORT RANDOM" \
address-list-timeout=1m chain=prerouting dst-address-list=\
!PENGECUALIAN dst-port=\
!21,22,23,81,88,5060,843,182,8777,1935,53,8000-8081,443,80 protocol=udp \
src-address-list="LOCAL"
add action=mark-packet chain=forward dst-address-list="LOCAL" \
in-interface=ether1 new-packet-mark=PORT-RINGAN-DOWN passthrough=yes \
src-address-list="PORT RANDOM"
add action=mark-packet chain=forward dst-address-list="PORT RANDOM" \
new-packet-mark=PORT-RINGAN-UP out-interface=ether1 passthrough=yes \
src-address-list="LOCAL"
add action=add-dst-to-address-list address-list="PORT BERAT" \
address-list-timeout=59m chain=prerouting comment=\
"FORWARD PORT RANDOM -> PORT BERAT" connection-rate=1M-999M \
dst-address-list="PORT RANDOM" src-address-list="LOCAL"
add action=add-dst-to-address-list address-list="PORT BERAT" \
address-list-timeout=59m chain=prerouting connection-bytes=\
10000000-999000000 dst-address-list="PORT RANDOM" src-address-list=\
LOCAL
add action=mark-packet chain=forward dst-address-list="LOCAL" \
in-interface=ether1 new-packet-mark=PORT-BERAT-DOWN passthrough=no \
src-address-list="PORT BERAT"
add action=mark-packet chain=forward dst-address-list="PORT BERAT" \
new-packet-mark=PORT-BERAT-UP out-interface=ether1 passthrough=no \
src-address-list="LOCAL"
add action=mark-connection chain=prerouting comment=SPEEDTEST \
layer7-protocol=L7-SPEEDTEST new-connection-mark=LAYER7-SPEEDTEST \
passthrough=yes
add action=mark-packet chain=forward connection-mark=LAYER7-SPEEDTEST \
in-interface=ether1 new-packet-mark=SPEEDTEST-DOWN passthrough=no
add action=mark-packet chain=forward connection-mark=LAYER7-SPEEDTEST \
new-packet-mark=SPEEDTEST-UP out-interface=ether1 passthrough=no
add action=add-dst-to-address-list address-list="HTTP BERAT 1" \
address-list-timeout=25s chain=prerouting comment="HTTP BERAT 1" \
connection-bytes=5000000-999000000 connection-mark=HTTP-TRAFFIC \
connection-rate=512k-999M dst-address-list="!PORT RANDOM" \
layer7-protocol=!L7-SOSMED src-address-list="LOCAL"
add action=mark-packet chain=forward dst-address-list="LOCAL" \
in-interface=ether1 layer7-protocol=!L7-SOSMED new-packet-mark=\
HTTP-BERAT1-DOWN passthrough=yes src-address-list="HTTP BERAT 1"
add action=mark-packet chain=forward dst-address-list="HTTP BERAT 1" \
layer7-protocol=!L7-SOSMED new-packet-mark=HTTP-BERAT1-UP out-interface=\
ether1 passthrough=yes src-address-list="LOCAL"
add action=add-dst-to-address-list address-list="HTTP BERAT 2" \
address-list-timeout=25s chain=prerouting comment="HTTP BERAT 2" \
connection-bytes=5000000-999000000 connection-mark=HTTP-TRAFFIC \
connection-rate=512k-999M dst-address-list="!PORT RANDOM" \
layer7-protocol=!L7-YOUTUBE src-address-list="LOCAL"
add action=mark-packet chain=forward dst-address-list="LOCAL" \
in-interface=ether1 layer7-protocol=!L7-YOUTUBE new-packet-mark=\
HTTP-BERAT2-DOWN passthrough=yes src-address-list="HTTP BERAT 2"
add action=mark-packet chain=forward dst-address-list="HTTP BERAT 2" \
layer7-protocol=!L7-YOUTUBE new-packet-mark=HTTP-BERAT2-UP out-interface=\
ether1 passthrough=yes src-address-list="LOCAL"
add action=mark-packet chain=forward comment="LAYER 7 SOSMED" \
dst-address-list="LOCAL" in-interface=ether1 layer7-protocol=\
L7-SOSMED new-packet-mark=L7-SOSMED-DOWN passthrough=no
add action=mark-packet chain=forward layer7-protocol=L7-SOSMED \
new-packet-mark=L7-SOSMED-UP out-interface=ether1 passthrough=no \
src-address-list="LOCAL"
add action=mark-packet chain=forward comment="LAYER 7 YOUTUBE" \
dst-address-list="LOCAL" in-interface=ether1 layer7-protocol=\
L7-YOUTUBE new-packet-mark=L7-YOUTUBE-DOWN passthrough=no
add action=mark-packet chain=forward layer7-protocol=L7-YOUTUBE \
new-packet-mark=L7-YOUTUBE-UP out-interface=ether1 passthrough=no \
src-address-list="LOCAL"

/ip firewall address-list


add address=192.168.2.0/24 list=LOCAL

/ip firewall address-list


add address=192.168.1.0/24 list=PENGECUALIAN
add address=192.168.1.1 list=PENGECUALIAN
add address=192.168.2.0/24 list=PENGECUALIAN

/queue tree
add name="GLOBAL TRAFFIC" parent=global
add name="2. MARKED TRAFFIC" parent="GLOBAL TRAFFIC"
add name="1. NO MARK TRAFFIC" packet-mark=no-mark parent="GLOBAL TRAFFIC"
add name="- GLOBAL DOWNLOAD" parent="2. MARKED TRAFFIC" queue=\
pcq-download-default
add name="- GLOBAL UPLOAD" parent="2. MARKED TRAFFIC" queue=\
pcq-upload-default
add name="* icmp (download)" packet-mark=ICMP-DOWN parent="- GLOBAL DOWNLOAD" \
priority=2 queue=pcq-download-default
add name="* game / port ringan (download)" packet-mark=PORT-RINGAN-DOWN \
parent="- GLOBAL DOWNLOAD" priority=1 queue=pcq-download-default
add max-limit=5M name="* streaming & browsing (download)" parent=\
"- GLOBAL DOWNLOAD" priority=2 queue=pcq-download-default
add name="a. traffic berat download" packet-mark="ALL-HTTP-TRAFFIC-DOWN,PORT-B\
ERAT-DOWN,SPEEDTEST-DOWN,HTTP-BERAT1-DOWN,HTTP-BERAT2-DOWN" parent=\
"* streaming & browsing (download)" priority=2 queue=pcq-download-default
add name="* game / port ringan (upload)" packet-mark=PORT-RINGAN-UP parent=\
"- GLOBAL UPLOAD" priority=1 queue=pcq-upload-default
add name="* icmp (upload)" packet-mark=ICMP-UP parent="- GLOBAL UPLOAD" \
priority=2 queue=pcq-upload-default
add max-limit=1M name="* streaming & browsing (upload)" parent=\
"- GLOBAL UPLOAD" priority=2 queue=pcq-upload-default
add name="a. traffic berat upload" packet-mark="ALL-HTTP-TRAFFIC-UP,PORT-BERAT\
-UP,SPEEDTEST-UP,HTTP-BERAT1-UP,HTTP-BERAT2-UP" parent=\
"* streaming & browsing (upload)" priority=2 queue=pcq-upload-default
add max-limit=2M name="c. traffic sosmed download" packet-mark=L7-SOSMED-DOWN \
parent="* streaming & browsing (download)" priority=2 queue=\
pcq-download-default
add name="c. traffic sosmed upload" packet-mark=L7-SOSMED-UP parent=\
"* streaming & browsing (upload)" priority=2 queue=pcq-upload-default
add max-limit=3M name="b. traffic youtube download" packet-mark=\
L7-YOUTUBE-DOWN parent="* streaming & browsing (download)" priority=2 \
queue=pcq-download-default
add name="b. traffic youtube upload" packet-mark=L7-YOUTUBE-UP parent=\
"* streaming & browsing (upload)" priority=2 queue=pcq-upload-default

/queue simple
add name="GLOBAL TRAFFIC" packet-marks="ALL-HTTP-TRAFFIC-DOWN,ALL-HTTP-TRAFFIC\
-UP,PORT-BERAT-DOWN,PORT-BERAT-UP,SPEEDTEST-DOWN,SPEEDTEST-UP,L7-SOSMED-DO\
WN,L7-SOSMED-UP,L7-YOUTUBE-DOWN,L7-YOUTUBE-UP,HTTP-BERAT1-DOWN,HTTP-BERAT1\
-UP,HTTP-BERAT2-DOWN,HTTP-BERAT2-UP" priority=3/3 queue=default/default \
target="192.168.2.0/24,"

You might also like