Closed Ragsboss closed 6 years ago
@Ragsboss Can you please explain how you get your second output:
root@leaf-1:mgmt-vrf:/var/log/aos# brctl showmacs bridge port name mac addr vlan is local? ageing timer swp3 2c:60:0c:7a:6b:7f 0 yes 0.00 swp3 52:54:00:86:95:15 12 no 158.05
Or was the output something you crafted as an example of what you want?
We don't own the source code for brctl so we can't actually change it's behavior. I'll get back to you on whether there is a way to translate port# to interface-name and maybe you can write a script to do something like that.
Thanks, Garrick
That output was from a cumulus box having comparable configuration...
Sent from my iPhone Email maybe terse
On Apr 18, 2018, at 1:37 PM, Garrick He notifications@github.com<mailto:notifications@github.com> wrote:
@Ragsbosshttps://github.com/Ragsboss Can you please explain how you get your second output:
root@leaf-1:mgmt-vrf:/var/log/aos# brctl showmacs bridge port name mac addr vlan is local? ageing timer swp3 2c:60:0c:7a:6b:7f 0 yes 0.00 swp3 52:54:00:86:95:15 12 no 158.05
Or was the output something you crafted as an example of what you want?
We don't own the source code for brctl so we can't actually change it's behavior. I'll get back to you on whether there is a way to translate port# to interface-name and maybe you can write a script to do something like that.
Thanks, Garrick
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/open-switch/opx-nas-interface/issues/30#issuecomment-382521111, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADsM8P9r6ezIpT6ntWV69Vd3mtGNbMJXks5tp6PzgaJpZM4TSeiH.
@Ragsboss , You can write a script that can translate the port# into the interface-name by having your script look inside this directory:
/sys/class/net/
inside that directory you will find a directory call 'brif' and in there will be a list of directories with memberport names. For example I have a bridge called 'br1':
root@OPX:/sys/class/net/br1/brif# ls
e101-031-0 e101-032-0 e101-033-0 e101-034-0
each of those directory has a port# information:
root@OPX:/sys/class/net/br1/brif# cat e101-031-0/port_no
0x1
You can implement a script that reads the 'port_no' information and use that to translate the port number into the interface-name.
Since it's a matter of policy not to modify the kernel, the port mappings that @GarrickHe provided will have to do. Closing this issue.
The
brctl showmacs
output has only the port-number and what we need is the full interface name.For example we are looking for some output like this
As a workaround, could someone tell us how to derive the interface name from the port number? This mapping logic should take into consideration possible port breakouts that are in place.