Memisahkan Trafik Game Dan browsing di mikrotik

 Ada client setting mikrotik minta di pisahkan trafik antara game online dan browsing misal sosial media dll, ok langsung ke praktek, disini saya pake ip LAN 10.10.10.0/24, dan saya langsung ke tutorial dimana router sudah running config standar router, ga di jelasin dari awal ya.

1. Langkah pertama kita buat address list dulu dengan nama lokal

/ip firewall address-list

add address=10.10.10.0/24 list=LOKAL

2. Lalu kita tangkap list2 IP di menu ip firewall raw, berdasarkan port2 game dan conten2 sosmed scripts nya sebagai berikut /ip firewall raw

add action=add-dst-to-address-list address-list=IP-GAME address-list-timeout=\

    12h chain=prerouting comment=TCP-PUBG dst-address-list=!LOKAL dst-port=\

    7889,10012,17500,18081 protocol=tcp src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-GAME address-list-timeout=\

    12h chain=prerouting comment="TCP-MOBILE LEGEND" dst-address-list=!LOKAL \

    dst-port=5000-5508,5551-5558,5601-5608,5651-5658,30097-30147,9000-9010 \

    protocol=tcp src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-GAME address-list-timeout=\

    12h chain=prerouting comment="TCP-POINT BLANK" dst-address-list=!LOKAL \

    dst-port=39190-39200,49001-49190 protocol=tcp src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-GAME address-list-timeout=\

    12h chain=prerouting comment=TCP-GARENA dst-address-list=!LOKAL dst-port=\

    2080-2099 protocol=tcp src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-GAME address-list-timeout=\

    12h chain=prerouting comment="UDP-MOBILE LEGEND" dst-address-list=!LOKAL \

    dst-port=5000-5200,5500-5700,8001,30000-30300,9000-9010 protocol=udp \

    src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-GAME address-list-timeout=\

    12h chain=prerouting comment=TCP-FREEFIRE dst-address-list=!LOKAL \

    dst-port=7006,14000,20561,39698,39779,39003 protocol=tcp \

    src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-GAME address-list-timeout=\

    12h chain=prerouting comment=UDP-PUBG dst-address-list=!LOKAL dst-port=\

    8011,9030,10010-10650,11000-14000,17000,20000,20001,20002 protocol=udp \

    src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-GAME address-list-timeout=\

    12h chain=prerouting comment=UDP-FREEFIRE dst-address-list=!LOKAL \

    dst-port=7008,10000-10009,17000 protocol=udp src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-GAME address-list-timeout=\

    12h chain=prerouting comment=UDP-POINTBLANK dst-address-list=!LOKAL \

    dst-port=40000-40010 protocol=udp src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-GAME address-list-timeout=\

    12h chain=prerouting comment=UDP-GARENA dst-address-list=!LOKAL dst-port=\

    5100 protocol=udp src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-UMUM address-list-timeout=\

    3h chain=prerouting comment="IP UMUM (TCP)" dst-address-list=!LOKAL \

    dst-port=80,81,443,8000-8081,21,22,23,81,88,5050,843,182,53 protocol=tcp \

    src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-UMUM address-list-timeout=\

    3h chain=prerouting comment="IP UMUM (UDP)" dst-address-list=!LOKAL \

    dst-port=80,81,443,8000-8081,21,22,23,81,88,5050,843,182,53 protocol=udp \

    src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-YOUTUBE \

    address-list-timeout=30m chain=prerouting comment="IP YOUTUBE" content=\

    googlevideo.com dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=FACEBOOK content=\

    .facebook.com dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=FACEBOOK content=\

    .facebook.net dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=FACEBOOK content=\

    .fbcdn.net dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=INSTAGRAM content=\

    .cdninstagram.com dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=INSTAGRAM content=\

    scontent-sin6-2.cdninstagram.com dst-address-list=!LOKAL \

    src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=INSTAGRAM content=\

    .instagram.com dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=WHASTAPP content=\

    .whatsapp.net dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=WHASTAPP content=\

    .whatsapp.com dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=TELEGRAM content=\

    .telegram.org dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=TIKTOK content=\

    tiktokcdn.com dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=TIKTOK content=\

    tiktokv.com dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=TIKTOK content=\

    .amemv.com dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=TIKTOK content=\

    .musical.ly dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=TWITTER content=\

    .twitter.com dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=TWITTER content=\

    .twimg.com dst-address-list=!LOKAL src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=LIKEE dst-address-list=\

    !LOKAL dst-port=36955,845-872,1451-1471,2453-2471,8444-8471 protocol=tcp \

    src-address-list=LOKAL

