This article shows how to retrieve interface names that are mapped to a specific VLAN using SNMP MIB.
Using SNMP MIB, a user can obtain details of the number of interfaces along with the names that are mapped to a VLAN on EX series.
Example: Use vlan20 , and interfaces ge-0/0/39 and ge-0/0/46 , which are mapped to that VLAN: root@WIRE> show vlans vlan20 Name Tag Interfaces vlan20 20 ge-0/0/39.0*, ge-0/0/46.0*
vlan20
ge-0/0/39
ge-0/0/46
root@WIRE> show vlans vlan20 Name Tag Interfaces vlan20 20 ge-0/0/39.0*, ge-0/0/46.0*
jnxExVlanName
root@WIRE> show snmp mib walk jnxExVlanName jnxExVlanName.2 = Test jnxExVlanName.4 = default jnxExVlanName.5 = vlan20 ----> 5 is the index for vlan20 jnxExVlanName.10 = vt jnxExVlanName.11 = wireless jnxExVlanName.12 = vlan30
jnxExVlanPortStatus
root@WIRE> show snmp mib walk jnxExVlanPortStatus .5 jnxExVlanPortStatus.5.552 = 3 jnxExVlanPortStatus.5.559 = 3
dot1dBasePortIfIndex
ifindex
root@WIRE> show snmp mib get dot1dBasePortIfIndex. 552
dot1dBasePortIfIndex.552 = 589 ----> index for interface ge-0/0/39
ifDescr
root@WIRE> show snmp mib get ifDescr. 589 ifDescr. 589 = ge-0/0/39.0
Retrieve information of the other interface mapped to the VLAN:
root@WIRE> show snmp mib get dot1dBasePortIfIndex.559 dot1dBasePortIfIndex.559 = 596 root@WIRE> show snmp mib get ifDescr.596 ifDescr. 596 = ge-0/0/46.0