Sunday, October 31, 2010

Have Multiple Users Configure the Software

Up to 32 users can be in configuration mode simultaneously, and they all can be making changes to the configuration. All changes made by all users are visible to everyone editing the configuration—the changes become visible as soon as the user presses the Enter key at the end of a command that changes the configuration, such as set, edit, or delete.
When any of the users editing the configuration issues a commit command, all changes made by all users are checked and activated.

Saturday, October 30, 2010

Add Comments in a Configuration

You can include comments in a configuration to describe any statement in the configuration. You can add commands interactively in the CLI and by editing the ASCII configuration file.
When you add comments in configuration mode, they are associated with a statement at the current level. Each statement can have one single-line comment associated with it. Before you can associate a comment with a statement, the statement must exist. The comment is placed on the line preceding the statement.
To add comments to a configuration, use the annotate configuration mode command:
annotate statement "comment-string" 

statement is the configuration statement to which you are attaching the comment; it must be at the current hierarchy level. If a comment for the specified statement already exists, it is deleted and replaced with the new comment.
comment-string is the text of the comment. The comment text can be any length, and you must type it on a single line. If the comment contains spaces, you must enclose it in quotation marks. In the comment string, you can include the comment delimiters /* */ or #. If you do not specify any, the comment string is enclosed with the /* */ comment delimiters.
To delete an existing comment, specify an empty comment string:
annotate statement "" 

When you edit the ASCII configuration file and add comments, they can be one or more lines and must precede the statement they are associated with. If you place the comments in other places in the file, such as on the same line following a statement or on a separate line following a statement, they are removed when you use the load command to open the configuration into the CLI.
When you include comments in the configuration file directly, you can format comments in the following ways:
  • Start the comment with a /* and end it with a */. The comment text can be on a single line or can span multiple lines.
  • Start the comment with a # and end it with a new line (carriage return).
If you add comments with the annotate command, you can view the comments within the configuration by entering the show configuration mode command or the show configuration operational mode command.
When configuring interfaces, you can add comments about the interface by including the description statement at the [edit interfaces interface-name] hierarchy level. Any comments you include appear in the output of the show interfaces commands. For more information about the description statement, see the JUNOS Internet Software Configuration Guide: Interfaces and Class of Service.

Examples: Include Comments in Configurations

Add comments to a configuration:
[edit]
user@host# show
protocols {
    ospf {
        area 0.0.0.0 {
            interface so-0/0/0 {
                hello-interval 5;
            }
        }
    }
}
[edit]
user@host# edit protocols ospf 
[edit protocols ospf]
user@host# set area 0.0.0.0 
user@host# annotate area 0.0.0.0 "Backbone area configuration added June 15, 1998" 
[edit protocols ospf]
user@host# edit area 0.0.0.0
[edit protocols ospf area 0.0.0.0]
user@host# annotate interface so0 "Interface from router sj1 to router sj2"
[edit protocols ospf area 0.0.0.0]
user@host# top
[edit]
user@host# show 
protocols {
    ospf {
        /* Backbone area configuration added June 15, 1998 */
        area 0.0.0.0 {
            /* Interface from router sj1 to router sj2 */
            interface so-0/0/0 {
                hello-interval 5;
            }
        }
    }
}
[edit]
user@host# 

The following excerpt from a configuration example illustrates how to enter comments in a configuration file:
/* This comment goes with routing-options */
routing-options {
    /* This comment goes with routing-options traceoptions */
    traceoptions {
        /* This comment goes with routing-options traceoptions tracefile */
        tracefile rpd size 1m files 10;
        /* This comment goes with routing-options traceoptions traceflag task */
        traceflag task;
        /* This comment goes with routing-options traceoptions traceflag general */
        traceflag general;
        }
    autonomous-system 10458;    /* This comment is dropped */ 
}
routing-options {
    rib-groups {
        ifrg {
            import-rib [ inet.0 inet.2 ];
            /* A comment here is dropped */
        }
        dvmrp-rib {
            import-rib inet.2;
            export-rib inet.2;
            /* A comment here is dropped */
        }
    /* A comment here is dropped */
    }
/* A comment here is dropped */
} 