add action=add-dst-to-address-list address-list=IP-SOSMED \

    address-list-timeout=5h chain=prerouting comment=LIKEE dst-address-list=\

    !LOKAL dst-port=36955 protocol=udp src-address-list=LOKAL


3. Lalu kita buat Mangle, untuk menandai paket2 dari masing2 


/ip firewall mangle

add action=mark-connection chain=prerouting comment="ICMP DNS" \

    dst-address-list=!LOKAL new-connection-mark=ICMP-DNS passthrough=yes \

    protocol=icmp src-address-list=LOKAL

add action=mark-connection chain=prerouting dst-address-list=!LOKAL dst-port=\

    53 new-connection-mark=ICMP-DNS passthrough=yes protocol=udp \

    src-address-list=LOKAL

add action=mark-packet chain=forward connection-mark=ICMP-DNS in-interface=\

    ether1 new-packet-mark=ICMP-DNS-DOWNLOAD passthrough=no

add action=mark-packet chain=forward connection-mark=ICMP-DNS \

    new-packet-mark=ICMP-DNS-Upload out-interface=ether1 passthrough=no

add action=mark-connection chain=postrouting comment="GAME ONLINE" \

    dst-address-list=IP-GAME new-connection-mark=GAME-ONLINE passthrough=yes \

    src-address-list=LOKAL

add action=mark-packet chain=forward connection-mark=GAME-ONLINE \

    in-interface=ether1 new-packet-mark=Game-Download passthrough=no

add action=mark-packet chain=forward connection-mark=GAME-ONLINE \

    new-packet-mark=GAME-UPLOAD out-interface=ether1 passthrough=no

add action=mark-connection chain=postrouting comment=\

    "ALIHKAN KONEKSI GAME KE UMUM" connection-rate=200k-100M \

    dst-address-list=IP-GAME new-connection-mark=Koneksi-Umum passthrough=yes \

    src-address-list=LOKAL

add action=mark-connection chain=postrouting comment="KONEKSI UMUM" \

    dst-address-list=IP-UMUM new-connection-mark=Koneksi-Umum passthrough=yes \

    src-address-list=LOKAL

add action=mark-packet chain=forward connection-mark=Koneksi-Umum \

    in-interface=ether1 new-packet-mark=UMUM-DOWNLOAD passthrough=no

add action=mark-packet chain=forward connection-mark=Koneksi-Umum \

    new-packet-mark=UMUM-UPLOAD out-interface=ether1 passthrough=no

add action=mark-connection chain=postrouting comment=YOUTUBE \

    dst-address-list=IP-YOUTUBE new-connection-mark=Koneksi-Youtube \

    passthrough=yes src-address-list=IP-YOUTUBE

add action=mark-packet chain=forward connection-mark=Koneksi-Youtube \

    in-interface=ether1 new-packet-mark=YOUTUBE-DOWNLOAD passthrough=no

add action=mark-packet chain=forward connection-mark=Koneksi-Youtube \

    new-packet-mark=YOUTUBE-UPLOAD out-interface=ether1 passthrough=no

add action=mark-connection chain=postrouting comment=SOSMED dst-address-list=\

    IP-SOSMED new-connection-mark=Koneksi-Sosmed passthrough=yes \

    src-address-list=LOKAL

add action=mark-packet chain=forward connection-mark=Koneksi-Sosmed \

    in-interface=ether1 new-packet-mark=SOSMED-DOWNLOAD passthrough=no

add action=mark-packet chain=forward connection-mark=Koneksi-Sosmed \

    new-packet-mark=SOSMED-UPLOAD out-interface=ether1 passthrough=no

