Tuesday, October 12, 2010

Move among Levels of the Hierarchy

When you first enter configuration mode, you are at the top level of the configuration command hierarchy, which is indicated by the [edit] banner:
user@host> configure 
entering configuration mode
[edit]
user@host# 
 

Move Down to a Specific Level

To move down through an existing configuration command hierarchy, or to create a hierarchy and move down to that level, use the edit configuration mode command, specifying the hierarchy level at which you want to be. After you issue an edit command, the banner changes to indicate your current level in the hierarchy.

edit <statement-path> identifier 

For example:
[edit] user@host# edit protocols ospf [edit protocols ospf] user@host# 

Move Back Up to Your Previous Level

To move up the hierarchy, use the exit configuration mode command. This command is, in effect, the opposite of the edit command. That is, the exit command moves you back to your previous level. For example:
[edit]
user@host# edit protocols ospf 
[edit protocols ospf]
user@host# edit area 0.0.0.0 interface so-0/0/0 
[edit protocols ospf area 0.0.0.0 interface so-0/0/0]
user@host# exit 
[edit protocols ospf]
user@host# exit
[edit] 
user@host#  
 

Move Up One Level

To move up the hierarchy one level at a time, use the up configuration mode command. For example:
[edit] user@host# edit protocols ospf area 0.0.0.0 interface so-0/0/0 
[edit protocols ospf area 0.0.0.0 interface so-0/0/0]  
user@host# set hello-interval 5  
[edit protocols ospf area 0.0.0.0 interface so-0/0/0]
user@host# up [edit protocols ospf area 0.0.0.0] 
user@host# up [edit protocols ospf]
user@host# 

Move Directly to the Top of the Hierarchy

To move directly to the top level, use the top configuration mode command. For example:
[edit protocols ospf area 0.0.0.0 interface so-0/0/0]
user@host# top 
[edit]
user@host# 
 

Warning Messages When Moving Up

If you have omitted a required statement at a particular level, when you issue a show command that displays that hierarchy level, a warning message indicates which statement is missing. For example:
[edit protocols mpls]
user@host# set statistics file  
[edit protocols mpls] 
user@host# show  
statistics {     
                    file; # Warning: missing mandatory statement(s):
}
interface all; 
interface so-3/0/0 { 

Issue Relative Configuration Commands

You can issue configuration mode commands from the top of the hierarchy, or from a level above the area you are configuring. This enables you to perform configurations without having move from your current location in the hierarchy. To do this, use the top or up commands followed by another configuration command, including edit, insert, delete, deactivate, annote, or show.
To issue configuration mode commands from the top of the hierarchy, use the top command; then specify a configuration command. For example:
[edit interfaces fxp0 unit 0 family inet]
user@host# top edit system login 
[edit system login]
user@host#


To issue configuration mode commands from a location higher in the hierarchy, use the up configuration mode command; then specify a configuration command. For example:
[edit protocols bgp]
user@host# up 2 activate system 





No comments: