Advertisement
hedjo1119

lb 2 isp

Jun 28th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.89 KB | None | 0 0
  1. #ip ISP1 = 192.168.0.1
  2. #ip ISP2 = 192.168.1.1
  3.  
  4. /ip firewall address-list
  5. add address=10.0.0.0/8 list=lokal
  6. add address=172.16.0.0/12 list=lokal
  7. add address=192.168.0.0/16 list=lokal
  8.  
  9. /ip firewall nat
  10. add action=masquerade chain=srcnat comment=masquerade out-interface=ISP1
  11. add action=masquerade chain=srcnat comment=masquerade out-interface=ISP2
  12.  
  13. /ip route
  14. add check-gateway=ping comment=default distance=1 gateway=192.168.0.1
  15. add check-gateway=ping comment=backup distance=2 gateway=192.168.1.1
  16. add check-gateway=ping comment=out-1 distance=1 gateway=192.168.0.1 routing-mark=out-1
  17. add check-gateway=ping comment=out-2 distance=1 gateway=192.168.1.1 routing-mark=out-2
  18. add check-gateway=ping comment=modem-1 distance=1 gateway=192.168.0.1 routing-mark=modem-1
  19. add check-gateway=ping comment=modem-1 distance=2 gateway=192.168.1.1 routing-mark=modem-1
  20. add check-gateway=ping comment=modem-2 distance=1 gateway=192.168.1.1 routing-mark=modem-2
  21. add check-gateway=ping comment=modem-2 distance=2 gateway=192.168.0.1 routing-mark=modem-2
  22.  
  23.  
  24. /ip firewall mangle
  25. add action=mark-connection chain=input comment=out-1 in-interface=ISP1 new-connection-mark=out-1 passthrough=yes
  26. add action=mark-connection chain=input comment=out-2 in-interface=ISP2 new-connection-mark=out-2 passthrough=yes
  27. add action=mark-routing chain=output comment=out-1 connection-mark=out-1 new-routing-mark=out-1 passthrough=no
  28. add action=mark-routing chain=output comment=out-2 connection-mark=out-2 new-routing-mark=out-2 passthrough=no
  29. add action=mark-routing chain=prerouting comment=modem-1 dst-address-list=!lokal dst-address-type=!local new-routing-mark=modem-1 passthrough=no per-connection-classifier=both-addresses-and-ports:2/0
  30. add action=mark-routing chain=prerouting comment=modem-2 dst-address-list=!lokal dst-address-type=!local new-routing-mark=modem-2 passthrough=no per-connection-classifier=both-addresses-and-ports:2/1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement