Advertisement
budiana

Mikrotik Load Balancing(ECMP Method) 2 WANs(Static IP)

Mar 8th, 2018
658
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.30 KB | None | 0 0
  1. Mikrotik Load Balancing(ECMP Method) 2 WANs(Static IP)
  2.  
  3. /ip address
  4. add address=192.168.168.1/24 interface=bridge-LAN network=192.168.168.0
  5. add address=103.28.0.254/30 interface=WAN2 network=103.28.0.252
  6. add address=103.28.2.254/30 interface=WAN1 network=103.28.2.252
  7.  
  8. /ip dns
  9. set  servers=8.8.8.8,8.8.4.4
  10.  
  11. /ip firewall nat
  12. add action=masquerade chain=srcnat out-interface=WAN1
  13. add action=masquerade chain=srcnat out-interface=WAN2
  14.  
  15. /ip route
  16. add check-gateway=ping distance=1 gateway=103.28.0.253,103.28.2.253
  17.  
  18.  
  19. /ip firewall nat
  20. add action=masquerade chain=srcnat out-interface=WAN1
  21. add action=masquerade chain=srcnat out-interface=WAN2
  22.  
  23. /ip firewall mangle
  24. add action=mark-connection chain=input in-interface=WAN1 new-connection-mark=\
  25.     WAN1_Conn passthrough=yes
  26. add action=mark-connection chain=input in-interface=WAN2 new-connection-mark=\
  27.     WAN2_Conn passthrough=yes
  28. add action=mark-routing chain=output connection-mark=WAN1_Conn \
  29.     new-routing-mark=WAN1_Conn passthrough=no
  30. add action=mark-routing chain=output connection-mark=WAN2_Conn \
  31.     new-routing-mark=WAN2_Conn passthrough=no
  32.  
  33. /ip route
  34. add distance=1 gateway=103.28.2.253 routing-mark=WAN1_Conn
  35. add distance=1 gateway=103.28.0.253 routing-mark=WAN2_Conn
  36. add check-gateway=ping distance=1 gateway=103.28.0.253,103.28.2.253
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement