Viewing the Configuration
The show configuration mode command displays the current configuration for a device running Junos OS. For more information on how to display the information about the configuration, see the following topics:
Displaying the Current Junos OS Configuration
To display the current configuration for a device running Junos OS, use the show configuration mode command. This command displays the configuration at the current hierarchy level or at the specified level.
The configuration statements appear in a fixed order, interfaces appear alphabetically by type, and then in numerical order by slot number, PIC number, and port number. Note that when you configure the router, you can enter statements in any order.
You also can use the CLI operational mode show configuration command to display the last committed current configuration, which is the configuration currently running on the router:
When you show a configuration, a timestamp at the top of the configuration indicates when the configuration was last changed:
If you have omitted a required statement at a particular hierarchy level, when you issue the show command in configuration mode, a message indicates which statement is missing. As long as a mandatory statement is missing, the CLI continues to display this message each time you issue a show command. For example:
When you issue the show configuration command with the | display set pipe option to view the configuration as set commands, those portions of the configuration that you do not have permissions to view are substituted with the text ACCESS-DENIED.
Unsupported statements included in the CLI configuration are displayed with the “unsupported” text in the configuration. For example, if a statement is configured on an unsupported platform, the CLI displays a message that the statement is ignored in the configuration because it is configured on an unsupported platform. When you issue the show command with the | display xml option, you can see the unsupported="unsupported” attribute for configuration that is unsupported.
The “unsupported” attribute included in text configuration or XML configuration is provided to scripts when the unsupported="unsupported" attribute is included in the <get-configuration> RPC call.
Example: Displaying the Current Junos OS Configuration
The following example shows how you can display the current Junos configuration.
Set a configuration:
To display the current configuration:
Display a particular hierarchy in the configuration:
Move down a level and display the configuration at that level:
Set and commit a configuration:
Display the last committed configuration:
Displaying Additional Information About the Junos OS Configuration
In configuration mode only, to display additional information about the configuration, use the display detail command after the pipe ( | ) in conjunction with a show command. The additional information includes the help string that explains each configuration statement and the permission bits required to add and modify the configuration statement.
Displaying set Commands from the Junos OS Configuration
In configuration mode, you can display the configuration as a series of configuration mode commands required to re-create the configuration. This is useful if you are not familiar with how to use configuration mode commands or if you want to cut, paste, and edit the displayed configuration.
To display the configuration as a series of configuration mode commands, which are required to re-create the configuration from the top level of the hierarchy as set commands, issue the show configuration mode command with the display set option:
This topic contains the following examples:
Example: Displaying set Commands from the Configuration
Display the set commands from the configuration at the [edit interfaces] hierarchy level:
To display the configuration as a series of configuration mode commands required to re-create the configuration from the current hierarchy level, issue the show configuration mode command with the display set relative option:
Example: Displaying Required set Commands at the Current Hierarchy Level
Display the configuration as a series of configuration mode commands required to re-create the configuration from the current hierarchy level:
To display the configuration as set commands and search for text matching a regular expression by filtering output, specify the match option after the pipe ( | ):
Example: Displaying set Commands with the match Option
Display IP addresses associated with an interface: