rootplg3544

PCQ HOTSPOT

Jun 1st, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. /ip firewall mangle
  2. add chain=prerouting action=jump jump-target=hotspot comment="Hotspot Jump Mangle"
  3. add chain=postrouting action=jump jump-target=hotspot
  4.  
  5. add chain=prerouting action=mark-connection new-connection-mark=conn-up passthrough=yes dst-address=10.5.50.0/24 comment="Hotspot Connections"
  6. add chain=postrouting action=mark-connection new-connection-mark=conn-down passthrough=yes src-address=10.5.50.0/24
  7.  
  8. add chain=prerouting action=mark-packet new-packet-mark=packet-up passthrough=yes connection-mark=conn-up comment="Hotspot Packets"
  9. add chain=postrouting action=mark-packet new-packet-mark=packet-down passthrough=yes connection-mark=conn-down
  10.  
  11. add chain=prerouting action=mark-packet new-packet-mark=hotspot-up passthrough=no connection-mark=conn-up
  12. add chain=postrouting action=mark-packet new-packet-mark=hotspot-down passthrough=no connection-mark=conn-down
  13.  
  14. **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).
  15.  
  16. **Agar memudahkan pemisahan bandwidth tersebut kita akan menggunakan fasilitas layer-7-protocol dari mikrotik.
  17.  
  18. Code:
  19. /ip firewall layer7-protocol
  20. 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]).*\$"
  21. add name=Facebook regexp=^.+(fbcdn-video-a.akamaihd.net).*$
  22. add name=Youtube regexp="^.+(c.youtube.com|googlevideo.com|cdn.dailymotion.com|metacafe.com|mccont.com).*$"
  23.  
  24. **Setelah layer-7-protocol kita tambahkan, kita buat mangle nya.
  25.  
  26. Code:
  27. /ip firewall mangle
  28. add chain=hotspot action=mark-packet new-packet-mark=facebook passthrough=no protocol=tcp layer7-protocol=Facebook comment="Facebook"
  29. add chain=hotspot action=mark-packet new-packet-mark=youtube passthrough=no protocol=tcp layer7-protocol=Youtube comment="Youtube"
  30. add chain=hotspot action=mark-packet new-packet-mark=download passthrough=no protocol=tcp layer7-protocol=Download comment="Download"
  31.  
  32. /queue type
  33. 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
  34. 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
  35.  
  36. /queue tree
  37. 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
  38. 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
  39. 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
  40. 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
  41. 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
  42. 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
  43. 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