Advertisement
retnet

Loadbalance 2 ether

Nov 11th, 2023
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. /ip firewall address-list
  2. add address=0.0.0.0/8 list=ipLokal
  3. add address=10.0.0.0/8 list=ipLokal
  4. add address=127.0.0.0/8 list=ipLokal
  5. add address=169.254.0.0/16 list=ipLokal
  6. add address=172.16.0.0/12 list=ipLokal
  7. add address=192.168.0.0/16 list=ipLokal
  8.  
  9. /ip firewall nat
  10. add chain=srcnat out-interface="ether1" action=masquerade
  11. add chain=srcnat out-interface="ether2" action=masquerade
  12.  
  13. /ip route
  14. add check-gateway=ping distance=1 gateway=" 192.168.1.1" routing-mark="to-ether1"
  15. add check-gateway=ping distance=1 gateway="192.168.2.1" routing-mark="to-ether2"
  16. add check-gateway=ping distance=1 gateway="192.168.1.1"
  17. add check-gateway=ping distance=2 gateway="192.168.2.1"
  18.  
  19. /ip firewall mangle
  20. add action=mark-connection chain=input in-interface="ether1" new-connection-mark="con-ether1" passthrough=yes
  21. add action=mark-connection chain=input in-interface="ether2" new-connection-mark="con-ether2" passthrough=yes
  22.  
  23. add action=mark-routing chain=output connection-mark="con-ether1" new-routing-mark="to-ether1" passthrough=yes
  24. add action=mark-routing chain=output connection-mark="con-ether2" new-routing-mark="to-ether2" passthrough=yes
  25.  
  26. add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local new-connection-mark="con-ether1" passthrough=yes per-connection-classifier=both-addresses-and-ports:2/0 src-address-list=ipLokal
  27. add action=mark-connection chain=prerouting dst-address-list=!ipLokal dst-address-type=!local new-connection-mark="con-ether2" passthrough=yes per-connection-classifier=both-addresses-and-ports:2/1 src-address-list=ipLokal
  28.  
  29. add action=mark-routing chain=prerouting connection-mark="con-ether1" dst-address-list=!ipLokal new-routing-mark="to-ether1" passthrough=yes src-address-list=ipLokal
  30. add action=mark-routing chain=prerouting connection-mark="con-ether2" dst-address-list=!ipLokal new-routing-mark="to-ether2" passthrough=yes src-address-list=ipLokal
  31.  
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement