Hi there,
I’m trying to determine which mac-addresses are available on which interface of the mesh using the mesh’s FDB.
A print returns the info that I need, but any attempt to extract the information through a script fails. I suspect that it happens because no unique counters are assigned when you run print.
[admin@rb] /interface mesh fdb> print
Flags: A - active, R - root
MESH TYPE MAC-ADDRESS ON-INTERFACE LIFETIME AGE
A MeshN… local 6C:3B:6B:22:02:F8 15m29s
A MeshN… direct 74:DA:38:A5:EE:31 wlan1 15m29s
A MeshN… local FE:02:84:35:2F:8D 15s
A MeshN… outsider FE:7A:FC:85:EB:F1 TunnelTo192.1… 0s 15m40s
A MeshN… local FE:91:A6:FD:F3:A5 16m2s
A MeshN… outsider FE:CF:98:D4:A4:C7 TunnelTo192.1… 0s 16m
A MeshN… outsider FE:E4:8F:9D:37:91 TunnelTo192.1… 0s 15m40s
A MeshN… outsider FE:F2:42:A2:31:5A TunnelTo192.1… 0s 15m57s
A MeshN… outsider FE:F5:68:E3:3B:47 TunnelTo192.1… 0s 15m57s
Normally such a print command would assign “0” to the first line “1” to the next line etc. This allows you to then run “:local temp [get 0 mac-address]” as an example. But in FDB specifically this does not work.
:foreach i in [/interface mesh fdb find] do={
:local theMAC [/interface mesh fdb get $i mac-address]
:local theType [/interface mesh fdb get $i type]
:local theAge [/interface mesh fdb get $i age]
:log info “$i $theMAC $theType $theAge”
}
This code just prints the value of $i, but nothing else.