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; 
}

No comments: