Advertisement
retnet

loadbalance 3 wan in one ether

Mar 4th, 2023 (edited)
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. ## PCC - 3 wan in one ether with same network gateway on hub switch
  2. /ip firewall nat
  3. add chain=srcnat out-interface="ether1" action=masquerade
  4.  
  5. /ip firewall address-list
  6. add address=192.168.0.0/16 list=ipLokal
  7. add address=172.16.0.0/12 list=ipLokal
  8. add address=10.0.0.0/8 list=ipLokal
  9.  
  10. /ip route
  11. add check-gateway=ping distance=1 gateway="192.168.99.171" routing-mark="to_wan1"
  12. add check-gateway=ping distance=1 gateway="192.168.99.33" routing-mark="to_wan2"
  13. add check-gateway=ping distance=1 gateway="192.168.99.11" routing-mark="to_wan3"
  14. add check-gateway=ping distance=1 gateway="192.168.99.171"
  15. add check-gateway=ping distance=1 gateway="192.168.99.33"
  16. add check-gateway=ping distance=1 gateway="192.168.99.11"
  17.  
  18. /ip firewall mangle
  19. add action=mark-connection chain=input in-interface="ether1" new-connection-mark="cm_wan1" passthrough=yes comment="3_ISP"
  20. add action=mark-connection chain=input in-interface="ether1" new-connection-mark="cm_wan2" passthrough=yes
  21. add action=mark-connection chain=input in-interface="ether1" new-connection-mark="cm_wan3" passthrough=yes
  22. add action=mark-routing chain=output connection-mark="cm_wan1" new-routing-mark="to_wan1" passthrough=yes
  23. add action=mark-routing chain=output connection-mark="cm_wan2" new-routing-mark="to_wan2" passthrough=yes
  24. add action=mark-routing chain=output connection-mark="cm_wan3" new-routing-mark="to_wan3" passthrough=yes
  25.  
  26. add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local new-connection-mark="cm_wan1" passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 src-address-list=ipLokal
  27. add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local new-connection-mark="cm_wan2" passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1 src-address-list=ipLokal
  28. add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local new-connection-mark="cm_wan3" passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2 src-address-list=ipLokal
  29.  
  30. add action=mark-routing chain=prerouting connection-mark="cm_wan1" dst-address-list=!ipLokal new-routing-mark="to_wan1" passthrough=yes src-address-list=ipLokal
  31. add action=mark-routing chain=prerouting connection-mark="cm_wan2" dst-address-list=!ipLokal new-routing-mark="to_wan2" passthrough=yes src-address-list=ipLokal
  32. add action=mark-routing chain=prerouting connection-mark="cm_wan3" dst-address-list=!ipLokal new-routing-mark="to_wan3" passthrough=yes src-address-list=ipLokal
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement