Easy Way to quickly remove all Vlans on Cisco Switch

In work environment if you want to completely erase the whole switch configuration including all Vlans or range of Vlans that are already configured on the switch, you can do very quickly. In a Cisco switch, erasing the Vlan database is one thing and erasing the range of vlans that exist on the switch is another thing. It is a good practice to completely erase everything on a switch before using the switch in another part of your network. This is important in order to avoid any network conflicts because of any old configuration settings that are already configured on the switch.

1. Deleting the switch Vlans Database:

You can find the complete Vlans configured list by executing the command “show vlan brief”. In this example you can see that there are 3 vlans configured on the switch. These vlans are stored in a file in flash memory called “vlan.dat”. You can see this file if you read what is stored in the flash:

ciscoconsole#show vlan brief

2   VLAN0002                         active
3   VLAN0003                         active
4   VLAN0004                         active

ciscoconsole#show flash:

Directory of flash:/

1  -rw-     4414921       <no date>  c2960-lanbase-mz.122-25.FX.bin

2  -rw-         616          <no date>  vlan.dat

64016384 bytes total (59600847 bytes free)

As you can see from output above, the file “vlan.dat” is stored in flash. You have to delete this file in order to completely erase all vlans on the switch.

ciscoconsole#delete vlan.dat

Delete filename [vlan.dat]?

Delete flash:/vlan.dat? [confirm]

ciscoconsole#sh flash

Directory of flash:/

1  -rw-     4414921          <no date>  c2960-lanbase-mz.122-25.FX.bin

64016384 bytes total (59601463 bytes free)

ciscoconsole#reload

After executing the command “delete vlan.dat” just hit enter twice and it will be gone. Then you have to reload the switch.

2. Deleting range of Vlans :

You can delete range of Vlans at a time on Cisco switch using no vlan command and this will save you time when you are working with Labs.


c
iscoconsole(config)#no vlan 2-1000

Now you can verify the Vlans on the switch. All the vlans range 2-1000 deleted from the switch.


ciscoconsole(config)#do sh vlan br

VLAN Name                             Status    Ports
—- ——————————– ——— ——————————-
1      default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/16, Fa0/17, Fa0/18, Fa0/19
Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24

1002  fddi-default                      act/unsup
1003  token-ring-default         act/unsup
1004  fddinet-default                 act/unsup
1005  trnet-default                      act/unsup

Share/Bookmark

Filed Under: VLAN/VTP

Tags:

About the Author:

RSSComments (1)

Leave a Reply | Trackback URL

  1. Ramesh says:

    Deleting Vlan database from Cisco 6500 switch..
    Switch#delete const_nvram:vlan.dat

    Delete filename [vlan.dat]?

    Delete flash:/vlan.dat? [confirm]

    Vlan database is stored in const_nvram:

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.