retnet

load balance pcc 300Mbps 50Mbps

Sep 19th, 2026
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 KB | None | 0 0
  1. /ip route
  2. add check-gateway=ping comment="GW_PCC_ETHER1" distance=1 gateway=1.1.1.1 routing-mark=to_ether1
  3. add check-gateway=ping comment="GW_PCC_ETHER2" distance=1 gateway=2.2.2.2 routing-mark=to_ether2
  4.  
  5. /ip dhcp-client
  6. add disabled=no interface=ether1 script=":if (\$bound = 1) do={ /ip route set [find comment=\"GW_PCC_ETHER1\"] gateway=\$\"gateway-address\"}"
  7. add disabled=no interface=ether2 script=":if (\$bound = 1) do={ /ip route set [find comment=\"GW_PCC_ETHER2\"] gateway=\$\"gateway-address\"}"
  8.  
  9. /ip firewall address-list
  10. add address=0.0.0.0/8 list=ipLokal
  11. add address=10.0.0.0/8 list=ipLokal
  12. add address=127.0.0.0/8 list=ipLokal
  13. add address=169.254.0.0/16 list=ipLokal
  14. add address=172.16.0.0/12 list=ipLokal
  15. add address=192.168.99.0/24 list=ipLokal
  16. add address=192.168.11.0/24 list=ipLokal
  17. add address=192.168.12.0/24 list=ipLokal
  18.  
  19. /ip firewall mangle
  20. # 1. OPTIMALISASI ICMP
  21. add action=change-dscp chain=postrouting comment="ICMP CHANGE DSCP" new-dscp=1 protocol=icmp passthrough=yes
  22. add action=mark-connection chain=postrouting dscp=1 new-connection-mark=ICMPKONEKSI passthrough=yes
  23. add action=mark-packet chain=postrouting connection-mark=ICMPKONEKSI new-packet-mark=ICMPPAKET passthrough=no
  24.  
  25. # 2. BYPASS TRAFIK LOKAL (Satu rule efisien menggunakan address-list)
  26. add action=accept chain=prerouting comment="Bypass Traffic Lokal" dst-address-list=ipLokal src-address-list=ipLokal
  27.  
  28. # 3. PCC MARK CONNECTION (6 Jalur ke Ether1, 1 Jalur ke Ether2)
  29. add action=mark-connection chain=prerouting comment="LB PCC 6:1 - ETHER1" dst-address-list=!ipLokal dst-address-type=!local \
  30. new-connection-mark=con-ether1 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/0 src-address-list=ipLokal
  31. add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local \
  32. new-connection-mark=con-ether1 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/1 src-address-list=ipLokal
  33. add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local \
  34. new-connection-mark=con-ether1 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/2 src-address-list=ipLokal
  35. add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local \
  36. new-connection-mark=con-ether1 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/3 src-address-list=ipLokal
  37. add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local \
  38. new-connection-mark=con-ether1 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/4 src-address-list=ipLokal
  39. add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local \
  40. new-connection-mark=con-ether1 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/5 src-address-list=ipLokal
  41.  
  42. add action=mark-connection chain=prerouting comment="LB PCC 6:1 - ETHER2" dst-address-list=!ipLokal dst-address-type=!local \
  43. new-connection-mark=con-ether2 passthrough=yes per-connection-classifier=both-addresses-and-ports:7/6 src-address-list=ipLokal
  44.  
  45. # 4. MARK ROUTING (passthrough=no untuk menghemat pemrosesan CPU)
  46. add action=mark-routing chain=prerouting connection-mark=con-ether1 dst-address-list=!ipLokal \
  47. new-routing-mark=to_ether1 passthrough=no src-address-list=ipLokal
  48. add action=mark-routing chain=prerouting connection-mark=con-ether2 dst-address-list=!ipLokal \
  49. new-routing-mark=to_ether2 passthrough=no src-address-list=ipLokal
  50.  
  51.  
  52. /ip firewall nat
  53. add action=masquerade chain=srcnat out-interface-list=WAN
  54.  
Tags: mikrotik
Advertisement
Add Comment
Please, Sign In to add comment