Guest

Cisco Catalyst 2940 Series Switches

Managing vlan.dat in Cisco Catalyst Switches Running Cisco IOS Software

Document ID: 109304

Updated: Dec 19, 2008

   Print

Introduction

Cisco Catalyst switches that run Cisco IOS® software releases maintain the VLAN information in a special file named vlan.dat. This document discusses the purpose of this file, and ways to manage the file.

Prerequisites

Requirements

Cisco recommends that you have knowledge of this topic:

  • Understand how Cisco Catalyst switches work

Components Used

This document is not restricted to specific software and hardware versions.

The information in this document is based on these software and hardware versions:

  • Cisco Catalyst 6500 switch that runs Cisco IOS Software Release 12.1(26)E1

  • Cisco Catalyst 2950 switch that runs Cisco IOS Software Release 12.1(22)EA9

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.

Related Products

This document can also be used with these hardware and software versions:

  • Cisco Catalyst 6000, 4500, 4000 series switches that run Cisco IOS

  • Cisco Catalyst 3750, 3750E, 3560, 3560E, 3550, 2970, 2960, 2955, 2950, and 2940 series switches

Conventions

Refer to Cisco Technical Tips Conventions for more information on document conventions.

Background Information

VLAN or VTP configuration changes in CatOS are written to NVRAM immediately after a change is made. In contrast, Cisco IOS software does not save configuration changes to NVRAM unless you issue the copy run start command.

VTP client and server systems require VTP updates from other VTP servers to be immediately saved in NVRAM without user intervention. The VTP update requirements are met by the default CatOS operation, but the Cisco IOS software update model requires an alternative update operation. For this, a VLAN database was introduced to Cisco IOS software for Catalyst switches as a method to immediately save VTP updates for VTP clients and servers. This VLAN database is in the form of a separate file in NVRAM called the vlan.dat file.

Managing vlan.dat File

During Switch Bootup

During boot up, the switch compares the content in the vlan.dat file and the configuration in startup-config to determine if it should use the configuration in vlan.dat or startup-config. When you save VTP mode, domain name, and VLAN configurations in the switch startup configuration file and reboot the switch, the VTP and VLAN configurations are selected by these conditions:

  • If both the VLAN database and the configuration file show the VTP mode as transparent and the VTP domain names match, the VLAN database is ignored. The VTP and VLAN configurations in the startup configuration file are used. The VLAN database revision number remains unchanged in the VLAN database.

  • If the startup VTP mode is server mode, or the startup VTP mode or domain names do not match the VLAN database, VTP mode and VLAN configuration for the first 1005 VLANs are selected by VLAN database information, such as the vlan.dat file. VLANs greater than 1005 are configured from the switch configuration file.

If there is no vlan.dat file, or if the vlan.dat cannot be read, the switch boots with these characteristics:

Attribute Default Values
VTP Mode Server
VTP Domain Name (no name / empty)
VLANs 1, 1002-1005

Filename and Location

By default, the VLAN database file name is vlan.dat.

You can use the vtp file <filename> command to rename the file. You cannot use the vtp file command to load a new database. You can use it only to rename the file in which the existing database is stored.

This example shows how to specify the IFS file system file where the VTP configuration is stored:

Switch(config)#vtp file vtpconfig

Setting device to store VLAN database at filename vtpconfig.   
Switch(config)#

The vlan.dat stored in NVRAM alone can be accessed by the switch. The vlan.dat file can be copied from its location for backup purposes. The memory location name where the vlan.dat file is stored varies from device to device. Refer to the respective product documentation before you issue the copy command.

In Cisco Catalyst 6500/6000 series switches, it is const_nvram:. Similarily for Catalyst 4500/4000 switches, it is cat4000_flash:. In Cisco Catalyst 29xx series and Cisco Catalyst 35xx, 3750 series, it is referred to as flash:.

Cat6K-IOS#dir const_nvram: 
Directory of const_nvram:/ 
1 -rwx 856 <no date> vlan.dat 
129004 bytes total (128148 bytes free)

