MikroTik Dual WAN over 2 DHCP Internet Connections

Аватар автора
Технические хитрости
/interface ethernet set [ find default-name=ether1 ] name=ether1-WAN1 set [ find default-name=ether2 ] name=ether2-WAN2 set [ find default-name=ether4 ] name=ether4-LAN /ip pool add name=dhcp_pool0 ranges=10.10.10.2-10.10.10.254 /ip dhcp-server add address-pool=dhcp_pool0 disabled=no interface=ether4-LAN name=dhcp1 /ip address add address=10.10.10.1/24 interface=ether4-LAN network=10.10.10.0 /ip dhcp-client add add-default-route=no disabled=no interface=ether1-WAN1 script="{r n :local rmark "to_wan1"r n :local count [/ip route print count-only where comment="to_wan1"] r n :if ($bound=1) do={r n :if ($count = 0) do={r n /ip route add distance=1 gateway=$"gateway-address" check -gateway=ping routing-mark=to_wan1 comment="to_wan1"r n /ip route add distance=1 gateway=$"gateway-address" check -gateway=ping comment="to_wan1"r n } else={r n :if ($count = 1) do={r n :local test [/ip route find where comment="to_wan1"]r n :if ([/ip route get $test gateway] != $"gateway-addre ss") do={r n /ip route set $test gateway=$"gateway-address"r n }r n } else={r n :error "Multiple routes found"r n }r n }r n } else={r n /ip route remove [find comment="to_wan1"]r n }r n}" add add-default-route=no disabled=no...

0/0


0/0

0/0

0/0