0

I have some switches where i need to change both ip address and default gateway on the management vlan. (remote)

Is it possible to change the startup config, and reboot the switch with the new settings ?

Muller
  • 57
  • 5

3 Answers3

1

You can schedule the reload command. There are two keywords that you can specify for reload scheduling:

reload at [specific date and time]
reload in [minutes]

Examples:

CiscoRouter# reload at 14:00

The above will reload the router at 2:00pm in the current date.

CiscoRouter# reload in 2

The above will reload the router in 2 minutes from now. Very useful as we will see in the special case below.

CiscoRouter# show reload

The above shows the current state of the reload command. If you have scheduled a reload operation after some time from now, the above command will show the exact time when the device will reboot.

CiscoRouter# reload cancel

The above will abort any scheduled reload operation.

Also see All about the Cisco Reload Command – How to Schedule a Cisco Reload

vostbur
  • 243
  • 2
  • 9
1

There is another way to do this. You can load a config in from flash.

So, SCP the config onto the flash of the device containing the config.

something like:

scp myfile.txt admin@myrouter:flash

myfile.txt contains the actual config:

interface vlan
 ip address x.x.x.x x.x.x.x
!
ip default-gateway x.x.x.x

Then on the switch do:

copy flash:myfile.txt running-config

This should load the contents of the file into the running config and execute both the IP address change and default gateway (even if you get cut off.)

Jonathan E
  • 54
  • 2
  • 12
0

I use the "reload in x" command as a fail safe rather than a way to implement my changes. The reason for that is that if anything goes wrong I want the switch to reboot and restore the old configuration that worked. This is very important for remote configuration.

The question then becomes, how to change the IP and gateway on the fly?

The best way is to make use of the topology around you. You will need to ensure that there is a neighbouring switch or router in the new subnet.

The trick is to set the "reload in 5" (or whatever your desired time period to make the changes below) first. Then change the IP. note: You will lose connectivity once you press enter on the "IP address" command , but all configured well, you will be able to connect to your neighbor device then hop over to the new address on the target switch.

Once you've reconnected via the new address, update the default gateway and try to reconnect remotely (i.e. not via the neighbor). If it all works you can save your config and cancel the reload "reload cancel".

If for any reason you can't reconnect at any step, wait the 5 minutes and the switch will reload and become available again via the old config.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Andres V
  • 19
  • 4