C H A P T E R  2

Command Structure

The command-line interface (CLI) syntax, conventions, and terminology are described in this chapter. Each CLI command referenced in this document is illustrated using the structure outlined below.

This chapter includes the following topics:


Format for CLI Commands

Some commands, such as show inventory or clear vlan, do not require parameters. Other commands, such as network parms, have parameters for which you must supply a value. Parameters are positional--you must type the values in the correct order. Optional parameters will follow required parameters. Following are two examples.


network parms <ipaddr> <netmask> [gateway]

In the preceding example, <ipaddr> and <netmask> are the required values for the command, and [gateway] is the optional value for the command.


snmp-server location <loc>

In the second example, <loc> is the required parameter for the command.

Command Conventions

The following conventions apply to the command name:

Parameter Conventions

The following conventions apply to parameters:

Values of Common Parameters

The following conventions apply to the values of the common parameters:

ipaddr

This parameter is a valid IP address. You can enter an IP address in the following formats:

In addition to these formats, decimal, hexadecimal, and octal formats are supported through the following input formats (where n is any valid hexadecimal, octal, or decimal number):

macaddr

The MAC address format is six hexadecimal numbers separated by colons -- for example, 00:06:29:32:81:40.

areaid

You can enter Area IDs in dotted-decimal notation (for example, 0.0.0.1). An area ID of 0.0.0.0 is reserved for the backbone. Area IDs have the same form as IP addresses, but are distinct from IP addresses. You can use the IP network number of the sub-netted network for the area ID.

routerid

You must enter the value of <router id> in 4-digit, dotted-decimal notation (for example, 0.0.0.1). A router ID of 0.0.0.0 is invalid.

slot/port

Enter a valid slot and port number separated by forward slashes. For example, 0/1 represents slot number 0 and port number 1.

logical slot/port

The logical slot and port number value is applicable in the case of a port-channel (LAG). The operator can use the logical slot/port to configure the port-channel.

Character Strings

Use double quotation marks to identify character strings--for example, “System Name with Spaces”. An empty string (“”) is not valid.

Network Addresses

Network addresses define a link to a remote host, workstation, or network. Network addresses use the syntax shown in TABLE 2-1.


TABLE 2-1 Network Address Syntax

Address Type

Format

Range

ipaddr

192.165.11.110

0.0.0.0 to 255.255.255.255 (decimal)

macaddr

A7:C9:89:DD:A9:B3

Hexadecimal digit pairs


Command Completion

Command completion finishes spelling the command when you have typed enough letters of a command to uniquely identify the command word. You can execute the command by pressing the Enter key (command abbreviation) or you can complete the command word by pressing the Tab or spacebar keys (command completion).

The value “Er” designates that the requested value was not internally accessible. This should not happen and indicates that the software is not handling this instance correctly.

The value of “-----” designates that the value is unknown.


Comments

The CLI enables the user to type single-line annotations at the command prompt for use when writing test or configuration scripts and for better readability. The exclamation point (!) character flags the beginning of a comment. The comment flag character can begin a word anywhere on the command line and all input following this character is ignored. Any command line that begins with the character ! is recognized as a comment line and ignored by the parser.

Some examples of comments are provided in the following code.


! Script file for displaying the ip interface
! Display information about interfaces
show ip interface 0/1 !Displays the information about the first interface
! Display information about the next interface
show ip interface 0/2
! End of the script file


Special Characters

Certain key combinations speed up use of the CLI. They are listed in this section. Help for the CLI is available by typing HELP.


TABLE 2-2 Special Characters

Key Combination

Meaning

Del, Backspace

Delete previous character

Ctrl-A

Go to beginning of line

Ctrl-E

Go to end of line

Ctrl-F

Go forward one character

Ctrl-B

Go backward one character

Ctrl-D

Delete current character

Ctrl-H

Display command history or retrieve a command

Ctrl-U, X

Delete to beginning of line

Ctrl-K

Delete to end of line

Ctrl-W

Delete previous word

Ctrl-T

Transpose previous character

Ctrl-P

Go to previous line in history buffer

Ctrl-N

Go to next line in history buffer

Ctrl-Z

Return to root command prompt

Tab, spacebar

Command-line completion

Exit

Go to next lower command prompt