Friday, October 29, 2010

Deactivate and Reactivate Statements and Identifiers in a Configuration

In a configuration, you can deactivate statements and identifiers so that they do not take effect when you issue the commit command. Any deactivated statements and identifiers are marked with the inactive: tag. They remain in the configuration, but are not activated when you issue a commit command.
To deactivate a statement or identifier, use the deactivate configuration mode command:
deactivate (statement | identifier) 

To reactivate a statement or identifier, use the activate configuration mode command:
activate (statement | identifier) 

In both commands, the statement or identifier you specify must be at the current hierarchy level.
In some portions of the configuration hierarchy, you can include a disable statement to disable functionality. One example is disabling an interface by including the disable statement at the [edit interface interface-name] hierarchy level. When you deactivate a statement, that specific object or property is completely ignored and is not applied at all when you issue a commit command. When you disable a functionality, it is activated when you issue a commit command but is treated as though it is down or administratively disabled.

Examples: Deactivate and Reactivate Statements and
Identifiers in a Configuration

Deactivate an interface in the configuration:
[edit interfaces]
user@host# show 
at-5/2/0 {
    traceoptions {
        traceflag all;
    }
    atm-options {
        vpi 0 maximum-vcs 256;
    }
    unit 0 {
...
[edit interfaces]
user@host# deactivate at-5/2/0
[edit interfaces]
user@host# show
inactive: at-5/2/0 {
    traceoptions {
        traceflag all;
    }
...

Reactivate the interface:
[edit interfaces]
user@host# activate at-5/2/0
[edit interfaces]
user@host# show
at-5/2/0 {
    traceoptions {
        traceflag all;
    }
...

Thursday, October 28, 2010

Configuration Mode Error Messages

If you do not type an option for a statement that requires one, a message indicates the type of information expected.
In this example, you need to type an area number to complete the command:
[edit]
user@host# set protocols ospf area
                                ^
syntax error, expecting .

In this example, you need to type a value for the hello interval to complete the command:
[edit]
user@host#  set protocols ospf area 45 interface so-0/0/0     
                  hello-interval
                                             ^
syntax error, expecting 

If you have omitted a required statement at a particular hierarchy level, when you attempt to move from that hierarchy level or when you issue the show command in configuration mode, a message indicates which statement is missing. For example:
[edit protocols pim interface so-0/0/0]
user@host# top
Warning: missing mandatory statement: 'mode'
[edit]
user@host# show
protocols {
    pim {
        interface so-0/0/0 {
            priority 4;
            version 2;
            # Warning: missing mandatory statement(s): 'mode'
        }
    }
}

Wednesday, October 27, 2010

Return to a Previously Committed Configuration

To return to the most recently committed configuration and load it into configuration mode without activating it, use the rollback configuration mode command:
[edit]
user@host# rollback 
load complete

To activate the configuration that you loaded, use the commit command:
[edit]
user@host# rollback
load complete
[edit]
user@host# commit

To return to a configuration prior to the most recently committed one, include the number in the rollback command:
[edit]
user@host# rollback number 
load complete

number can be a number in the range 0 through 9. The most recently saved configuration is number 0 (which is the default configuration to which the system returns), and the oldest saved configuration is number 9.
To display previous configurations, including rollback number, date, time, the name of the user who committed changes, and the method of commit, use the rollback ? command.
[edit]
user@host# rollback ?
Possible completions:
<[Enter]> Execute this command
 Numeric argument
0 2001-02-27 12:52:10 PST by abc via cli 
1 2001-02-26 14:47:42 PST by cde via cli 
2 2001-02-14 21:55:45 PST by fgh via cli 
3 2001-02-10 16:11:30 PST by hij via cli 
4 2001-02-10 16:02:35 PST by klm via cli 
|    Pipe through a command
[edit]

For more information about configuration versions, see .
The access privilege level for using the rollback command is controlled by the rollback permission bit. Users for whom this permission bit is not set can return only to the most recently committed configuration. Users for whom this bit is set can return to any prior committed configuration. For more information, see 

Example: Return to a Previously Committed Version of the Configuration

Return to and activate the version stored in the file juniper.conf.3:
[edit]
user@host# rollback 3
load complete
[edit]
user@host# commit

Tuesday, October 26, 2010

Load a Configuration

You can create a file, copy the file to the local router, and then load the file into the CLI. After you have loaded the file, you can commit it to activate the configuration on the router, or you can edit the configuration interactively using the CLI and commit it at a later time.
You can also create a configuration while typing at the terminal and then load it. Loading a configuration from the terminal is generally useful when you are cutting existing portions of the configuration and pasting them elsewhere in the configuration.
To load an existing configuration file that is located on the router, use the load configuration mode command:
[edit]
    user@host# load (patch | replace | merge | override) filename
To load a configuration from the terminal, use the following version of the load configuration mode command:
[edit]
user@host# load (patch | replace | merge | override) terminal  
[Type ^D to end input]

To replace an entire configuration, specify the override option at the top level of the hierarchy. An override operation discards the current candidate configuration and loads the configuration in filename or the one that you type at the terminal.
To combine the current configuration and the configuration in filename or the one that you type at the terminal, specify the merge option. A merge operation is useful when you are adding a new section to an existing configuration. If the existing configuration and the incoming configuration contain conflicting statements, the statements in the incoming configuration override those in the existing configuration.
To replace portions of a configuration, specify the replace option. For this operation to work, you must include replace: tags in the file or configuration you type at the terminal. The software searches for the replace: tags, deletes the existing statements of the same name, if any, and replaces them with the incoming configuration. If there is no existing statement of the same name, the replace operation adds to the configuration the statements marked with replace: tag.
To change part of the configuration with a patch file and mark only those parts as changed, specify the patch option.
If, in an override or merge operation, you specify a file or type text that contains replace: tags, the replace: tags are ignored, and the override or merge operation is performed.
If you are performing a replace operation and the file you specify or text you type does not contain any replace: tags, the replace operation is effectively equivalent to a merge operation. This might be useful if you are running automated scripts and cannot know in advance whether the scripts need to perform a replace or a merge operation. The scripts can use the replace operation to cover either case.
For information about specifying the filename, see How to Specify Filenames and URLs.
To copy a configuration file from another network system to the local router, you can use the ssh and telnet utilities, as described in the JUNOS Internet Software Operational Mode Command Reference.

Examples: Load a Configuration from a File

Pic. 3: Example 1: Load a Configuration from a File

 PIC 4: Example 2: Load a Configuration from a File

Add caption
PIC 5: Example 3: Load a Configuration from a File
 



Pic 6: Example 4: Load Configuration from a File

Monday, October 25, 2010

Save a Configuration to a File

You might want to save the configuration to a file so that you can edit it with a text editor of your choice. You can save your current configuration to an ASCII file, which saves the configuration in its current form, including any uncommitted changes. If more than one user is modifying the configuration, all changes made by all users are saved.
To save software configuration changes to an ASCII file, use the save configuration mode command:
[edit]
user@host# save filename 
[edit]
user@host#

By default, the configuration is saved to a file in your home directory, which is on the flash disk. For information about specifying the filename,

Sunday, October 24, 2010

f your router has two Routing Engines, you can manually direct one Routing Engine to synchronize its configuration with the other by issuing the commit synchronize command. The Routing Engine on which you execute this command (requesting Routing Engine) copies and loads its candidate configuration to the other (responding Routing Engine). Both Routing Engines then perform a syntax check on the candidate configuration file being committed. If no errors are found, the configuration is activated and becomes the current operational configuration on both Routing Engines. For example, if you are logged in to re1 (requesting Routing Engine) and you want re0 (responding Routing Engine) to have the same configuration as re1, issue the commit synchronize command on re1. re1 copies and loads its candidate configuration to re0. Both Routing Engines then perform a syntax check on the candidate configuration file being committed. If no errors are found, re1's candidate configuration is activated and becomes the current operational configuration on both Routing Engines.

Note - When you issue the commit synchronize command, you must use the apply groups re0 and re1. For information about how to use the apply groups statement, see Apply a Configuration Group.
The responding Routing Engine must use JUNOS release 5.0 or higher.

To synchronize a Routing Engine's current operational configuration file with the other, log in to the Routing Engine from which you want to synchronize and issue the commit synchronize command:
[edit]
user@host# commit synchronize 
commit complete
[edit]
user@host#

Example: Apply Groups Re0 and Re1

The following example shows apply groups re0 and re1 with some configuration data that might be different on re0 and re1.
     re0 {
         system {
             host-name my_router_RE0;
         }
         interfaces {
             fxp0 {
                 unit 0 {
                     family inet {
                         address 192.168.15.49/24;
                     }
                     family iso;
                 }
             }
         }
     }
     re1 {
         system {
             host-name my_router_RE1;
         }
         interfaces {
             fxp0 {
                 unit 0 {
                     family inet {
                         address 192.168.15.50/24;
                     }
                     family iso;
                 }
             }
         }
     }

Example: Set Apply Groups Re0 and Re1

The following example sets the apply groups re0 and re1:
[edit]
user@host# set apply-groups [re0 re1] 
[edit]
user@host#


Saturday, October 23, 2010

Commit a Configuration

To save software configuration changes to the configuration database and activate the configuration on the router, use the commit configuration mode command:
[edit]
user@host# commit 
commit complete
[edit]
user@host#

The configuration is checked for syntax errors. If the syntax is correct, the configuration is activated and becomes the current, operational router configuration.
You can issue the commit command from any hierarchy level.

If the configuration contains syntax errors, a message indicates the location of the error and the configuration is not activated. The error message has the following format:
[edit edit-path]
    `offending-statement;'
        error-message

For example:
[edit firewall filter login-allowed term allowed from]
    `icmp-type [ echo-request echo-reply ];'
        keyword `echo-reply' unrecognized

You must correct the error before recommitting the configuration. To return quickly to the hierarchy level where the error is located, copy the path from the first line of the error and paste it at the configuration mode prompt at the [edit] hierarchy level.
When you commit a configuration, you commit the entire configuration in its current form. If more than one user is modifying the configuration, committing it saves and activates the changes of all the users.
After you commit the configuration and are satisfied that it is running successfully, you should issue the request system snapshot command to back up the new software onto the /altconfig file system. If you do not issue the request system snapshot command, the configuration on the alternate boot drive will be out of sync with the configuration on the primary boot drive.
The request system snapshot command backs up the root file system to /altroot, and /config to /altconfig. The root and /config file systems are on the router's flash drive, and the /altroot and /altconfig file systems are on the router's hard drive.

Notice -After you issue this command, you cannot return to the previous version of the software, because the running and backup copies of the software are identical.

Friday, October 22, 2010

Verify a Configuration

To verify that the syntax of a configuration is correct, use the configuration mode commit check command:
[edit]
user@host# commit check 
configuration check succeeds
[edit]
user@host#

If the commit check command finds an error, a message indicates the location of the error.

Thursday, October 21, 2010

Display Configuration Mode Command History

In configuration mode, you can display a list of the recent commands you issued while in configuration mode. To do this, use the run show cli history command:
user@host> configure
...
[edit]
user@host# run show cli history 
    12:40:08 -- show
    12:40:17 -- edit protocols
    12:40:27 -- set isis
    12:40:29 -- edit isis
    12:40:40 -- run show cli history
[edit protocols isis]
user@host# 

By default, this command displays the last 100 commands issued in the CLI. If you specify a number with the command, it displays that number of recent commands. For example:
user@host# run show cli history 3
    12:40:08 -- show
    12:40:17 -- edit protocols
    12:40:27 -- set isis

Wednesday, October 20, 2010

Run an Operational Mode CLI Command from Configuration Mode

At times, you might need to display the output of an operational mode show or other command while configuring the software. While in configuration mode, you can execute a single operational mode command by issuing the configuration mode run command and specifying the operational mode command:

[edit]
user@host# run operational-mode-command 

Example: Run an Operational Mode CLI Command
from Configuration Mode

Display the priority value of the VRRP master router while you are modifying the VRRP configuration for a backup router:
[edit interfaces ge-4/2/0 unit 0 family inet vrrp-group 27] 
user@host# show
virtual-address [ 192.168.1.15 ]; 
[edit interfaces ge-4/2/0 unit 0 family inet vrrp-group 27] 
user@host# run show vrrp detail
Physical interface: ge-5/2/0, Unit: 0, Address: 192.168.29.10/24
  Interface state: up, Group: 10, State: backup
  Priority: 190, Advertisement interval: 3, Authentication type: simple
  Preempt: yes, VIP count: 1, VIP: 192.168.29.55
  Dead timer: 8.326, Master priority: 201, Master router: 192.168.29.254
[edit interfaces ge-4/2/0 unit 0 family inet vrrp-group 27] 
user@host# set priority ...

Tuesday, October 19, 2010

Rename an Identifier

When modifying a configuration, you can rename an identifier that is already in the configuration. You can do this either by deleting the identifier (using the delete command) and then adding the renamed identifier (using the set and edit commands), or you can rename the identifier using the rename configuration mode command:

rename <statement-path> identifier1 to identifier2 

Example: Rename an Identifier

Change the network time (NTP) server address to 10.0.0.6:
[edit]
user@host# rename system network-time server 10.0.0.7 to server 10.0.0.6

Monday, October 18, 2010

Insert a New Identifier

When configuring the router, you can enter most statements and identifiers in any order. Regardless of the order in which you enter the configuration statements, the CLI always displays the configuration in a strict order. However, there are a few cases where the ordering of the statements matters because the configuration statements create a sequence that is analyzed in order.

For example, in a routing policy or firewall filter, you define terms that are analyzed sequentially. Also, when you create a named path in dynamic Multiprotocol Label Switching (MPLS), you define an ordered list of the transit routers in the path, starting with the first transit router and ending with the last one.
To modify a portion of the configuration in which the statement order matters, use the insert configuration mode command:
insert <statement-path> identifier1 (before | after) identifier2 

If you do not use the insert command, but instead simply configure the identifier, it is placed at the end of the list of similar identifiers.

Examples: Insert a New Identifier

Insert policy terms in a routing policy configuration. Note that if you do not use the insert command, but rather just configure another term, the added term is placed at the end of the existing list of terms.
[edit]
user@host# show
policy-options {
    policy-statement statics {
        term term1 {
            from {
                route-filter 192.168.0.0/16 orlonger;
                route-filter 224.0.0.0/3 orlonger;
            }
            then reject;
        }
        term term2 {
            from protocol direct;
            then reject;
        }
        term term3 {
            from protocol static;
            then reject;
        }
        term term4 {
            then accept;
        }
    }
}
[edit]
user@host# rename policy-options policy-statement statics term term4 to term term6
[edit]
user@host# set policy-options policy-statement statics term term4 from protocol local
[edit]
user@host#set policy-options policy-statement statics term term4 then reject
[edit]
user@host# set policy-options policy-statement statics term term5 from protocol aggregate
[edit]
user@host#set policy-options policy-statement statics term term5 then reject
[edit]
user@host# insert policy-options policy-statement statics term term4 after term term3
[edit]
user@host# insert policy-options policy-statement statics term term5 after term term4
[edit]
user@host# show policy-options policy-statement statics
term term1 {
    from {
        route-filter 192.168.0.0/16 orlonger;
        route-filter 224.0.0.0/3 orlonger;
    }
    then reject;
}
term term2 {              # reject direct routes
    from protocol direct;
    then reject;
}
term term3 {        # reject static routes
    from protocol static;
    then accept;
}
term term4 {       #reject local routes
    from protocol local;
    then reject;
}
term term5 {      #reject aggregate routes
    from protocol aggregate;
    then reject;
}
term term6 {       #accept all other routes
    then accept;
}

Insert a transit router in a dynamic MPLS path:

[edit protocols mpls path ny-sf]
user@host# show
1.1.1.1;
2.2.2.2;
3.3.3.3 loose;
4.4.4.4 strict;
6.6.6.6;
[edit protocols mpls path ny-sf]
user@host# insert 5.5.5.5 before 6.6.6.6
[edit protocols mpls path ny-sf]
user@host# set 5.5.5.5 strict
[edit protocols mpls path ny-sf]
user@host# show
1.1.1.1;
2.2.2.2;
3.3.3.3 loose;
4.4.4.4 strict;
5.5.5.5 strict;
6.6.6.6;

Sunday, October 17, 2010

Copy a Statement in the Configuration

When you have many statements in a configuration that are similar, you can add one statement, then make copies of that statement. Copying a statement duplicates that statement and the entire hierarchy of statements configured under that statement. Copying statements is useful when you are configuring many physical or logical interfaces of the same type.

To make a copy of an existing statement in the configuration, use the configuration mode copy command:
copy existing-statement to new-statement 

Immediately after you have copied a portion of the configuration, the configuration might not be valid. You must check the validity of the new configuration, and if necessary, modify either the copied portion or the original portion for the configuration to be valid.

Example: Copy a Statement in the Configuration

After you have created one virtual connection (VC) on an interface, copy its configuration to create a second VC:
[edit interfaces]
user@host# show
at-1/0/0 {
    description "PAIX to MAE West"
    encapsulation atm-pvc;
        unit 61 {
            point-to-point;
            vci 0.61;
            family inet {
                address 10.0.1.1/24;
            }
        }
    }
}
[edit interfaces]
user@host# edit at-1/0/0
[edit interfaces at-1/0/0]
user@host# copy unit 61 to unit 62
[edit interfaces at-1/0/0]
user@host# show
description "PAIX to MAE West"
encapsulation atm-pvc;
    unit 61 {
        point-to-point;
        vci 0.61;
        family inet {
            address 10.0.1.1/24;
        }
    }
    unit 62 {
        point-to-point;
        vci 0.61;
        family inet {
            address 10.0.1.1/24;
        }
    }
}

Saturday, October 16, 2010

Remove a Statement from the Configuration

To delete a statement or identifier, use the delete configuration mode command. Deleting a statement or an identifier effectively "unconfigures" the functionality associated with that statement or identifier, returning that functionality to its default condition.

delete <statement-path> <identifier> 

When you delete a statement, the statement and all its subordinate statements and identifiers are removed from the configuration.
For statements that can have more than one identifier, when you delete one identifier, only that identifier is deleted. The other identifiers in the statement remain.
To delete the entire hierarchy starting at the current hierarchy level, do not specify a statement or an identifier in the delete command. When you omit the statement or identifier, a prompt appears asking you to confirm the deletion:
[edit]
user@host# delete 
Delete everything under this level? [yes, no] (no) ?
    Possible completions:
        no            Don't delete everything under this level
        yes            Delete everything under this level
Delete everything under this level? [yes, no] (no) 

Examples: Remove a Statement from the Configuration

Delete the ospf statement, effectively unconfiguring OSPF on the router:
[edit]
user@host# set protocols ospf area 0.0.0.0 interface so-0/0/0 hello-interval 5
[edit]
user@host# show
protocols {
    ospf {
        area 0.0.0.0 {
            interface so-0/0/0 {
                hello-interval 5;
            }
        }
    }
}
[edit]
user@host# delete protocols ospf 
[edit]
user@host# show
[edit]
user@host#

Delete all statements from the current level down:
[edit]
user@host# edit protocols ospf area 0.0.0.0 
[edit protocols ospf area 0.0.0.0]
user@host# set interface so-0/0/0 hello-interval 5
[edit protocols ospf area 0.0.0.0]
user@host# delete 
Delete everything under this level? [yes, no] (no) yes 
[edit protocols ospf area 0.0.0.0]
user@host# show
[edit]
user@host#

Unconfigure a particular property:
[edit]
user@host# set interfaces so-3/0/0 speed 100mb
[edit]
user@host# show
interfaces {
    so-3/0/0 {
        speed 100mb;
    }
}
[edit]
user@host# delete interfaces so-3/0/0 speed
[edit]
user@host# show
interfaces {
    so-3/0/0; 
}

Friday, October 15, 2010

Display Users Currently Editing the Configuration

To display the users currently editing the configuration, use the status configuration mode command:

user@host# status
Current configuration users:
user terminal p0 (pid 518) on since 2000-03-12 18:24:27 PST
[edit protocols]

The system displays who is editing the configuration (user), from where the user is logged in (terminal p0), the date and time the user logged in (2000-03-12 18:24:27 PST), and what level of the hierarchy the user is editing ([edit protocols]).
If you issue the status configuration mode command and a user has scheduled a candidate configuration to become active for a future time, the system displays who scheduled the commit (root), from where the user is logged in (terminal d0), the date and time the user logged in (2002-10-31 14:55:15 PST) and that a commit is pending (commit at).
[edit]
user@host# status 
Users currently editing the configuration:
root terminal d0 (pid 767) on since 2002-10-31 14:55:15 PST, idle 00:03:09
commit at

For information about how to schedule a commit, see Schedule a Commit.
If you issue the status configuration mode command and a user is editing the configuration in configure exclusive mode, the system displays who is editing the configuration (root), from where the user is logged in (terminal d0), the date and time the user logged in (2002-11-01 13:05:11 PST) and that a user is editing the configuration in configure exclusive mode (exclusive [edit])
[edit]
user@host# status
Users currently editing the configuration:
root terminal d0 (pid 2088) on since 2002-11-01 13:05:11 PST
exclusive [edit]


Thursday, October 14, 2010

Display the Current Configuration

To display the current configuration, use the show configuration mode command. This command displays the configuration at the current hierarchy level or at the specified level.

user@host> show <statement-path> 

When displaying the configuration, the CLI indents each subordinate hierarchy level, inserts braces to indicate the beginning and end of each hierarchy level, and places semicolons at the end of statements that are at the lowest level of the hierarchy. This is the same format that you use when creating an ASCII configuration file, and it is the same format that the CLI uses when saving a configuration to an ASCII file.
The configuration statements appear in a fixed order, and 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:
user@host> show configuration 

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:
[edit]
user@host# show
protocols {
    pim {
        interface so-0/0/0 {
            priority 4;
            version 2;
            # Warning: missing mandatory statement(s): 'mode'
        }
    }
}

Examples: Display the Current Configuration

Display the entire configuration:
[edit]
user@host# set protocols ospf area 0.0.0.0 interface so-0/0/0 hello-interval 5
[edit]
user@host# show 
protocols {
    ospf {
        area 0.0.0.0 {
            interface so-0/0/0 {
                hello-interval 5;
            }
        }
    }
}

Display a particular hierarchy in the configuration:
[edit]
user@host# show protocols ospf area 0.0.0.0
interface so-0/0/0 {
    hello-interval 5;
}

Move down to a level and display the configuration at that level:
[edit]
user@host# edit protocols ospf area 0.0.0.0
[edit protocols ospf area 0.0.0.0]
user@host# show 
interface so-0/0/0 {
    hello-interval 5;
}

Display all of the last committed configuration:
[edit]
user@host# set protocols ospf area 0.0.0.0 interface so-0/0/0 hello-interval 5 
[edit]
user@host# commit 
commit complete
[edit]
user@host# quit
exiting configuration mode
user@host> show configuration
protocols {
    ospf {
        area 0.0.0.0 {
            interface so-0/0/0 {
                hello-interval 5;
            }
        }
    }
}