how to SNMP query the assigned vlan id of physical switch port
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Labels:
-
LAN Switching

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2009 11:19 AM
Exactly what I needed. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2016 05:27 PM
How can I get the vlan information on a trunk port using snmp?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2017 02:59 PM
Fabio,
Did you find an answer to this? I have the same question.