Viewing VLAN Information

In order to display all the VLAN configurations, the VLAN ID, name, and so forth, that are stored in the binary vlan.dat file, you must issue the show vlan command.

You can display the VTP information, the mode, domain, and so forth, with use of the show vtp status command.

The VLAN information and the VTP information are not displayed in the show running-config command output when the switch is in the VTP server/client mode. This is normal behavior of the switch.

Switch#show run | include vlan
vlan internal allocation policy ascending
Switch#

Switch#show run | include vtp
Switch#

Switches that are in VTP transparent mode display the VLAN and VTP configurations in the show running-config command output because this information is also stored in the configuration text file.

Switch#show run | include vlan
vlan internal allocation policy ascending
vlan 1
 tb-vlan1 1002
 tb-vlan2 1003
vlan 20-21,50-51 
vlan 1002
 tb-vlan1 1
 tb-vlan2 1003
vlan 1003
 tb-vlan1 1
 tb-vlan2 1002
vlan 1004
vlan 1005 

Switch#show run | include vtp
vtp domain cisco
vtp mode transparent

Reset VLAN Information to Defaults

Complete this procedure to reset the VLAN configuration on a Cisco Catalyst switch that runs Cisco IOS software.

In this example, a Cisco Catalyst 6500 switch is in VTP client mode. In order to reset the VLAN information, you have to remove the vlan.dat file and reload the switch.

  1. Issue the show vtp status and show vlan commands to determine the original VTP/VLAN information.

    Cat6K-IOS#show vtp status
    VTP Version                     : 2
    Configuration Revision          : 0
    Maximum VLANs supported locally : 1005
    Number of existing VLANs        : 12
    VTP Operating Mode              : Client
    VTP Domain Name                 : Cisco123
    VTP Pruning Mode                : Enabled
    VTP V2 Mode                     : Disabled
    VTP Traps Generation            : Disabled
    MD5 digest                      : 0xDF 0xCE 0x47 0x0B 0xD0 0x3F 0xEA 0x18
    Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00 
    Local updater ID is 172.16.5.12 on interface Vl1 (lowest numbered VLAN interface
     found)
    Cat6K-IOS#
    Cat6K-IOS#show vlan
    
    VLAN Name                             Status    Ports
    ---- -------------------------------- --------- -------------------------------
    1    default                          active    Fa3/11, Fa3/16
    5    VLAN0005                         active    Fa3/1
    10   VLAN0010                         active    Fa3/5
    20   Management_Vlan                  active    Fa3/7, Fa3/9, Fa3/24
    30   SW-3_PCs_Vlan                    active
    40   SW-1_PCs_Vlan                    active
    50   IP_Phone_Voice_Vlan              active
    60   Guest_Fail_Vlan                  active
    1002 fddi-default                     act/unsup
    1003 token-ring-default               act/unsup
    1004 fddinet-default                  act/unsup
    1005 trnet-default                    act/unsup
    
    VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
    ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
    1    enet  100001     1500  -      -      -        -    -        0      0
    5    enet  100005     1500  -      -      -        -    -        0      0
    10   enet  100010     1500  -      -      -        -    -        0      0
    
    !--- Rest of the output elided
    
    
  2. Verify the vlan.dat file status.

    Cat6K-IOS#dir const_nvram:
    Directory of const_nvram:/
        1  -rw-         976                    <no date>  vlan.dat
    129004 bytes total (128028 bytes free)
    Cat6K-IOS#

    Note: The memory location where the vlan.dat file is stored varies from device to device. See the Filename and Location section in this document for more information.

  3. Remove the vlan.dat file from NVRAM.

    Note: Before you delete the file from NVRAM, it is recommended to make a backup of the file. See the Backup and Restore of vlan.dat File section for the procedure.

    Cat6K-IOS#delete const_nvram:vlan.dat
    
    Delete filename [vlan.dat]?
    Delete const_nvram:vlan.dat? [confirm]
    
    
    Cat6K-IOS#dir const_nvram:
    Directory of const_nvram:/
        1  -rw-           0                    <no date>  vlan.dat
    129004 bytes total (129004 bytes free)
    Cat6K-IOS#

    Note that the size of the vlan.dat file is zero (0).

  4. Reload the switch.

    Cat6K-IOS#reload
    Proceed with reload? [confirm]
    
    !--- Rest of the output no displayed.
    
    
  5. After the switch boots up, verify if the VLAN information is set to default values. For information on the default values, see the table in the During Switch Bootup section.

    Cat6K-IOS#show vtp status
    VTP Version                     : 2
    Configuration Revision          : 0
    Maximum VLANs supported locally : 1005
    Number of existing VLANs        : 5
    VTP Operating Mode              : Server
    VTP Domain Name                 :
    VTP Pruning Mode                : Disabled
    VTP V2 Mode                     : Disabled
    VTP Traps Generation            : Disabled
    MD5 digest                      : 0x57 0xCD 0x40 0x65 0x63 0x59 0x47 0xBD
    Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
    Local updater ID is 172.16.5.12 on interface Vl1 (lowest numbered VLAN interface
     found)
    Cat6K-IOS#show vlan
    
    VLAN Name                             Status    Ports
    ---- -------------------------------- --------- -------------------------------
    1    default                          active    Fa3/11, Fa3/16
    1002 fddi-default                     act/unsup
    1003 token-ring-default               act/unsup
    1004 fddinet-default                  act/unsup
    1005 trnet-default                    act/unsup
    
    VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
    ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
    1    enet  100001     1500  -      -      -        -    -        0      0
    1002 fddi  101002     1500  -      -      -        -    -        0      0
    1003 tr    101003     1500  -      -      -        -    -        0      0
    1004 fdnet 101004     1500  -      -      -        ieee -        0      0
    1005 trnet 101005     1500  -      -      -        ibm  -        0      0
    
    Remote SPAN VLANs
    ------------------------------------------------------------------------------
    
    
    Primary Secondary Type              Ports
    ------- --------- ----------------- ------------------------------------------
    
    Cat6K-IOS#
    Cat6K-IOS#dir const_nvram:
    Directory of const_nvram:/
        1  -rw-           0                    <no date>  vlan.dat
    129004 bytes total (129004 bytes free)
    Cat6K-IOS#

    At this point, the VTP VLAN configuration change can be triggered in two ways:

    • User configuration on the device (CLI/SNMP)

    • VTP update from other devices in the same VTP domain

    This means that even if the switch was originally in client mode, simply applying another saved configuration does not set it back to client mode. In order to return the switch to client mode, the network administrator needs to manually configure the system with the vtp mode client command in global configuration mode.

