Community discussions

MikroTik App
 
RodrigoEspe
just joined
Topic Author
Posts: 1
Joined: Thu Feb 22, 2018 3:46 pm

Get physical interface on a bridge

Thu Feb 22, 2018 4:04 pm

Hi,

I have a hotspot configured in a bridge, however I have to know in which physical interface the client is connected.
Among the variables that the hotspot provides, there is the attribute "$(interface-name)", but it always returns the name of the bridge.

The moments that I need this information are in the login and logout of the client, so script is a considerable option.

Looked like this, I was able to get the hostname of the client, intersecting with the DHCP-LEASE table information
: local hostname [ip dhcp-server lease get [find address = $ address] host-name];
Can I do something like get the interface name?

thanks
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: Get physical interface on a bridge

Thu Feb 22, 2018 4:30 pm

Remember that the Hotspot feature is a layer3 function - so it's going to see interfaces in terms of "IP interfaces" not "switchport" interfaces (to borrow a term from Cisco and others).

Scripting would need to use the bridge hosts table / switch hosts tables to find the exact physical interface. I'm definitely not a script guru so others would need to chime in with further suggestions, but in general, I can say that your script could capture the MAC address from the session and then cross-reference that with the layer2 forwarding tables I mentioned.

Who is online

Users browsing this forum: infabo, nichky and 61 guests