cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5782
Views
0
Helpful
22
Replies

Boot from startup-config only if TFTP fails?

brianjmurrell
Level 1
Level 1

I was successfully booting my 3750 switch from DHCP and TFTP.  I discovered that during a power outage though that the TFTP server can race with the switch and the switch might come up before the TFTP server and not have a valid configuration as a result.  So I did a:

#copy running-config startup-config

to provide a local configuration the switch should fall-back to if the TFTP boot fails.

 

But it seems now that the switch won't even try a TFTP boot.

 

Is there any way to achieve the above?  First attempt a TFTP boot, and only if that fails, fall-back to the startup-config?

 

22 Replies 22

balaji.bandi
Hall of Fame
Hall of Fame
Is there any way to achieve the above?  First attempt a TFTP boot, and only if that fails, fall-back to the startup-config?

Not that i am aware this is possible.

 

coming back to your problem, since you have TFTP server access, Open the Config File on TFTP Server, use console cable and connect to switch you have an issue, paste the config and write, so same config available in the switch ?

 

Not sure what is the reason you loading config from TFTP.?

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help


@balaji.bandi wrote:
Not that i am aware this is possible.

That's a pity.

 

coming back to your problem, since you have TFTP server access, Open the Config File on TFTP Server, use console cable and connect to switch you have an issue, paste the config and write, so same config available in the switch ?

Well, it's not even that complicated.  Simply doing:

$ ssh cisco-switch 
Password: ********
cisco-switch>enable
Password: ********
cisco-switch#copy tftp://10.75.22.247/cisco-switch-confg running-config
cisco-switch#copy running-config startup-config

does the trick, but as you see it's a manual operation of a number of steps every time I want to modify the configuration.

 

Not sure what is the reason you loading config from TFTP.?

Because it's easier to modify files locally on a server than it is to log into switches, use the CLI to make configuration changes, copy running to startup, etc.  And this way I always have a copy of the current configuration without every having to have forgotten to update the copy, etc.

 

Ultimately, this is more in the spirit of the DevOps/"configuration management" way to configure things, rather than doing configurations directly that then (at some point) need to be repeated/migrated on hardware/software replacements.

 

Much thanks for your input though.

If you rely more on TFTP make sure your TFTP available all the time for the device can reach TFTP.

 

You can do automation the config to change according to with Lot of scripts what you like to change using Python, i do see you are using TFTP on Linux as per ($) prompt, so use automation for update config.

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help


@balaji.bandi wrote:

If you rely more on TFTP make sure your TFTP available all the time for the device can reach TFTP.

Please re-read the original problem description. Of course the obvious solution is to have the TFTP server available when the switch boots. But in the case of a power outage (this is not a DC with generators, etc. and even UPSes have a finite lifetime) that is not always possible.

my 3750 switch from DHCP and TFTP.

since you looking to get DHCP and TFTP Server for the config, then we need to consider it as a risk in case of you mentioned scenarios.

 

Do the steps as you did to fix the issue. or make automation for the config change, keeping the config on the device is the best option i can think of.

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Leo Laohoo
Hall of Fame
Hall of Fame

@brianjmurrell wrote:

First attempt a TFTP boot, and only if that fails, fall-back to the startup-config?


Wait, this is not making any sense. 

Why is the switch booting up with ZERO config?


@Leo Laohoo wrote:

Wait, this is not making any sense. 

Why is the switch booting up with ZERO config?


Because it appears to be the only way to force it to boot from TFTP.  As I described, it would be better to have a startup-config but only fall-back to that if the TFTP boot fails.  Ultimately, I want to control/store switch configs on a server where editing the config is simple and not having to mess around with configuration UIs.

Post the complete output to the command "sh boot".


@Leo Laohoo wrote:

Post the complete output to the command "sh boot".


cisco-switch#show boot 
BOOT path-list      : flash:c3750-ipbase-mz.122-35.SE5/c3750-ipbase-mz.122-35.SE5.bin
Config file         : flash:/config.text
Private Config file : flash:/private-config.text
Enable Break        : no
Manual Boot         : no
HELPER path-list    : 
Auto upgrade        : yes
Auto upgrade path   : 
NVRAM/Config file
      buffer size:   524288
Timeout for Config
          Download:    0 seconds
Config Download 
       via DHCP:       disabled (next boot: disabled)


@brianjmurrell wrote:


Config file         : flash:/config.text

The output shows the config file for the switch is stored in the flash.  

The only time the switch boots up without a config is when someone deliberately erasing the config file before the reboot. 

Only Catalyst 4k and 6k and routers will allow multiple boot variable string.  Catalyst 2k and 3k does not offer this feature.  

NOTE:  In my entire working career with Cisco, I have never seen an appliance, with classic IOS, boot up without any config "all of the sudden".


@Leo Laohoo wrote:


The output shows the config file for the switch is stored in the flash.  

Correct. Which causes the switch not to use the TFTP server that the DHCP server told it to use.

 

The only time the switch boots up without a config is when someone deliberately erasing the config file before the reboot. 

Or never saves one to startup-config because one really wants the switch to boot from the TFTP server that the DHCP server instructed. But it would be nice to also have a startup-config as a fallback in case the TFTP server is unavailable.

 

I have never seen an appliance, with classic IOS, boot up without any config "all of the sudden".

There is no all of a suddenness about it. It was done that way to force a boot from TFTP. But not having a startup-config to fallback to if/when TFTP is unavailable is undesirable. It would even be more desirable if the switch would simply continue to try to boot from DHCP/TFTP, endlessly, if it fails at first.

 

In any case, clearly I have different ideas about network (all devices more generally) management than most.  I do appreciate all of the replies though.

More interested to see what is the config stored in the device and TFTP compare?

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help


@balaji.bandi wrote:

More interested to see what is the config stored in the device and TFTP compare?


Not quite sure I am parsing your question correctly.  Are you asking if the config on the TFTP server and the config on the device (in running-config, or startup-config?) the same?

 

Ultimately, all three are the same, although because there is a startup-config unfortunately, the TFTP config is being ignored. 

If all same, Switch need to boot as expected from Local config right, why it is looking for TFTP for config ?

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help