Recovering vlan.dat File

If the vlan.dat file is deleted accidently and the switch gets reloaded, all the VLANs that were available on the switch are lost. Until the switch is reloaded, the VLAN information is present in the switch.

    Complete these steps in order to recover the vlan.dat file:

  1. Issue the show vlan command in order to confirm the availability of VLAN information.

    Switch#show vlan
    
    VLAN Name                             Status    Ports
    ---- -------------------------------- --------- -------------------------------
    1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                    Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                    Fa0/10, Fa0/11, Fa0/12, Gi0/1
                                                    Gi0/2
    10   VLAN0010                         active
    11   VLAN0011                         active
    20   VLAN0020                         active
    21   VLAN0021                         active
    30   VLAN0030                         active
    31   VLAN0031                         active
    40   VLAN0040                         active
    41   VLAN0041                         active
    50   Vlan50                           active
    100  100thVLAN                        active
  2. If the switch is in VTP server or transparent mode, make any modifications to the VLAN database.

    Modifications to the VLAN database can be any of these:

    • Create any VLAN.

    • Delete any VLAN.

    • Modify the attributes of any existing VLAN.

    If the switch is in VTP client mode, make modifications to the VLAN database at any VTP server of the same domain.

    Switch#configure terminal
    Enter configuration commands, one per line.  End with CNTL/Z.
    Switch(config)#vlan 50
    
    Switch(config-vlan)#name 50thVLAN
    
    Switch(config-vlan)#end
    Switch#

    Once any change is done to the VLAN database, the switch automatically creates the vlan.dat file.

  3. Issue the show flash: command in order to verify the creation of the vlan.dat file.

    Switch#show flash:
    Directory of flash:/
        2  -rwx           5   Mar 01 1993 00:04:47  private-config.text
        3  -rwx     2980487   Mar 02 1993 06:08:14  c2950-i6q4l2-mz.121-19.EA1a.bin
        4  -rwx        1156   Mar 01 1993 01:51:27  vlan.dat
       16  -rwx        1014   Mar 01 1993 00:04:47  config.text
        6  drwx        4096   Mar 02 1993 03:49:26  html
        7  -rwx     3121383   Mar 02 1993 03:47:52  c2950-i6q4l2-mz.121-22.EA9.bin
    7741440 bytes total (65536 bytes free)

    Note: The memory location where the vlan.dat file is stored varies from device to device. See the Filename and Location section for more information.

