CCNA 200-301

CCNP Enterprise

CCNP Security

CCIE Enterprise Lab

CCIE Security Lab

CCNP Service Provider

CCNP Data Center

CCNP Collaboration

CCIE DC Lab

Inspecting the active configuration on a Cisco router is one of the most fundamental tasks in network administration and troubleshooting. Whether you are auditing routing protocols, verifying access control lists, or confirming interface IP assignments before committing changes, knowing how to view, filter, and manage the router’s configuration file through the Cisco IOS Command Line Interface (CLI) ensures you always have an accurate picture of how the device is currently operating.

Understanding Running Configuration vs. Startup Configuration

Before inspecting configuration files on a Cisco router, it is essential to distinguish between the two primary configuration states maintained by Cisco IOS: the active configuration in volatile memory and the saved configuration stored for bootup.

Feature / CriterionRunning Configuration (running-config)Startup Configuration (startup-config)
Storage LocationRAM (DRAM)NVRAM (Non-Volatile RAM)
VolatilityVolatile; lost immediately upon power loss or reload if unsavedNon-volatile; persists across reboots and power cycles
System RoleGoverns the active, real-time operation of the routerLoaded into RAM during bootup to initialize the router
How Changes ApplyUpdated immediately as commands are entered in configuration modesUpdated only when explicitly copied from running-config or an external source
CLI Inspection Commandshow running-configshow startup-config
File System Pathsystem:running-confignvram:startup-config

When troubleshooting or preparing for a maintenance window, you may need to verify whether real-time adjustments in RAM have drifted from the saved file in NVRAM. Rather than visually comparing hundreds of lines of output, run the following contextual diff command in Privileged EXEC mode:

Router# show archive config differences nvram:startup-config system:running-config

In the output, lines prefixed with a plus sign (+) indicate commands present in running-config that have not yet been saved to startup-config, while lines prefixed with a minus sign (-) indicate commands present in startup-config that were removed from the active session. Understanding this distinction sets the foundation for accessing and inspecting the live configuration safely.

Step-by-Step Guide to Viewing the Running Configuration

Because the active configuration contains sensitive operational parameters, routing topology details, and password hashes, Cisco IOS restricts access to elevated CLI modes. Follow these sequential steps to display the full running configuration.

  1. Connect to the Router CLI
    Establish a session with the Cisco router via a physical console cable, SSH, or Telnet. Upon initial login, your session starts in User EXEC mode, identifiable by the > prompt:
    ios
    Router>

  2. Enter Privileged EXEC Mode
    Type enable (or en) and enter the enable secret or password when prompted. The prompt changes to #, confirming you are in Privileged EXEC mode:
    ios
    Router> enable
    Password:
    Router#

  3. Execute the Show Running-Config Command
    Run show running-config (commonly abbreviated as sh run) to output the active configuration from RAM:
    “`ios
    Router# show running-config
    Building configuration…

Current configuration : 4821 bytes
!
version 15.7
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname Router
…
``
*Tip:* If you are actively making changes inside Global Configuration mode (
Router(config)#) or a sub-configuration mode, prepend the command withdo(do show running-config`) so you do not have to exit back to Privileged EXEC mode.

  1. Navigate Paginated Output
    By default, Cisco IOS pauses output after 24 lines and displays a --More-- prompt at the bottom of the screen:
  2. Press Enter to advance one line at a time.
  3. Press the Spacebar to advance one full screen at a time.
  4. Press q (or any other key) to abort the output and return to the # prompt.
  5. To print the entire configuration continuously without breaks for the duration of your current terminal session, run terminal length 0 prior to executing show running-config.

While displaying the complete configuration works well on lab routers with minimal settings, production routers often contain thousands of lines of configuration, making manual scrolling inefficient.

Filtering Running Configuration Output by Interface or Section

To inspect specific interfaces, routing protocols, or access lists without parsing the entire file, combine show running-config with native target arguments or regular expression pipe (|) modifiers. Use the templates below by replacing the bracketed placeholders with your target parameters:

! 1. View configuration for a single physical, sub-, or virtual interface
Router# show running-config interface <interface-type> <interface-number>
! Example:
Router# show running-config interface GigabitEthernet0/0

! 2. View an entire hierarchical block (e.g., OSPF, BGP, VTY lines, or ACLs)
Router# show running-config | section <search-pattern>
! Example:
Router# show running-config | section router ospf

! 3. Filter for every standalone line matching a specific keyword or IP address
Router# show running-config | include <regular-expression>
! Example (case-insensitive search using (?i) or multiple terms using |):
Router# show running-config | include ip route|ip address

! 4. Display the configuration starting from the first match to the end of the file
Router# show running-config | begin <search-pattern>
! Example:
Router# show running-config | begin line vty

! 5. Omit specific lines from the output
Router# show running-config | exclude <regular-expression>
! Example:
Router# show running-config | exclude !

Beyond basic pipe filtering, Cisco IOS and IOS XE provide several specialized command flags for deeper diagnostics and administrative auditing.

Cisco IOS show running-config Command Reference

The following reference specification details the formal syntax, flags, and operational behavior defined in the Cisco IOS Configuration Fundamentals Command Reference.

Command Syntax

show running-config [all | brief | full | interface type number | linenum | map-class | policy-map | partition partition-name | view full]

Syntax Description

  • all — Displays the complete running configuration, explicitly including all hidden default platform values alongside user-configured commands.
  • brief — Displays the running configuration without PKI certificate data, reducing clutter on routers configured with large crypto trustpoints or DMVPN/IPsec certificates.
  • full — Displays the full configuration on platforms that default to abridged output optimizations.
  • interface type number — Restricts output solely to the specified interface configuration sub-block.
  • linenum — Inserts a sequential line number at the start of every line in the configuration output, aiding peer review and line-by-line change tracking.
  • map-class — Displays only the map-class configuration parameters.
  • policy-map — Displays only QoS policy-map definitions stored in the active configuration.
  • view full — Used in Role-Based CLI Access (RBAC) environments to display all commands accessible across merged parser views, or by a root view user (#) to inspect the unrestricted configuration.

Command Modes and Defaults

  • Command Mode: Privileged EXEC (#)
  • Default Privilege Level: Level 15
  • Behavior Usage Guidelines: Unlike reading static text files from flash or NVRAM, executing show running-config triggers the router CPU to dynamically poll active system memory (system:running-config) and build the text output on the fly (indicated by the Building configuration... message). On heavily loaded routers with large configurations and all specified, this process can momentarily increase CPU utilization.

Even when using the exact syntax from the official command reference, administrators occasionally encounter CLI errors or access restrictions that block the command from running.

Troubleshooting Invalid Input and Permission Denied Errors

If show running-config fails to execute or returns an error message, use the following troubleshooting solutions to resolve the underlying mode or authorization issue.

Why do I get % Invalid input detected at '^' marker when running show running-config?

This error occurs for one of two reasons:
1. You are in User EXEC mode (Router>): The running-config keyword is not registered in the User EXEC command parser. Run enable first to enter Privileged EXEC mode (Router#).
2. You are in Global Configuration mode (Router(config)#): Configuration modes do not natively accept show commands directly. Either prefix the command with do (do show running-config) or press Ctrl+Z to return to Privileged EXEC mode.

Why is show running-config unavailable or blank even when my prompt shows #?

Having a # prompt only indicates you are at a privilege level greater than 1 (levels 2 through 15 all display #). By default, show running-config requires Privilege Level 15. Check your current session level by running:

Router# show privilege
Current privilege level is 5

If your level is below 15, authenticate to full privileges using enable 15 (if you have the level-15 secret) or ask an administrator to either elevate your user account (username <name> privilege 15 secret <password>) or grant specific command access using Role-Based CLI parser views.

Why does the CLI return Command authorization failed?

This message indicates that the router is enforcing AAA command authorization via a TACACS+ or RADIUS server (such as Cisco ISE), and your user profile is not permitted to run show running-config. Depending on the AAA policy configured by your security team:
– Try running show configuration (which reads startup-config from NVRAM and is sometimes permitted for read-only operators when show running-config is blocked).
– If RBAC parser views are enabled, run show parser view to verify which view you are currently assigned to, as your view may only permit specific sub-options such as show running-config interface.

Once you have accessed and verified that the active configuration is functioning as intended, the final step is preserving those changes so they survive a device reload or hardware failure.

How to Save or Export the Running Configuration

Because the running configuration resides solely in volatile RAM (as covered in the comparison table above), any verified changes must be written to NVRAM and backed up externally to prevent data loss.

  1. Save the Running Configuration to NVRAM (startup-config)
    In Privileged EXEC mode, copy the active configuration into NVRAM using the copy command and press Enter to confirm the default destination filename:
    ios
    Router# copy running-config startup-config
    Destination filename [startup-config]?
    Building configuration...
    [OK]

    (Note: The legacy shorthand command write memory or wr performs the same action on most Cisco IOS and IOS XE platforms.)

  2. Export the Running Configuration to a Network Server (SCP, TFTP, or FTP)
    To create an off-box backup on a configuration management server, specify the transfer protocol as the destination and follow the interactive prompts:
    “`ios
    ! Export securely via SCP (Recommended)
    Router# copy running-config scp:
    Address or name of remote host []? 192.168.1.50
    Destination username [Router]? netadmin
    Destination filename [router-confg]? rtr-core01-running.cfg
    Writing rtr-core01-running.cfg
    Password:
    !
    4821 bytes copied in 1.412 secs (3414 bytes/sec)

! Export via TFTP (Unencrypted)
Router# copy running-config tftp:
“`

  1. Save a Local Copy to Flash or USB Storage
    Before performing risky maintenance, you can save a snapshot directly to the router’s internal flash memory or an attached USB drive for rapid rollback via configure replace:
    ios
    Router# copy running-config flash:backup-pre-change.cfg

  2. Capture Output Directly to a Local Text File via Terminal Logging
    If file transfers are blocked by firewalls between your workstation and the router, export the configuration directly through your terminal emulator (such as PuTTY, SecureCRT, or macOS/Linux Terminal):

  3. Disable pagination on the router: Router# terminal length 0
  4. Enable session logging to a local .txt or .cfg file in your terminal application settings.
  5. Execute Router# show running-config.
  6. Disable session logging once the output finishes and restore default pagination with Router# terminal length 24.

Conclusion

Checking the running configuration on a Cisco router goes beyond simply running show running-config in Privileged EXEC mode. By combining output modifiers like section and include to isolate target configurations, verifying unsaved changes against startup-config, understanding privilege level requirements, and consistently backing up verified changes to NVRAM and external storage, you can inspect and manage Cisco IOS configurations with speed and confidence.

Please follow and like us:
Last modified: November 17, 2026

Author

Comments

Write a Reply or Comment

Your email address will not be published.