Community discussions

 
LogicalNZ
newbie
Topic Author
Posts: 37
Joined: Sat Oct 19, 2013 6:35 am

Script to List MAC addresses in Bridge Filters

Sat Sep 14, 2019 7:39 am

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
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 1290
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at gmail.com

Re: Script to List MAC addresses in Bridge Filters

Sat Sep 14, 2019 10:13 am

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"
}
 
How to use Splunk to monitor your MikroTik Router

MikroTik->Splunk
 
 
LogicalNZ
newbie
Topic Author
Posts: 37
Joined: Sat Oct 19, 2013 6:35 am

Re: Script to List MAC addresses in Bridge Filters

Sat Sep 14, 2019 10:29 am

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 :)
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 1290
Joined: Sat Dec 24, 2016 11:17 am
Location: jo.overland at gmail.com

Re: Script to List MAC addresses in Bridge Filters

Sat Sep 14, 2019 11:44 am

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
 
How to use Splunk to monitor your MikroTik Router

MikroTik->Splunk
 
 
LogicalNZ
newbie
Topic Author
Posts: 37
Joined: Sat Oct 19, 2013 6:35 am

Re: Script to List MAC addresses in Bridge Filters

Mon Sep 16, 2019 3:28 am

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"
}

Who is online

Users browsing this forum: No registered users and 5 guests