Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

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

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
Cisco Employee

Re: how to SNMP query the assigned vlan id of physical switch po

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.

Community Member

Re: how to SNMP query the assigned vlan id of physical switch po

Exactly what I needed. Thanks!

Community Member

How can I get the vlan

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

Community Member

Fabio,

Fabio,

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

8915
Views
5
Helpful
4
Replies
CreatePlease to create content