How do I rewrite startup-config on a Cisco 1602 router without affecting the running-config? Outgoing connections from the router (scp, http) are not allowed. I'm not connected to the serial port, that excludes xmodem and ymodem. Ideally, I want to cut and paste a file from my local system in a way similar to "config terminal". But it's OK to create a temporary file on the router.
Here's my solution that worked perfectly on a Cisco 800-series router. Without resorting to silly blue serial cables or external TFTP servers.
The secret sauce here is the built-in tcl scripting language in Cisco IOS. This allows you to stuff all the commands in one go and configure the interfaces as you please. The
reload in 10 is just a safety net.
enable reload in 10 tclsh ios_config "int vlan1" "ip address 10.1.1.1 255.255.255.0" "int fa4" "ip address 192.168.20.72 255.255.255.0" "end"
This will indeed cut off your live connection to the router, but the new interface changes are all in effect and there's no need to reboot the router even. I simply walked over to the router, swapped the ethernet cable from the LAN port to the WAN port and voila, this time I was able to connect to the Cisco over the WAN port.
After confirming that everything was looking good, I did a final
..and the new configuration is permanently stored as the new startup-config.
Original answer here: cisco config delayed apply?