Backup and Restore of vlan.dat File

Network administrators might want to back up the vlan.dat file, especially for their VTP server systems. The vlan.dat file can be backed be saved to the same locations as any other file (bootflash, disk0:, bootdisk:, tftp:, ftp:, etc). Even though the file can be copied to any location, it can only be read from NVRAM.

In order to perform a complete backup of your configuration, include the vlan.dat file in the backup along with the configuration. Then, if the entire switch or the Supervisor Engine module requires replacement, the network administrator must upload both of these files in order to restore the complete configuration:

  • The vlan.dat file

  • The configuration file

This also has an effect in dual supervisor environments when running Stateful Switchover (SSO). Because the file to file sync is only available for NVRAM, if the vlan.dat is in a non-NVRAM location such as bootflash:, there will not be vlan.dat file sync between the active and standby supervisors. Instead, when the standby SP receives the new VLAN data, it will write the config in standby vlan.dat.

Finally, if a saved vlan.dat is applied to a system that has already booted, the system must be reloaded before the newly applied vlan.dat configuration takes effect.

  1. Issue the show vtp status and show vlan commands to determine the original VTP/VLAN information.

    Cat6K-IOS#show vtp status
    VTP Version                     : 2
    Configuration Revision          : 0
    Maximum VLANs supported locally : 1005
    Number of existing VLANs        : 12
    VTP Operating Mode              : Client
    VTP Domain Name                 : Cisco123
    VTP Pruning Mode                : Enabled
    VTP V2 Mode                     : Disabled
    VTP Traps Generation            : Disabled
    MD5 digest                      : 0xDF 0xCE 0x47 0x0B 0xD0 0x3F 0xEA 0x18
    Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00 
    Local updater ID is 172.16.5.12 on interface Vl1 (lowest numbered VLAN interface
     found)
    Cat6K-IOS#
    
    
    Cat6K-IOS#show vlan
    
    VLAN Name                             Status    Ports
    ---- -------------------------------- --------- -------------------------------
    1    default                          active    Fa3/11, Fa3/16
    5    VLAN0005                         active    Fa3/1
    10   VLAN0010                         active    Fa3/5
    20   Management_Vlan                  active    Fa3/7, Fa3/9, Fa3/24
    30   SW-3_PCs_Vlan                    active
    40   SW-1_PCs_Vlan                    active
    50   IP_Phone_Voice_Vlan              active
    60   Guest_Fail_Vlan                  active
    1002 fddi-default                     act/unsup
    1003 token-ring-default               act/unsup
    1004 fddinet-default                  act/unsup
    1005 trnet-default                    act/unsup
    
    VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
    ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
    1    enet  100001     1500  -      -      -        -    -        0      0
    5    enet  100005     1500  -      -      -        -    -        0      0
    10   enet  100010     1500  -      -      -        -    -        0      0
    
    !--- Rest of the output elided
    
    
  2. Verify the vlan.dat file status.

    Cat6K-IOS#dir const_nvram:
    Directory of const_nvram:/
        1  -rw-         976                    <no date>  vlan.dat
    129004 bytes total (128028 bytes free)
    Cat6K-IOS#

    Note: The memory location where the vlan.dat file is stored varies from device to device. See the Filename and Location section for more information.

  3. Back up the existing vlan.dat file.

    Cat6K-IOS#copy const_nvram:vlan.dat bootflash:vlan.dat
    Destination filename [vlan.dat]?
    976 bytes copied in 0.516 secs (1891 bytes/sec)
    
    
    Cat6K-IOS#show bootflash:
    -#- ED ----type---- --crc--- -seek-- nlen -length- ---------date/time--------- n
    ame
    1   .. image        C32839CA  2349AC   30  1788204 May 31 2006 18:15:50 +00:00 c
    6msfc2-boot-mz.121-13.E17.bin
    2   .. unknown      1D1450E8  234DFC    8      976 Dec 01 2008 01:43:18 +00:00 v
    lan.dat
    
    13414916 bytes available (1789436 bytes used)
  4. Remove the vlan.dat file from NVRAM.

    Cat6K-IOS#delete const_nvram:vlan.dat
    
    Delete filename [vlan.dat]?
    Delete const_nvram:vlan.dat? [confirm]
    
    
    Cat6K-IOS#dir const_nvram:
    Directory of const_nvram:/
        1  -rw-           0                    <no date>  vlan.dat
    129004 bytes total (129004 bytes free)
    Cat6K-IOS#
  5. Reload the switch.

    Cat6K-IOS#reload
    Proceed with reload? [confirm]
    
    !--- Rest of the output elided
    
    
  6. Verify the reset of VTP/VLAN information after reload.

    Cat6K-IOS#show vtp status
    VTP Version                     : 2
    Configuration Revision          : 0
    Maximum VLANs supported locally : 1005
    Number of existing VLANs        : 5
    VTP Operating Mode              : Server
    VTP Domain Name                 :
    VTP Pruning Mode                : Disabled
    VTP V2 Mode                     : Disabled
    VTP Traps Generation            : Disabled
    MD5 digest                      : 0x57 0xCD 0x40 0x65 0x63 0x59 0x47 0xBD
    Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
    Local updater ID is 172.16.5.12 on interface Vl1 (lowest numbered VLAN interface
     found)

    Notice that the number of existing VLANs has dropped from 12 to 5, and the Domain is now empty instead of Cisco123.

    Cat6K-IOS#dir const_nvram:
    Directory of const_nvram:/
        1  -rw-           0                    <no date>  vlan.dat
    129004 bytes total (129004 bytes free)
    Cat6K-IOS#
  7. Copy the saved vlan.dat file to the NVRAM.

    Cat6K-IOS#copy bootflash:vlan.dat const_nvram:vlan.dat
    Destination filename [vlan.dat]?
    976 bytes copied in 0.688 secs (1419 bytes/sec)
    Cat6K-IOS#
    
    Cat6K-IOS#dir const_nvram:
    Directory of const_nvram:/
        1  -rw-         976                    <no date>  vlan.dat
    129004 bytes total (128028 bytes free)
    Cat6K-IOS#
  8. Check if there is any change in the VTP status. There would not be any change, as the vlan.dat file is read only when the switch boots up. In order to bring the changes to effect, reload the switch.

    Cat6K-IOS#show vtp status
    VTP Version                     : 2
    Configuration Revision          : 0
    Maximum VLANs supported locally : 1005
    Number of existing VLANs        : 5
    VTP Operating Mode              : Server
    VTP Domain Name                 :
    VTP Pruning Mode                : Disabled
    VTP V2 Mode                     : Disabled
    VTP Traps Generation            : Disabled
    MD5 digest                      : 0x57 0xCD 0x40 0x65 0x63 0x59 0x47 0xBD
    Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
    Local updater ID is 172.16.5.12 on interface Vl1 (lowest numbered VLAN interface
     found)
    Cat6K-IOS#
  9. Reload the switch.

    Cat6K-IOS#reload
    Proceed with reload? [confirm]
    
    !--- Rest of the output elided
    
    
  10. Once the switch boots up, verify if the VLAN/VTP information has been properly restored.

    Cat6K-IOS#show vtp status
    VTP Version                     : 2
    Configuration Revision          : 0
    Maximum VLANs supported locally : 1005
    Number of existing VLANs        : 12
    VTP Operating Mode              : Server
    VTP Domain Name                 : Cisco123
    VTP Pruning Mode                : Enabled
    VTP V2 Mode                     : Disabled
    VTP Traps Generation            : Disabled
    MD5 digest                      : 0xDF 0xCE 0x47 0x0B 0xD0 0x3F 0xEA 0x18
    Configuration last modified by 172.16.5.12 at 11-16-07 03:23:56
    Local updater ID is 172.16.5.12 on interface Vl1 (lowest numbered VLAN interface
     found)
    Cat6K-IOS#
    Cat6K-IOS#show vlan
    
    VLAN Name                             Status    Ports
    ---- -------------------------------- --------- -------------------------------
    1    default                          active    Fa3/11, Fa3/16
    5    VLAN0005                         active    Fa3/1
    10   VLAN0010                         active    Fa3/5
    20   Management_Vlan                  active    Fa3/7, Fa3/9, Fa3/24
    30   SW-3_PCs_Vlan                    active
    40   SW-1_PCs_Vlan                    active
    50   IP_Phone_Voice_Vlan              active
    60   Guest_Fail_Vlan                  active
    1002 fddi-default                     act/unsup
    1003 token-ring-default               act/unsup
    1004 fddinet-default                  act/unsup
    1005 trnet-default                    act/unsup
    
    VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
    ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
    1    enet  100001     1500  -      -      -        -    -        0      0
    5    enet  100005     1500  -      -      -        -    -        0      0
    10   enet  100010     1500  -      -      -        -    -        0      0
    20   enet  100020     1500  -      -      -        -    -        0      0
    
    !--- Rest of the the output not shown.
    
    

