Code: Select all
# name of interface that should be monitored
# (edit to match your interface name)
:set mInterface2 ether2 ;
:set mInterface3 ether3 ;
:set mInterface4 ether4 ;
# routing mark name used for default route that should be updated
# (edit to match your routing mark name)
:set mRoutingMark SUBNET-LAN ;
/ip address ;
:set mGateway2 [/ip dhcp-client get [/ip dhcp-client find interface=$mInterface2] gateway]
:log info $mGateway2
:set mGateway3 [/ip dhcp-client get [/ip dhcp-client find interface=$mInterface3] gateway]
:log info $mGateway3
:set mGateway4 [/ip dhcp-client get [/ip dhcp-client find interface=$mInterface4] gateway]
:log info $mGateway4
/ip route add dst-address=0.0.0.0/0 gateway=$mGateway2,$mGateway3,$mGateway4, routing-mark=$mRoutingMark;
Code: Select all
/ip route add dst-address=0.0.0.0/0 gateway=$mGateway2 routing-mark=$mRoutingMark;