01-22-2013 08:22 AM
Hi guys,
I hope it is possible to edit configuration file if we have it in our switch/router flash memory?
Something like "nano" or "vim" on unix? Maybe you know any hidden commands to do this?
01-22-2013 12:24 PM
Cisco routers and switches store (at least) both the startup and running configurations in memory. You edit the running configuration using Cisco's built-in command line interface when you change from EXEC (enable) mode to config mode. There is no built-in Unix type editor. The commands available in config mode vary according to the platform and OS image you have loaded. There are literally thousands of pages of command references out there explaining them all.
When you complete your configuration tasks and drop back into EXEC level, you normally synchronize the running and startup configurations ("copy runnning-config startup-config" or simply "copy r s"),
05-17-2023 02:27 AM
Nowadays there is a way:
enable "guestshell" mode
router# guestshell enable
access it: router# guestshell
now you're in a "linux" subsystem, change to /bootflash directory:
[guestshell@guestshell ~] cd /bootflash
now you can use vi, nano, etc.. to edit files there, like python .py files for example. You'll see them also in the cisco prompt of course.
For cisco configuration, as Marvin Rhoads said, better to use Cisco OS commands directly.
05-17-2023 03:42 PM
In all IOSs? If so, also routers and switches, etc.?
05-17-2023 03:52 PM
Introducing Python and Guest Shell on IOS-XE 16.5 - Cisco Community
"[...]on April 13th IOS-XE 16.5 “Everest” posted to https://cisco.com/go/software for the ISR, ASR, and CSR routing platforms (still to come are the Catalyst Switching lines)."
That's from 2017, so now several switches already support it too, it's really useful for automation stuff.
05-17-2023 03:46 PM
BTW, personally, never had the need, because if I wanted to do extensive editing, I would pull a copy of the config (startup or running) to my PC and edit a copy then push it back. (Usually I would have my PC with both a tftp and FTP servers installed on it.)
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