cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
19128
Views
10
Helpful
4
Replies

how to SNMP query the assigned vlan id of physical switch port

trsandersonii
Level 1
Level 1

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?

4 Replies 4

Joe Clarke
Cisco Employee
Cisco Employee

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.

Exactly what I needed. Thanks!

How can I get the vlan information on a trunk port using snmp?

Fabio,

Did you find an answer to this? I have the same question. 

Review Cisco Networking products for a $25 gift card