IP Application Services

How to Get VLAN Information From a Catalyst Using SNMP

Document ID: 41003

Updated: Oct 26, 2005



Catalyst switches are configured with Virtual Local Area Networks (VLANs) either through command line operation or VLAN Trunk Protocol (VTP). In either case, Simple Network Management Protocol (SNMP) information is sometimes accessed on a per-vlan basis. In order to access that information, you must determine the configured VLANs. This document shows you how to determine what VLANs are configured on a Catalyst switch running either CatOS or IOS.

Before You Begin


For more information on document conventions, see the Cisco Technical Tips Conventions.


Before attempting this configuration, ensure that you meet the following prerequisites:

  • Familiarity with Catalyst switch commands

  • Familiarity with SNMP tools and commands such as snmpget and snmpwalk

Components Used

The information in this document is based on the software and hardware versions below.

  • CatOS 6.3(4)

  • Catalyst IOS version 12.0(5)WC5a

  • Catalyst 3524XL

The information presented in this document was created from devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If you are working in a live network, ensure that you understand the potential impact of any command before using it.

Related Products

This configuration can also be used with the following hardware and software versions.

  • Other Catalyst switches

  • Other Catalyst IOS releases

Retrieving the VLAN Info


In this section, you use the CISCO-VTP-MIB and access the vtpVlanState object in order to determine the active VLANs on the device.

Step-by-Step Instructions

Follow the steps below.

  1. Perform an snmpwalk on the device in question. An example follows:

    nms-server2:/home/ccarring> snmpwalk -c public vtpVlanState
    CISCO-VTP-MIB::vtpVlanState.1.1 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.2 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.6 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.7 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.8 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.11 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.12 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.14 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.18 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.19 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.20 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.21 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.41 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.42 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.43 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.44 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.100 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.101 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.123 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.401 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.1002 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.1003 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.1004 = INTEGER: operational(1)
    CISCO-VTP-MIB::vtpVlanState.1.1005 = INTEGER: operational(1)
  2. The last number in each object returned is the VLAN id; for each of these VLANs, there is a full set of SNMP infomation.

    You can obtain full information when you query the vtpVlanTable object. These are relevant objects in the table:


To verify if the information provided is correct, follow these steps.

  1. Telnet to the switch.

  2. Issue the show vlan brief command, as shown below for a Catalyst running IOS.

    nms-3524xl-b#show vlan brief
    VLAN Name Status Ports
    ---- -------------------------------- --------- -------------------------------
    1 default active Fa0/3, Fa0/5, Fa0/6, Fa0/7,
    Fa0/8, Fa0/9, Fa0/10, Fa0/11,
    Fa0/12, Fa0/13, Fa0/14, Fa0/15,
    Fa0/16, Fa0/18, Fa0/19, Fa0/20,
    Fa0/21, Fa0/22, Fa0/23
    2 vlan2 active
    6 vlan6 active Fa0/1, Fa0/24, Gi0/1
    7 vlan7 active
    8 VLAN0008 active
    11 elan1 active
    12 VLAN0012 active
    14 VLAN0014 active
    18 vlan18-spnms active
    19 vlan19-spnms active
    20 vlan20-spnms active
    21 vlan21-spnms active
    41 URT_Logon active
    42 URT_Priveleged active
    43 URT_12_Logon active
    44 URT_12_Priveleged active
    100 vlan-100 active Fa0/2, Fa0/4, Fa0/17
    101 VLAN0101 active
    123 VLAN0123 active
    401 VLAN0401 active
    1002 fddi-default active
    1003 token-ring-default active
    1004 fddinet-default active
    1005 trnet-default active
  3. You can compare this information with the SNMP output, collected earlier. The VLAN name and number matches these values.


There is currently no specific troubleshooting information available for this configuration.

Related Information

Updated: Oct 26, 2005
Document ID: 41003