Archiving vlan.dat Using Archive Management

The Archive Management application maintains an active archive of the vlan.dat file of devices managed by Resource Manager Essentials (RME). It enables you to perform these tasks:

  • Fetch, and archive, device configurations (which includes the vlan.dat file)

  • Search and generate reports on archived data

  • Compare and label configurations (which includes the vlan.dat file)

For more information on the Archive Management application, refer to Archiving Configurations and Managing Them Using Archive Management.

The RME suite is part of the CiscoWorks LAN Management Solution (LMS), one of the bundle in the CiscoWorks family of products. It is an Enterprise solution to network management. RME is a powerful suite of web-based applications offering network management solutions for Cisco switches, access servers, and routers.

For more information on RME and its applications, refer to Overview of RME.

VLAN Information and Redundancy

Supervisor engine redundancy does not support non-default VLAN data file names or locations. Do not enter the vtp file file_name command on a switch that has a redundant supervisor engine.

Before installing a redundant supervisor engine, enter the no vtp file command to return to the default configuration.

In Route Processor Redundancy (RPR+) redundancy, supervisor engine redundancy does not support configuration entered in VLAN database mode. Use global configuration mode with RPR+ redundancy.

In SSO, the NVRAM vlan.dat file sync from active SP to standby SP is still done so that if switchover happens in the middle of sync'ing VLANs record, standby can recover by loading in the binary file from NVRAM. Because the file to file sync is only available for NVRAM, if the binary file is in a non-NVRAM location such as bootflash:, there will not be vtp binary config file sync between active and standby. In fact, if the vlan.dat is not in NVRAM, then during standby boot up, the standby supervisor will not come online. An error message should be displayed on the active supervisor to ask users to change vlan.dat location to NVRAM.

Related Information

Updated: Dec 19, 2008
Document ID: 109304