Karena newbie liat di sini belum ada yg memaparkan tentang settingan queue tree di hotspot, newbie mau ikutan nyumbang settingan sederhana queue tree untuk hotspot yang dipakai di tempat publik alias free (contoh nya kafe, mall, dll). Mohon maaf kalo masih banyak kekurangannya
Anggap saja router mikrotik sudah terhubung ke internet dan sudah bisa sharing internet ke jaringan dibawah nya ya
Contoh:
ether1 = internet gateway (WAN)
ether2 = 192.168.10.1/24 (Hotspot) ==> dibuat dhcp
Kemudian setting hotspot (ga perlu dijelasin ya soalnya udah banyak tutorial nya kalo setting hotspot) . Setelah hotspot selesai disetting sekarang kita buat mangle untuk menangkap traffic hotspot nya.
Code:
/ip firewall mangle
add chain=prerouting action=jump jump-target=hotspot comment="Hotspot Jump Mangle"
add chain=postrouting action=jump jump-target=hotspot
add chain=prerouting action=mark-connection new-connection-mark=conn-up passthrough=yes dst-address=192.168.10.0/24 comment="Hotspot Connections"
add chain=postrouting action=mark-connection new-connection-mark=conn-down passthrough=yes src-address=192.168.10.0/24
add chain=prerouting action=mark-packet new-packet-mark=packet-up passthrough=yes connection-mark=conn-up comment="Hotspot Packets"
add chain=postrouting action=mark-packet new-packet-mark=packet-down passthrough=yes connection-mark=conn-down
add chain=prerouting action=mark-packet new-packet-mark=hotspot-up passthrough=no connection-mark=conn-up
add chain=postrouting action=mark-packet new-packet-mark=hotspot-down passthrough=no connection-mark=conn-down
Setelah mangle utama kita buat, sekarang kita akan menambahkan
lagi mangle untuk memisahkan jalur browsing, download, facebook dan
youtube (yg lain2 bisa ditambahkan sendiri ya
Agar memudahkan pemisahan bandwidth tersebut kita akan menggunakan fasilitas layer-7-protocol dari mikrotik.
Code:
/ip firewall layer7-protocol
add name=Download regexp="^.*(get|GET).+\\.(exe|rar|zip|7z|cab|asf|mov|wmv|mpg|mpeg|mkv|avi|flv|pdf|wav|rm|mp3|mp4|ram|rmvb|dat|daa|iso|nrg|bin|vcd|mp2|3gp|mpe|qt|raw|wma|ogg|doc|deb|tar|bzip|gzip|gzip2|0[0-1][0-1]).*\$"
add name=Facebook regexp="^.*get.+.facebook.com.*\$|^.*get.+.zynga.com.*\$|^.*get.+.fbcdn.net.*\$"
add name=Youtube regexp="^.*get.+.c.youtube.com.*\$"
Setelah layer-7-protocol kita tambahkan, kita buat mangle nya.Code:
/ip firewall mangle
add chain=hotspot action=mark-packet new-packet-mark=facebook passthrough=no protocol=tcp layer7-protocol=Facebook comment="Facebook"
add chain=hotspot action=mark-packet new-packet-mark=youtube passthrough=no protocol=tcp layer7-protocol=Youtube comment="Youtube"
add chain=hotspot action=mark-packet new-packet-mark=download passthrough=no protocol=tcp layer7-protocol=Download comment="Download"
Selesai pembuatan mangle sekarang kita ubah settingan hotspot user profile nya. Disini saya memakai contoh profile Hotspot.Untuk Incoming Packet Mark dan Outgoing Packet Mark jangan lupa kita isikan dengan marking hotspot yang sudah kita buat tadi. Incoming Packet Mark kita isikan dengan hotspot-up dan Outgoing Packet Mark kita isikan dengan hotspot-down.
Sekarang kita buat queue tree nya
Code:
/queue type
add name="pcq-down" kind=pcq pcq-rate=1M pcq-limit=50 pcq-classifier=dst-address pcq-total-limit=2000 pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-src-address-mask=32 pcq-dst-address-mask=32 pcq-src-address6-mask=64 pcq-dst-address6-mask=64
add name="pcq-up" kind=pcq pcq-rate=1M pcq-limit=50 pcq-classifier=src-address pcq-total-limit=2000 pcq-burst-rate=0 pcq-burst-threshold=0 pcq-burst-time=10s pcq-src-address-mask=32 pcq-dst-address-mask=32 pcq-src-address6-mask=64 pcq-dst-address6-mask=64
/queue tree
add name="Hotspot Down" parent=global-out packet-mark="" limit-at=0 priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Up" parent=global-in packet-mark="" limit-at=0 priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Browsing" parent="Hotspot Down" packet-mark=hotspot-down limit-at=256k queue=pcq-down priority=2 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Facebook" parent="Hotspot Down" packet-mark=facebook limit-at=256k queue=pcq-down priority=2 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Youtube" parent="Hotspot Down" packet-mark=youtube limit-at=128k queue=pcq-down priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Download" parent="Hotspot Down" packet-mark=download limit-at=128k queue=pcq-down priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
add name="Hotspot Upload" parent="Hotspot Up" packet-mark=hotspot-up limit-at=256k queue=pcq-up priority=8 max-limit=1M burst-limit=0 burst-threshold=0 burst-time=0s
Nanti setiap user hotspot yang login otomatis ip nya akan termangle secara otomatis ip address nya
No comments:
Post a Comment