Sunday, August 25, 2013

Working on Configuration Mode

Hierarchical Configuration:
The 'set' or 'edit' command in the CLI configuration mode is used to modify the candidate configuration and 'show' command is used to display the candidate configuration. We use 'edit' command to move to the portion of the configuration we want to modify (similar to using the Unix 'cd' command to move to a different directory) and use 'set' command to configure a specific item.
Configuration files use curly brackets ({}) and indentation to visually display the hierarchical structure of the configuration. Terminating-or leaf-statements in the configuration hierarchy are displayed with a trailing semicolon (;). We can enter either the curly brackets nor the semicolons as part of the set command.

Moving Between Levels:
To move down through an existing configuration statement hierarchy or to create a hierarchy and move down to that level, we use edit command, specifying our desired hierarchy level. After we issue the command, the configuration mode banner changes to indicate our current level in the hierarchy.
To move up one level from the current position in the hierarchy, we use 'up' command. It is just like 'cd ..' command in Linux.
To move up more than one level from the current position in the hierarchy, supply an optional count to the up command. The software moves you up to the specified number of levels or to the top of the hierarchy if there are fewer levels than specified. Such as 'up n', where 'n' defines the number of upper levels in hierarchy.
The 'top' command is used to quickly go to the top of hierarchy. We can combine top with edit to move quickly to a different hierarchy or with show to display the configuration details for a different hierarchy, as in the following.
[edit protocols ospf area 0.0.0.0 interface ge-0/0/0.0]
user@router# top edit system login
[edit system login]
user@router# top show system services
ftp;
ssh;

The 'exit' command is used to return the user to the most recent, higher level of the hierarchy. Entering 'exit' at the top level of the hierarchy exits configuration mode such as:
[edit]
user@router# exit
Exiting configuration mode
user@router>

Adding Configuration Statements:
To add a service (statement), 'set' command in the CLI configuration mode is used.

Removing Configuration Statements:
To remove statements we use 'delete' command in configuration mode. It deletes the statement and all its subordinate statements and identifiers. Deleting a statement or an identifier effectively unconfigures the functionality associated with that statement or identifier, returning that functionality to its default condition. We can use 'wildcard' for delete command such as:
[edit]
user@router# wildcard delete interfaces ge-1/*
matched: ge-1/0/0
matched: ge-1/0/1
Delete 2 objects? [yes,no] (no) yes
[edit]
user@router#

No comments:

Post a Comment