This section provides more detailed information about CLI container and leaf statements so that you can better understand how you must specify them when creating ASCII configuration files. It also describes how the CLI performs type-checking to verify that the data you entered is in the correct format.
Statements are shown one of two ways, either with braces or without:
-
statement-name1 identifier-name {
-
statement-name2;
-
additional-statements;
- }
-
statement-name identifier-name1 identifier-name2;
The statement-name is the name of the statement.
The identifier-name is a name or other string that uniquely identifies an instance of a statement. An identifier is used when a statement can be specified more than once in a configuration.
When specifying a statement, you must specify either a statement name or an identifier name, or both, depending on the statement hierarchy.
You specify identifiers in one of the following ways:
The following examples illustrate how statements and identifiers are specified in the configuration:
protocol { # Top-level statement (statement-name).
ospf { # Statement under "protocol" (statement-name).
area 0.0.0.0 { # OSPF area "0.0.0.0" (statement-name identifier-name),
interface so-0/0/0 { # which contains an interface named "so-0/0/0."
hello-interval 25; # Identifier and value (identifier-name value).
priority 2; # Identifier and value (identifier-name value).
disable; # Flag identifier (identifier-name).
}
interface so-0/0/1; # Another instance of "interface," named so-0/0/1,
} # this instance contains no data, so no braces
} # are displayed.
}
policy-options { # Top-level statement (statement-name).
term term1 { # Statement under "policy-options"
# (statement-name value).
from { # Statement under "term" (statement-name).
route-filter 10.0.0.0/8 orlonger reject; # One identifier ("route-filter") with
route-filter 127.0.0.0/8 orlonger reject; # multiple values.
route-filter 128.0.0.0/16 orlonger reject;
route-filter 149.20.64.0/24 orlonger reject;
route-filter 172.16.0.0/12 orlonger reject;
route-filter 191.255.0.0/16 orlonger reject;
}
then { # Statement under "term" (statement-name).
next term; # Identifier (identifier-name).
}
}
}
When you create an ASCII configuration file, you can specify statements and identifiers in one of the following ways. However, each statement has a preferred style, and the CLI uses that style when displaying the configuration in response to a configuration mode show command.
-
statement-name identifier-name [...] identifier-name value [...];
-
statement-name {
-
identifier-name;
- [...]
-
identifier-name value;
- [...]
- }
-
statement-name {
-
identifier-name value1;
-
identifier-name value2;
- }
When you specify identifiers and values, the CLI performs type-checking to verify that the data you entered is in the correct format. For example, for a statement in which you must specify an IP address, the CLI requires you to enter an address in a valid format. If you have not, an error message indicates what you need to type. Table 14 lists the data types the CLI checks.
Table 14: CLI Configuration Input Types