Cisco – juniper snmp oid: Retrieve the list of interface with vlan no

ciscojuniper-junossnmp

Below are the following commands I used to get the specific data that I need.

  • Get Port Id and Interface

    snmpwalk -r:"switchName" -v:2 -t:10 -c:"*******" -os:"1.3.6.1.2.1.2.2.1.2" -op:"1.3.6.1.2.1.2.2.1.3"

  • Get Vlan No and Vlan Name

    snmpwalk -r:"switchName" -v:2 -t:10 -c:"*******" -os:"1.3.6.1.4.1.2636.3.40.1.5.1.5.1.2" -op:"1.3.6.1.4.1.2636.3.40.1.5.1.5.1.3"

    snmpwalk -r:"switchName" -v:2 -t:10 -c:"*******" -os:"1.3.6.1.4.1.2636.3.40.1.5.1.5.1.5" -op:"1.3.6.1.4.1.2636.3.40.1.5.1.5.1.6"

  • Get MAC Address

    snmpwalk -r:"switchName" -v:2 -t:10 -c:"*******" -os:"1.3.6.1.2.1.2.2.1.2" -op:"1.3.6.1.2.1.2.2.1.3"

    snmpwalk -r:"switchName" -v:2 -t:10 -c:"*******" -os:"1.0.8802.1.1.2.1.4.1.1.7" -op:"1.0.8802.1.1.2.1.4.1.1.8"

  • Get Port Id and Vlan No / Interface And Vlan No

    ??????????????????

Do you guys know what command/oid will I used to get the following vlan no per interface? kindly also verify OID that I used.

Thank you in advance.

Best Answer

  • find the vlan number as you discussed.
  • after you find the vlan number, you can find the association between Port's dot1dBasePortIfIndex number and VLAN number by using 1.3.6.1.4.1.2636.3.40.1.5.1.7.1.3 (jnxExVlanPortStatus)
  • translate between dot1dBasePortIfIndex and IfIndex using 1.3.6.1.2.1.17.1.4.1.1 (dot1dBase)
  • translate between IfIndex and Interface name as you discussed using 1.3.6.1.2.1.2.2.1.2

My version of snmpwalk has very different command structure, but hopefully this helps.

Related Topic