Cisco Support Community

Changing the management VLAN on a layer 2 switch

Suppose I want to change the management VLAN on a layer-2 switch, say a Cat2912XL. I think I can do it something like this.

int VLAN 1

desc Old management VLAN



int VLAN 2

desc New management VLAN

ip address

no shut


ip default-gateway

Now, suppose I want to do it remotely. Problem is that I have to shut down the old VLAN interface before I can bring up the new one. That cuts off the telnet session.

Does anyone have a trick to do this as an atomic operation, i.e. as a single command line? Preferably a solution that does not involve reloading the switch, because it is carrying live traffic. For example, is there any way to creat a command macro, like a multi-line alias?

Kevin Dorrell



Re: Changing the management VLAN on a layer 2 switch

It's OK, I found it. I made a little file containing the lines, called swap-vlan, and put it on my TFTP server. I then copied the file into the flash of the switch, then did a copy flash run, giving swap-vlan as the source file name.

I did a dry run on an unused switch first, to check that the config lines did the job they were supposed to, and didn't cut me off forever. I also did a reload in 10, just in case, and cancelled it once I had contacted the switch in its new position.

Must not forget to copy run start once it is working.

Kevin Dorrell



Re: Changing the management VLAN on a layer 2 switch

That's very creative Kevin! I'll rate your for that ;)

CreatePlease to create content