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. For information about the set command, see Displaying the Current Configuration.
To display the configuration as a series of configuration mode commands 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:
- user@host# show | display set
This topic contains the following examples:
Display the set commands from the configuration at the [edit interfaces] hierarchy level:
- [edit interfaces fe-0/0/0]
- user@host# show
- unit 0 {
-
- family inet {
- address 192.107.1.230/24;
- }
- family iso;
- family mpls;
- }
- inactive: unit 1 {
-
- family inet {
- address 10.0.0.1/8;
- }
- }
- user@host# show | display set
- set interfaces fe-0/0/0 unit 0 family inet address 192.107.1.230/24
- set interfaces fe-0/0/0 unit 0 family iso
- set interfaces fe-0/0/0 unit 0 family mpls
- set interfaces fe-0/0/0 unit 1 family inet address 10.0.0.1/8
- deactivate interfaces fe-0/0/0 unit 1
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:
- user@host# show | display set relative
Display the configuration as a series of configuration mode commands required to re-create the configuration from the current hierarchy level:
- [edit interfaces fe-0/0/0]
- user@host# show
- unit 0 {
-
- family inet {
- address 192.107.1.230/24;
- }
- family iso;
- family mpls;
- }
- inactive: unit 1 {
-
- family inet {
- address 10.0.0.1/8;
- }
- }
- user@host# show | display set relative
- set unit 0 family inet address 192.107.1.230/24
- set unit 0 family iso
- set unit 0 family mpls
- set unit 1 family inet address 10.0.0.1/8
- deactivate unit 1
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:
- user@host# show | display set | match regular-expression
Display IP addresses associated with an interface:
- xe-2/3/0 {
-
- unit 0 {
-
- family inet {
- address 192.107.9.106/30;
- }
- }
- }
- so-5/1/0 {
-
- unit 0 {
-
- family inet {
-
- address 192.107.9.15/32 {
- destination 192.107.9.192;
- }
- }
- }
- }
- lo0 {
-
- unit 0 {
-
- family inet {
- address 127.0.0.1/32;
- }
- }
- }
- user@host# show interfaces | display set |
match address
- set interfaces xe-2/3/0 unit 0 family inet address 192.168.9.106/30
- set interfaces so-5/1/0 unit 0 family inet address 192.168.9.15/32
destination 192.168.9.192
- set interfaces lo0 unit 0 family inet address 127.0.0.1/32