07-14-2021 12:35 PM
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?
07-14-2021 12:52 PM
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.?
07-14-2021 02:40 PM
@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.
07-14-2021 03:15 PM
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.
07-14-2021 03:50 PM
@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.
07-15-2021 12:18 AM
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.
07-14-2021 03:46 PM
@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?
07-14-2021 03:59 PM
@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.
07-14-2021 05:00 PM
Post the complete output to the command "sh boot".
07-15-2021 06:38 AM
@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)
07-15-2021 03:44 PM
@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".
07-16-2021 08:57 AM
@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.
07-16-2021 01:14 AM
More interested to see what is the config stored in the device and TFTP compare?
07-16-2021 08:46 AM
@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.
07-16-2021 10:15 AM
If all same, Switch need to boot as expected from Local config right, why it is looking for TFTP for config ?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide