08-28-2009 08:19 AM - edited 03-06-2019 07:29 AM
I need to SNMP query a 2960 switch for and interface name, the up/down status of the interface, and the assigned vlan. I have figured out how to get the interface name and status but cannot figure out how to read what the assigned vlan id is. anyone know the technique for doing this?
08-28-2009 09:28 AM
You can poll the vmVlan object from the CISCO-VLAN-MEMBERSHIP-MIB (1.3.6.1.4.1.9.9.68.1.2.2.1.2). That object will be indexed by ifIndex. For example, from one of my 2960s:
CISCO-VLAN-MEMBERSHIP-MIB::vmVlan.10001 = INTEGER: 1
CISCO-VLAN-MEMBERSHIP-MIB::vmVlan.10002 = INTEGER: 1
CISCO-VLAN-MEMBERSHIP-MIB::vmVlan.10003 = INTEGER: 1
CISCO-VLAN-MEMBERSHIP-MIB::vmVlan.10004 = INTEGER: 192
IF-MIB::ifDescr.10001 = STRING: FastEthernet0/1
IF-MIB::ifDescr.10002 = STRING: FastEthernet0/2
IF-MIB::ifDescr.10003 = STRING: FastEthernet0/3
IF-MIB::ifDescr.10004 = STRING: FastEthernet0/4
So, Fa0/1-3 are in vlan 1, but Fa0/4 is in vlan 192.
08-28-2009 11:19 AM
Exactly what I needed. Thanks!
09-29-2016 05:27 PM
How can I get the vlan information on a trunk port using snmp?
05-16-2017 02:59 PM
Fabio,
Did you find an answer to this? I have the same question.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide