cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
73372
Views
0
Helpful
6
Replies
Enthusiast

Configure Replace (How to remove vlans ? )

Hello guys.

As you know we can remove vlans without reload, just with the command "no vlan 1-4094. For example:

SW1(config)#vlan 15

SW1(config-vlan)#no vlan 1-4094

%Default VLAN 1 may not be deleted.

%Default VLAN 1002 may not be deleted.

%Default VLAN 1003 may not be deleted.

%Default VLAN 1004 may not be deleted.

%Default VLAN 1005 may not be deleted.

SW1(config)#do sh 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/9, Fa0/10, Fa0/11, Fa0/12

                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16

                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20

                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24

                                                Gi0/1, Gi0/2

1002 fddi-default                     act/unsup

1003 trcrf-default                    act/unsup

1004 fddinet-default                  act/unsup

1005 trbrf-default                    act/unsup

As you can see VLAN15 was succesfully removed!

There is good command to clear our device configuration. #configure replace dir:filename.cfg

Take a look what happens when we wan't to remove VLANs. Our new configuration ( we will replace running config with this):

SW1#more flash:config.cfg

!

version 15.0

no service pad

service timestamps debug datetime localtime

service timestamps log datetime msec localtime

service timestamps log uptime

no service password-encryption

!

hostname SW1

!

boot-start-marker

boot-end-marker

!

enable password cisco

!

no aaa new-model

clock timezone GMT+2 2

clock summer-time GMT+2 recurring last Sun Mar 2:00 last Sun Oct 3:00

system mtu routing 1500

ip subnet-zero

vtp mode transparent

no vlan 2-1000

!

end

When we run "configure replace" command:

SW1#configure replace flash:config.cfg list force

<...>

% Default interface VLAN 1 may not be deleted.

% Default interface VLAN 1 may not be deleted.

00:07:26: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down

<...>

Rollback aborted after 5 passes

The following commands are failed to apply to the IOS image.

********

no interface Vlan1

<...>

Mhm, VLAN 1 may not be deleted? That's ok. But why VLAN15 is still there?

SW1#sh 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/9, Fa0/10, Fa0/11, Fa0/12

                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16

                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20

                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24

                                                Gi0/1, Gi0/2

15   VLAN0015                         active   

1002 fddi-default                     act/unsup

1003 trcrf-default                    act/unsup

1004 fddinet-default                  act/unsup

1005 trbrf-default                    act/unsup

Is it possible to use configure replace command and succesfully remove VLANs? Which command I am missing in my new configuration file?

Thank you very much for your time and your help!

Everyone's tags (4)
6 REPLIES 6
Highlighted
Collaborator

Re: Configure Replace (How to remove vlans ? )

Does vlan15 show up in the output of "show archive config differences flash:config.cfg running-config"?

Enthusiast

Re: Configure Replace (How to remove vlans ? )

Hello yjdabear!

No there is no difference related with vlans. I can see just my new commands :

+vtp mode transparent

+no vlan 2-1000

Enthusiast

Re: Configure Replace (How to remove vlans ? )

This is also interesting. I can't remove VLANs with TCL script too, please take a look guys:

Switch(tcl)#puts [open "flash:no_vlan.tcl" w+] {

+>puts [ios_config "no vlan 1-4094" "end"]

+>}

Switch(tcl)#tclquit

Switch#sh 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/9, Fa0/10, Fa0/11, Fa0/12

                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16

                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20

                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24

                                                Gi0/1, Gi0/2

10   VLAN0010                         active

1002 fddi-default                     act/unsup

1003 token-ring-default               act/unsup

1004 fddinet-default                  act/unsup

1005 trnet-default                    act/unsup

Switch#tclsh flash:no_vlan.tcl

%Default VLAN 1 may not be deleted.

%Default VLAN 1002 may not be deleted.

%Default VLAN 1003 may not be deleted.

%Default VLAN 1004 may not be deleted.

%Default VLAN 1005 may not be deleted.

Switch#sh 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/9, Fa0/10, Fa0/11, Fa0/12

                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16

                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20

                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24

                                                Gi0/1, Gi0/2

10   VLAN0010                         active

1002 fddi-default                     act/unsup

1003 token-ring-default               act/unsup

1004 fddinet-default                  act/unsup

1005 trnet-default                    act/unsup

Enthusiast

Re: Configure Replace (How to remove vlans ? )

Still no ideas ?

Collaborator

Re: Configure Replace (How to remove vlans ? )

According the documentation, "configure replace" applies the same algorithm as "show archive config differences flash:config.cfg running-config" so if vlan 15 is not seen in the latter's diff output, the former won't replace it either.

The reason vlan 15 cannot be replaced is probably because of vlan.dat, depending on the mode of your device (vtp server, client or transparent).

Beginner

Re: Configure Replace (How to remove vlans ? )

I fixed it on my old 3500XL:

SW01#vlan database
SW01#no vlan 2
SW01(vlan)#exit
APPLY completed.
Exiting....
SW01#sh vlan
CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards