Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    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:

    user@host# show | display set

    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:

    [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 setset interfaces fe-0/0/0 unit 0 family inet address 192.107.1.230/24set interfaces fe-0/0/0 unit 0 family isoset interfaces fe-0/0/0 unit 0 family mplsset interfaces fe-0/0/0 unit 1 family inet address 10.0.0.1/8deactivate 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

    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:

    [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 relativeset 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

    Example: Displaying set Commands with the match Option

    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 addressset interfaces xe-2/3/0 unit 0 family inet address 192.168.9.106/30set interfaces so-5/1/0 unit 0 family inet address 192.168.9.15/32 destination 192.168.9.192set interfaces lo0 unit 0 family inet address 127.0.0.1/32

    Modified: 2017-04-13