Show Configuration
View the configuration files with the show
command, followed by filename.
For example, to view the running configuration, enter: show running-config
- running-config is the file in RAM with the active configuration.
- startup-config is the file in NVRAM which is loaded at power on.
To retain the running configuration after a power cycle, copy it from RAM to NVRAM.
Use the copy
command, followed by the source and destination (from/to) filenames:
eg: copy running-config startup-config
Commands:
Commonly used show commands.
Command | Description |
---|---|
show running-config | Displays the running configuration. You can also use filters, eg: show running-config interface GigabitEthernet0/1 to display only the interface GigabitEthernet0/1 running configuration. |
show startup-config | Displays the startup configuration stored in NVRAM. |
configure terminal | Enters the Global Configuration Mode, in order to change the the currently running-config (stored in RAM). |
copy running-config startup-config | Saves the running configuration to startup-config file in NVRAM. |
copy startup-config running-config | Startup configuration from NVRAM is merged into the running configuration. |
copy running-config tftp | Copies the running configuration (in RAM) to a TFTP server, prompts for TFTP server IP address. |
erase startup-config | Deletes the saved startup-config file in NVRAM. |
reload | Reboot the switch. The running configuration is lost, and startup configuration is loaded at restart. |
Filters:
Use filtering to display only specific parts of show outputs.
Filter | Description |
---|---|
begin | Shows all output lines, starting with the line that matches the filtering expression |
exclude | Excludes all output lines that match the filtering expression |
include | Includes all output lines that match the filtering expression |
section | Shows the entire section that starts with the filtering expression |
Paging:
When you execute the show running-config (show run) command, the output is paged one screen at a time. If you want to paste the output into a text editor, this may be impractical.
The default screen length is 24 lines, which can be verified with:show terminal
.
To disable paging mode, enter:terminal length 0
(term len 0). To restore normal paging mode, enter:term no len 0
or term len 24
.
Examples:
Filter outputs by using the pipe (|) character after show.
➤ Show config with begin option:
R1# show running-config | begin interface interface Loopback0 ip address 10.10.10.1 255.255.255.0 ! interface Ethernet0/0 description Link to SW2 ip address 10.10.11.1 255.255.255.0 ! interface Ethernet0/1 no ip address shutdown !
➤ To focus on a config section:
R1# show running-config | section interface interface Loopback0 ip address 10.10.10.1 255.255.255.0 interface Ethernet0/0 description Link to SW2 ip address 10.10.11.1 255.255.255.0 interface Ethernet0/1 no ip address shutdown interface Ethernet0/2 no ip address shutdown
➤ Output with the include option:
R1# show running-config | include interface interface Loopback0 interface Ethernet0/0 interface Ethernet0/1 interface Ethernet0/2 interface Ethernet0/3 interface Serial1/0 interface Serial1/1 interface Serial1/2 interface Serial1/3
➤ To exclude lines starting with ! (comments):
R1# show running-config | exclude ! Building configuration... Current configuration : 1223 bytes version 15.2 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption hostname R1 boot-start-marker