This article provides information on how to identify which MAC address (non-default VLAN) is learnt from which interface via SNMP.
Note: This article applies only to legacy EX series products.
With the following ethernet-switching table as a reference, the procedure to identify which interface is learnt from which MAC address for a certain VLAN is as follows:
{master:0} lab@EX10> show ethernet-switching table Ethernet-switching table: 7 entries, 4 learned VLAN MAC address Type Age Interfaces default * Flood - All-members vlan750 * Flood - All-members vlan750 00:26:88:6d:a9:81 Learn 4:04 ge-0/0/4.0 vlan750 00:26:88:6d:a9:87 Learn 0 ge-0/0/4.0 vlan750 00:26:88:74:15:01 Static - Router vlan750 00:26:88:79:4e:4d Learn 0 ge-0/0/10.0 vlan750 00:26:88:79:4e:4e Learn 0 ge-0/0/11.0
{master:0} lab@EX10> show snmp mib walk dot1qVlanStaticName | match vlan750 dot1qVlanStaticName.4 = vlan750
{master:0} lab@EX10> show vlans vlan750 extensive | match index 802.1Q Tag: 750, Internal index: 4, Admin State: Enabled, Origin: Static
{master:0} lab@EX10> show snmp mib walk dot1qTpFdbPort.4 dot1qTpFdbPort.4.0.0.0.0.0.0 = 0 dot1qTpFdbPort.4.0.38.136.109.169.129 = 517 dot1qTpFdbPort.4.0.38.136.109.169.135 = 517 dot1qTpFdbPort.4.0.38.136.116.21.1 = 0 dot1qTpFdbPort.4.0.38.136.121.78.77 = 523 dot1qTpFdbPort.4.0.38.136.121.78.78 = 524
dot1qTpFdbPort.4.0.38.136.121.78.77 = 523
0.38.136.121.78.77 (Dec)
0:26:88:79:4E:4C (Hex)
{master:0} lab@EX10> show snmp mib walk dot1dBasePortIfIndex | match 523 dot1dBasePortIfIndex.523 = 514
{master:0} lab@EX10> show snmp mib get ifName.514 ifName.514 = ge-0/0/10.0
{master:0} lab@EX10> show interfaces extensive | grep SNMP | match 514 Logical interface ge-0/0/10.0 (Index 67) (SNMP ifIndex 514) (Generation 132)
2020-05-20: Added note that this article only applies to legacy EX products.