/ip firewall nat

add action=passthrough chain=unused-hs-chain comment=\

    "place hotspot rules here" disabled=yes

add action=masquerade chain=srcnat comment="NAT TO INET"

add action=masquerade chain=srcnat comment="masquerade hotspot network" \

    src-address=10.10.10.0/24


4. Membuat Queue Tree 

/queue tree

add name=GLOBAL_ALL parent=global queue=default

add max-limit=100M name="TOTAL DOWNLOAD" parent=GLOBAL_ALL queue=\

    pcq-download-default

add max-limit=30M name="TOTAL UPLOAD" parent=GLOBAL_ALL queue=\

    pcq-upload-default

add name="1.GAME DOWNLOAD" packet-mark=Game-Download parent="TOTAL DOWNLOAD" \

    priority=1 queue=pcq-download-default

add name="1. GAME UPLOAD" packet-mark=Game-Download parent="TOTAL UPLOAD" \

    priority=1 queue=pcq-upload-default

add name="2. ICMP-DNS-DOWNLOAD" packet-mark=ICMP-DNS-DOWNLOAD parent=\

    "TOTAL DOWNLOAD" queue=pcq-download-default

add name="2. ICMP-DNS-UPLOAD" packet-mark=ICMP-DNS-Upload parent=\

    "TOTAL UPLOAD" queue=pcq-upload-default

add max-limit=45M name=3.ALL-TRAFIK-DOWNLOAD parent="TOTAL DOWNLOAD" queue=\

    pcq-download-default

add max-limit=20M name=3.ALL-TRAFIK-UPLOAD parent="TOTAL UPLOAD" queue=\

    pcq-upload-default

add name=1.UMUM-DOWNLOAD packet-mark=UMUM-DOWNLOAD parent=\

    3.ALL-TRAFIK-DOWNLOAD queue=pcq-download-default

add name="1. UMUM UPLOAD" packet-mark=UMUM-UPLOAD parent=3.ALL-TRAFIK-UPLOAD \

    queue=pcq-upload-default

add name="2.Youtube Download" parent=3.ALL-TRAFIK-DOWNLOAD priority=3 queue=\

    pcq-download-default

add name=Youtube-Upload packet-mark=YOUTUBE-UPLOAD parent=3.ALL-TRAFIK-UPLOAD \

    priority=3 queue=pcq-upload-default

add name="3. Sosmed" packet-mark=SOSMED-DOWNLOAD parent=3.ALL-TRAFIK-DOWNLOAD \

    priority=5

add name="3. SOSMED UPLOAD" packet-mark=SOSMED-UPLOAD parent=\

    3.ALL-TRAFIK-UPLOAD priority=5 queue=pcq-upload-default


5. Membuat Simple Queue 

/queue simple

add max-limit=100M/100M name="TOTAL BANDWIDTH" queue=default/default target=\

    10.10.10.0/24

add name=1.GAME-ONLINE packet-marks=GAME-UPLOAD,Game-Download parent=\

    "TOTAL BANDWIDTH" priority=1/1 queue=\

    pcq-upload-default/pcq-download-default target=10.10.10.0/24

add max-limit=50M/50M name="3.ALL-TRAFIK CLIENT" packet-marks="UMUM-UPLOAD,UMU\

    M-DOWNLOAD,YOUTUBE-UPLOAD,YOUTUBE-DOWNLOAD,SOSMED-UPLOAD,SOSMED-DOWNLOAD" \

    parent="TOTAL BANDWIDTH" queue=default/default target=10.10.10.0/24

add name=2.ICMP-DNS packet-marks=ICMP-DNS-Upload,ICMP-DNS-DOWNLOAD parent=\

    "TOTAL BANDWIDTH" queue=pcq-upload-default/pcq-download-default target=\

    10.10.10.0/24

add max-limit=50M/100M name=HOTSPOT_PARENT parent="3.ALL-TRAFIK CLIENT" \

    queue=default/default target=10.10.10.0/24

add max-limit=512k/1M name=ILHAM parent=HOTSPOT_PARENT target=10.10.10.219/32



Tidak ada komentar: