Description

This article shows how to retrieve interface names that are mapped to a specific VLAN using SNMP MIB.

Symptoms

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.

Solution

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*

  1. Use jnxExVlanName to get the index of the specific VLAN:

        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

  • Use jnxExVlanPortStatus to get the number and status of the interface mapped to the VLAN:

        root@WIRE> show snmp mib walk jnxExVlanPortStatus .5
         jnxExVlanPortStatus.5.552 = 3
        jnxExVlanPortStatus.5.559 = 3

  •   Use dot1dBasePortIfIndex to obtain the ifindex value:

         root@WIRE> show snmp mib get dot1dBasePortIfIndex. 552  
        dot1dBasePortIfIndex.552 = 589      ----> index for interface ge-0/0/39

  • Use ifDescr to provide the interface name for that specific index:

           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