show running-config
Shows the configuration the device is running right now, including changes that have not been saved.
Written by a working field network engineer · CCNA, Security+, CySA+
The configuration in RAM: everything the device is doing right now, including changes made since the last save. It is the source of truth when output from other commands does not make sense.
Example output
R2#show running-config
Building configuration...
Current configuration : 1275 bytes
!
version 15.7
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
interface GigabitEthernet0/0
ip address 192.168.20.1 255.255.255.0
duplex auto
speed auto
!
interface GigabitEthernet0/1
ip address 10.0.12.2 255.255.255.252
duplex auto
speed auto
!
interface GigabitEthernet0/2
no ip address
shutdown
duplex auto
speed auto
!
router ospf 1
router-id 2.2.2.2
network 10.0.12.0 0.0.0.3 area 0
network 192.168.20.0 0.0.0.255 area 0
!
ip route 172.16.0.0 255.255.0.0 10.0.12.1
!
line con 0
line vty 0 4
login
!
endReference output: hand-written in standard Cisco IOS format for this example network, not captured from a device. Shortened, as on the startup-config page: lines IOS adds by default (boot markers, ip forward-protocol nd, no ip http server and similar) are left out. The ip route line is the change not yet saved to startup-config.
Useful variants
sh runshow running-config interface GigabitEthernet0/1show running-config | section router ospfshow running-config | include ip route
What each column or field means
| Field | Meaning |
|---|---|
Building configuration... / Current configuration : N bytes | IOS assembling the configuration, and its size. |
hostname | The device name, also used in the prompt and in the RSA key name. |
interface blocks | Each interface’s settings: address and features applied to it. An interface you shut shows shutdown; an enabled one shows nothing, because IOS never prints no shutdown. An interface with no address shows no ip address. |
router ospf / ip route | Routing configuration. IOS puts commands in its own order, not the order you typed them: router-id comes before the network statements, for example. |
! | A separator between sections; it has no effect. |
When it doesn’t look right
Changes disappear after a reload.
They were never saved. Run copy running-config startup-config (or write memory) after every change you want to keep.
The output is hundreds of lines long.
Filter it: | section <word> shows a whole block, | include <word> shows matching lines, | begin <word> starts at the first match.
A password appears in clear text.
Use enable secret and username … secret (hashed) rather than password, and add service password-encryption for the remaining type 7 passwords.
Related commands
Try it yourself
- Switch Management VLAN (free)
- Configure an Entire Floor (Router + Switch) (free)
- Deploy Active Gateway & Access Switch (Pro)
Learn it in the CCNA path
- Cisco CLI Commands Sheet (2. Network Access)
- Describe ports and read one interface's configuration (2. Network Access)
Topic
Device Management — Read the configuration and software version, save changes, discover neighbors with CDP and LLDP, and check logging and time.