i want to get an uplink interface based on ip address of default route on bridged mikrotik.
i have solved this by doing:
Code: Select all
:put [/interface bridge host get [find where mac-address=[/ip arp get [find where address=172.16.244.33] mac-address]] on-interface]
slower when more entries in bridge host table
Code: Select all
:put [:time [/interface bridge host get [find mac-address=[/ip arp get [find address=[/ip route get [find dst-address=0.0.0.0/0] gateway]] mac-address]] on-interface]]
00:01:27.052851
Code: Select all
interface bridge host print count-only
434
Code: Select all
system routerboard print
routerboard: yes
model: "433"
serial-number: "xxxxxxxxxxxx"
current-firmware: "2.26"
upgrade-firmware: "2.26"
do you have any better ideas ?