Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /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=10.5.50.0/24 comment="Hotspot Connections"
- add chain=postrouting action=mark-connection new-connection-mark=conn-down passthrough=yes src-address=10.5.50.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 Click here to enlarge).
- **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=^.+(fbcdn-video-a.akamaihd.net).*$
- add name=Youtube regexp="^.+(c.youtube.com|googlevideo.com|cdn.dailymotion.com|metacafe.com|mccont.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"
- /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
Add Comment
Please, Sign In to add comment