Hey all,
Trying to list the MAC addresses in bridge filters but not having any luck. Here is what I have:
:foreach i in=[/interface bridge filter] do={
:local localmac [/interface bridge filter get $i src-mac-address]
:log warning “Found ths MAC Address in $localmac”
}
Any help would be appreciated, please.
With thanks
Jotne
September 14, 2019, 7:13am
2
Depending on your device switch implementation, you may not see mac address this way.
Do you get any output from this?
/interface bridge filter print
I guess no.
Try this instead:
/ip arp print
You will not see what mac address its connected to what port, it port is part of a bridge. You will then see mac connected to the bridge instead.
:foreach i in=[/ip arp find] do={
:local localmac [/ip arp get $i mac-address]
:log warning "Found ths MAC Address in $localmac"
}
Thanks for the response, your script lists Mac from the ARP list, what I’m looking to do is to list the MAC from the bridge filter list…
Thanks anyway
Jotne
September 14, 2019, 8:44am
4
Then try this:
{
/interface bridge host
:foreach i in=[find] do={
:local localmac [get $i mac-address]
:put "Found ths MAC Address in $localmac"
}
}
To see all information
/interface bridge host print
Thank you for your help,
Got it in the end
/interface bridge filter
:foreach i in=[find] do={
:local localmac [get $i src-mac-address]
:log warning “Found ths MAC Address in $localmac In the Filter List”
}