cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
11940
Views
2
Helpful
5
Replies

Edit configuration file saved in router/switch flash? (IOS)

EvaldasOu
Level 4
Level 4

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?

5 Replies 5

Marvin Rhoads
Hall of Fame
Hall of Fame

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"),

ivan.arizmendi
Level 1
Level 1

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.

In all IOSs?  If so, also routers and switches, etc.?

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.

Joseph W. Doherty
Hall of Fame
Hall of Fame

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.)

Review Cisco Networking for a $25 gift card