46Revision History ...................................................................................................................706
78-20269-01 Command Line Interface Reference Guide15
Page 16
1Introduction
Overview
This chapter describes the CLI command modes, how to access the CLI, and the
CLI command editing features.
CLI Command Modes
1
The Command Line Interface (CLI) is divided into four command modes. The
command modes are (in the order in which they are accessed):
•User EXEC mode
•Privileged EXEC mode
•Global Configuration mode
•Interface Configuration mode
Each command mode has its own unique console prompt and set of CLI
commands. Entering a question mark at the console prompt displays a list of
available commands for the current mode and for the level of the user. Specific
commands are used to switch from one mode to another.
User EXEC Mode
Users with level 1 initially log into User EXEC mode. User EXEC mode is used for
tasks that do not change the configuration, such as performing basic tests and
listing system information.
The user-level prompt consists of the Switch host name followed by the angle
bracket >:
Console>
The default host name is Console unless it is changed via the hostname command
in Global Configuration mode.
78-20269-01 Command Line Interface Reference Guide17
Page 17
Introduction
1
To access the next higher mode (Privileged EXEC mode), use the enable
command and enter the password for the higher level when prompted.
Privileged EXEC Mode
Users with levels 7 and 15 initially log into Privileged EXEC mode, which is
password-protected to prevent unauthorized use, as many of its commands set
operating system parameters. The password is not displayed on the screen and is
case-sensitive.
Only users with command level of 7 or 15 can access this mode.
To enter this mode from User EXEC mode, follow these steps:
STEP 1At the prompt enter the enable command and press Enter. A password prompt is
displayed.
STEP 2Enter the password to go the next level and press Enter. (For security purposes,
each character in the password is replaced by *). The Privileged EXEC mode
prompt, consisting of the Switch host name followed by, is displayed.
Console#
To return from the Privileged EXEC mode to the User EXEC mode, use the disable
command.
The following example illustrates how to access Privileged EXEC mode and then
return to User EXEC mode:
Console>
Console> enable
Enter Password: ******
Console#
Console# disable
Console>
78-20269-01 Command Line Interface Reference Guide18
Page 18
Introduction
1
Global Configuration Mode
The Global Configuration mode is used to configure features at the system level,
and not at the interface level.
Only users with command level of 7 or 15 can access this mode.
To access Global Configuration mode from Privileged EXEC mode, enter the
configure command at the Privileged EXEC mode prompt and press Enter. The
Global Configuration mode prompt, consisting of the device host name followed
by (config)#, is displayed:
Console(config)#
Use any of the following commands to return from Global Configuration mode to
the Privileged EXEC mode:
exit
end
Ctrl+Z
The following example shows how to access Global Configuration mode and
return to Privileged EXEC mode:
The exit command returns to Global Configuration mode.
The following submodes are available:
•Interface — Contains commands that configure a specific interface (port,
VLAN, port channel, or tunnel) or range of interfaces. The Global
Configuration mode command interface is used to enter the Interface
Configuration mode. The interface Global Configuration command is used
to enter this mode.
•Line Interface — Contains commands used to configure the management
connections for the console, Telnet and SSH. These include commands such
as line timeout settings, etc. The line Global Configuration command is used
to enter the Line Configuration command mode.
•VLAN Database — Contains commands used to configure a VLAN as a
whole. The vlan database Global Configuration mode command is used to
enter the VLAN Database Interface Configuration mode.
•Management Access List — Contains commands used to define
management access-lists. The management access-list Global
Configuration mode command is used to enter the Management Access
List Configuration mode.
•Port Channel — Contains commands used to configure port-channels; for
example, assigning ports to a port-channel. Most of these commands are
the same as the commands in the Ethernet interface mode, and are used to
manage the member ports as a single entity. The interface port-channel
Global Configuration mode command is used to enter the Port Channel
Interface Configuration mode.
•QoS — Contains commands related to service definitions. The qos Global
Configuration mode command is used to enter the QoS services
configuration mode.
78-20269-01 Command Line Interface Reference Guide20
Page 20
Introduction
•MAC Access-List — Configures conditions required to allow traffic based
on MAC addresses. The mac access-list Global Configuration mode
command is used to enter the MAC access-list configuration mode.
To return from any Interface Configuration mode to the Global Configuration mode,
use the exit command.
User (Privilege) Levels
Users may be created with one of the following user levels:
•Level 1 — Users with this level can only run User EXEC mode commands.
Users at this level cannot access the web GUI.
•Level 7 — Users with this level can run commands in the User EXEC mode
and a subset of commands in the Privileged EXEC mode. Users at this level
cannot access the web GUI.
1
•Level 15 — Users with this level can run all commands. Only users at this
level can access the web GUI.
A system administrator (user with level 15) can create passwords that allow a
lower level user to temporarily become a higher level user. For example, the user
may go from level 1 to level 7, level 1 to 15, or level 7 to level 15.
The passwords for each level are set (by an administrator) using the following
command:
level
enable password [
encrypted-password}
Users with a lower level can raise their level by entering the command: enable and
the password for level 7 or 15. A user can go from level 1 to level 7 or directly to
level 15. The higher level holds only for the current session.
The disable command returns the user to a lower level.
To create a user and assign it a user level, use the username command. Only users
with command level 15, can create users at this level.
privilege-level]{password|
encrypted
78-20269-01 Command Line Interface Reference Guide21
Page 21
Introduction
1
Example — Create passwords for level 7 and 15 (by the administrator)
Console>
Console> username john password john1234 privilege 1
Console>
Example 2— Switch between Level 1 to Level 15. The user must know the
password.
Console>
Console> enable
Enter Password: ****** (this is the password for level 15
- level15@abc)
Console>
NOTE If authentication of passwords is performed on RADIUS or TACACS+ servers, the
passwords assigned to user level 7 and user level 15 must be configured on the
external server and associated with the $enable7$ and $enable15$ user names,
respectively. See the Authentication, Authorization and Accounting (AAA)
Commands chapter for details.
78-20269-01 Command Line Interface Reference Guide22
Page 22
Introduction
Accessing the Command Line Interface
The Command Line Interface (CLI) can be accessed from a terminal or computer
by performing one of the following tasks:
•Running a terminal application, such as HyperTerminal, on a computer that is
directly connected to the Switch’s console port,
—or—
•Running a Telnet session from a command prompt on a computer with a
network connection to the Switch.
•Using SSH.
NOTE Telnet and SSH are disabled by default on the switch.
1
If access is via a Telnet connection, ensure that the following conditions are met
before using CLI commands:
•The switch has a defined IP address.
•Corresponding management access is granted.
•There is an IP path such that the computer and the switch can reach each
other.
Using HyperTerminal over the Console Interface
NOTE When using HyperTerminal with Microsoft® Windows® 2000, ensure that
Windows® 2000 Service Pack 2 or later is installed on your computer. The arrow
keys will not function properly using HyperTerminal’s VT100 emulation in
Windows® 2000 prior to Service Pack 2. For information on Windows® 2000
service packs, go to www.microsoft.com.
The Switch’s RS-232 serial console port provides a direct connection to a
computer’s serial port using a standard DB-9 null-modem or crossover cable.
Once the computer and Switch are connected, run a terminal application to
access the Command Line Interface.
78-20269-01 Command Line Interface Reference Guide23
Page 23
Introduction
1
To access the Command Line Interface using the HyperTerminal application,
perform the following steps:
STEP 1Click the Start button.
STEP 2Select All Programs > Accessories > Communications > HyperTerminal.
Figure1Start > All Programs > Accessories > Communications >
HyperTerminal
STEP 3Enter a name for this connection. Select an icon for the application, then click OK.
STEP 4Select a port to communicate with the switch. Select COM1 or COM2.
STEP 5Set the serial port settings, then click OK.
STEP 6When the
and press Enter.
Figure 2Command Line User Name Prompt
The console# prompt is displayed. This prompt is where you enter CLI commands.
Figure 3Command Line
You can now enter CLI commands to manage the switch. For detailed information
on CLI commands, refer to the appropriate chapter(s) of this Reference Guide.
Command Line Interface
appears, enter admin at the
User Name
prompt
78-20269-01 Command Line Interface Reference Guide24
Page 24
Introduction
1
Using Telnet over an Ethernet Interface
Telnet provides a method of connecting to the Command Line Interface over an IP
network.
To establish a telnet session from the command prompt, perform the following
steps:
STEP 1Click Start, then select All Programs > Accessories > Command Prompt to open a
command prompt.
Figure 4Start > All Programs > Accessories > Command Prompt
STEP 2At the prompt, enter telnet 1<IP address of switch>, then press Enter.
Figure 5Command Prompt
STEP 3The
Command Line Interface
will be displayed.
78-20269-01 Command Line Interface Reference Guide25
Page 25
Introduction
Editing Features
Entering Commands
A CLI command is a series of keywords and arguments. Keywords identify a
command, and arguments specify configuration parameters. For example, in the
command show interfaces status Gigabitethernet 1,
are keywords, Gigabitethernet is an argument that specifies the interface type,
and
To enter commands that require parameters, enter the required parameters after
the command keyword. For example, to set a password for the administrator,
enter:
When working with the CLI, the command options are not displayed. The standard
command to request help is ?.
1
specifies the port.
1
show, interfaces
and
status
There are two instances where help information can be displayed:
•Keyword lookup — The character ? is entered in place of a command. A list
of all valid commands and corresponding help messages are is displayed.
•Partial keyword lookup — If a command is incomplete and or the character
? is entered in place of a parameter, the matched keyword or parameters
for this command are displayed.
To assist in using the CLI, there is an assortment of editing features. The following
features are described:
•Terminal C o m m a n d B u f fer
•Command Completion
•Interface Naming Conventions
•Keyboard Shortcuts
Term in al C om ma nd Buf fer
Every time a command is entered in the CLI, it is recorded on an internally
managed Command History buffer. Commands stored in the buffer are maintained
on a First In First Out (FIFO) basis. These commands can be recalled, reviewed,
modified, and reissued. This buffer is not preserved across device resets.
78-20269-01 Command Line Interface Reference Guide26
Page 26
Introduction
1
KeywordDescription
Up-Arrow key
Ctrl+P
Down-Arrow keyReturns to more recent commands in the
By default, the history buffer system is enabled, but it can be disabled at any time.
For more information on enabling or disabling the history buffer, refer to the history
command.
There is a standard default number of commands that are stored in the buffer. The
standard number of 10 commands can be increased to 216. By configuring 0, the
effect is the same as disabling the history buffer system. For more information on
configuring the command history buffer, refer to the history size command.
To display the history buffer, refer to the show history command.
Recalls commands in the history buffer,
beginning with the most recent command.
Repeat the key sequence to recall
successively older commands.
history buffer after recalling commands
with the up-arrow key. Repeating the key
sequence will recall successively more
recent commands.
Negating the Effect of Commands
For many configuration commands, the prefix keyword no can be entered to
cancel the effect of a command or reset the configuration to the default value. This
Reference Guide provides a description of the negation effect for each CLI
command.
Command Completion
If the command entered is incomplete, invalid or has missing or invalid parameters,
then the appropriate error message is displayed. This assists in entering the
correct command. By pressing Ta b after an incomplete command is entered, the
system will attempt to identify and complete the command. If the characters
already entered are not enough for the system to identify a single matching
command, press ? to display the available commands matching the characters
already entered.
78-20269-01 Command Line Interface Reference Guide27
Page 27
Introduction
1
Interface Naming Conventions
Interface ID
Within the CLI, interfaces are denoted by concatenating the following elements:
•Type of interface: The following types of interfaces are found on the
various types of devices:
-Fast Ethernet (10/100 bits) - This can be written as FastEthernet or fa.
-Gigabit Ethernet ports (10/100/1000 bits) - This can be written either
Gigabit Ethernet or gi or GE.
-LAG (Port Channel) - This can be written as either Port-Channel or po.
-VLAN - This is written as VLAN
-Tunnel - This is written as tunnel or tu
•Number of interface: Number of port, LAG, tunnel or VLAN
78-20269-01 Command Line Interface Reference Guide29
Page 29
Introduction
1
NOTE Range lists can contain either ports and port-channels or VLANs. Combinations of
port/port-channels and VLANs are not allowed
The space after the comma is optional.
When a range list is defined, a space after the first entry and before the comma (,)
must be entered.
A sample of this command is shown in the example below:
console#configure
cconsole(config-if)#interface range gi1-5, vlan 1-2
Keyboard Shortcuts
The CLI has a range of keyboard shortcuts to assist in editing the CLI commands.
The following table describes the CLI shortcuts.
Keyboard Key
Up-arrow Recalls commands from the history buffer,
Down-arrowReturns the most recent commands from the
Ctrl+AMoves the cursor to the beginning of the
Ctrl+EMoves the cursor to the end of the command line.
Ctrl+Z / EndReturns back to the Privileged EXEC mode from
BackspaceDeletes one character left to the cursor position.
Description
beginning with the most recent command. Repeat
the key sequence to recall successively older
commands.
history buffer after recalling commands with the
up arrow key. Repeating the key sequence will
recall successively more recent commands.
command line.
any configuration mode.
78-20269-01 Command Line Interface Reference Guide30
Page 30
Introduction
1
CLI Command Conventions
When entering commands there are certain command entry standards that apply
to all commands. The following table describes the command conventions.
Convention
[ ]In a command line, square brackets indicate an optional entry.
{ }In a command line, curly brackets indicate a selection of
parameter
press keyNames of keys to be pressed are shown in bold.
Ctrl+F4Keys separated by the + character are to be pressed
Screen DisplayFixed-width font indicates CLI prompts, CLI commands entered by
allWhen a parameter is required to define a range of ports or
Description
compulsory parameters separated the | character. One option must
be selected. For example, flowcontrol {auto|on|off} means that for
the flowcontrol command, either auto, on, or off must be selected.
Italic text indicates a parameter.
simultaneously on the keyboard
the user, and system messages displayed on the console.
parameters and all is an option, the default for the command is all
when no parameters are defined. For example, the command
interface range port-channel has the option of either entering a
range of channels, or selecting all. When the command is entered
without a parameter, it automatically defaults to all.
Copying and Pasting Text
Up to 1000 lines of text (or commands) can be copied and pasted into the device.
NOTE It is the user’s responsibility to ensure that the text copied into the device consists
of legal commands only.
When copying and pasting commands from a configuration file, make sure that the
following conditions exist:
•A device Configuration mode has been accessed.
78-20269-01 Command Line Interface Reference Guide31
Page 31
Introduction
•The commands contain no encrypted data, like encrypted passwords or
keys. Encrypted data cannot be copied and pasted into the device except
for encrypted passwords where the keyword encrypted is used before the
encrypted data (for instance in the enable password command).
Layer 2 and Layer 3
The switch can operate in Switch mode (Layer 2) or Router mode (Layer 3).
The default mode is Switch mode (Layer 2 Mode). To change the mode of the
switch, use the following CLI command.:
set system mode {router | switch}
This command performs a system reboot.
1
In Layer 2 mode, the switch forwards packets as a VLAN-aware bridge. In Layer 3
mode, the switch performs both IPv4 routing and VLAN-aware bridging.
If Layer 2 mode is selected, a single IP address is supported on the default VLAN.
The user also must configure a default gateway.
If Layer 3 mode is selected, the user can manage the device on any IP interface
configured on the device, as long as a default route is configured. In Layer 3 mode,
the switch routes traffic between IP VLANs, and bridges traffic with VLANs.
When the switch operates in Layer 3 mode, the following features are not
supported:
•Protocol-based VLANs
•MAC-based VLANs
•VLAN Rate Limit
•DVA, Multicast TV VLAN
•Per flow policing
78-20269-01 Command Line Interface Reference Guide32
Page 32
User Interface Commands
2User Interface Commands
2.1enable
The enable EXEC mode command enters the Privileged EXEC mode.
Syntax
2
enable [
Parameters
privilege-level—Specifies the privilege level at which to enter the system. (Range:
1, 7, 15)
Default Configuration
The default privilege level is 15.
Command Mode
EXEC mode
Example
The following example enters privilege level 7.
Console>
enter password:**********
privilege-level
enable 7
]
Console#Accepted
The following example enters privilege level 15.
Console>
enter password:**********
Console#Accepted
78-20269-01 Command Line Interface Reference Guide33
enable
Page 33
User Interface Commands
2
2.2disable
The disable Privileged EXEC mode command leaves the Privileged EXEC mode
and returns to the User EXEC mode.
Syntax
disable [
Parameters
privilege-level—Reduces the privilege level to the specified privileged level. If
privilege level is left blank, the level is reduce to 1.
Default Configuration
The default privilege level is 1.
Command Mode
Privileged EXEC mode
Example
The following example returns the user to user level 7.
Console#
Console>
privilege-level
disable 7
]
2.3login
The login EXEC mode command enables changing the user that is logged in.
When this command is logged in, the user is prompted for a username/password.
Syntax
login
Parameters
N/A
78-20269-01 Command Line Interface Reference Guide34
Page 34
User Interface Commands
2
Default Configuration
N/A
Command Mode
EXEC mode
Example
The following example enters Privileged EXEC mode and logs in with username
‘admin’.
Console>
User Name:admin
Password:*****
Console#
login
2.4configure
The configure Privileged EXEC mode command enters the Global Configuration
mode.
Syntax
configure [
Parameters
terminal—Enter the Global Configuration mode with or without the keyword
terminal.
Command Mode
terminal
]
Privileged EXEC mode
Example
The following example enters Global Configuration mode.
Console#
Console(config)#
78-20269-01 Command Line Interface Reference Guide35
configure
Page 35
User Interface Commands
2
2.5exit (Configuration)
The exit command exits any configuration mode to the next highest mode in the
CLI mode hierarchy.
Syntax
exit
Parameters
N/A
Default Configuration
N/A
Command Mode
All commands in configuration modes.
Examples
The following examples change the configuration mode from Interface
Configuration mode to Privileged EXEC mode.
Console(config-if)#
Console(config)#
exit
exit
2.6exit (EXEC)
The exit EXEC mode command closes an active terminal session by logging off
the device.
Syntax
exit
Parameters
N/A
78-20269-01 Command Line Interface Reference Guide36
Page 36
User Interface Commands
2
Default Configuration
N/A
Command Mode
EXEC mode
Example
The following example closes an active terminal session.
Console>
exit
2.7end
The end command ends the current configuration session and returns to the
Privileged EXEC mode.
Syntax
end
Parameters
N/A
Default Configuration
N/A
Command Mode
All configuration modes
Example
The following example ends the Global Configuration mode session and returns to
the Privileged EXEC mode.
Console(config)#
Console#
78-20269-01 Command Line Interface Reference Guide37
end
Page 37
User Interface Commands
2
2.8help
The help command displays a brief description of the Help system.
Syntax
help
Parameters
N/A
Default Configuration
N/A
Command Mode
All command modes
Example
The following example describes the Help system.
Console#
Help may be requested at any point in a command by entering a question mark
'
?
'. If nothing matches the currently entered incomplete command, the help
list is empty. This indicates that there is no command matching the input as
it currently appears. If the request is within a command, press the Backspace
key and erase the entered characters to a point where the request results in
a match.
Help is provided when:
1. There is a valid command and a help request is made for entering a
parameter or argument (e.g. 'show ?'). All possible parameters or arguments
for the entered command are then displayed.
2. An abbreviated argument is entered and a help request is made for
arguments matching the input (e.g. 'show pr?').
help
78-20269-01 Command Line Interface Reference Guide38
Page 38
User Interface Commands
2
2.9history
The history Line Configuration mode command enables saving commands that
have been entered. Use the no form of this command to disable the command.
Syntax
history
no history
Parameters
N/A
Default Configuration
Enabled.
Command Mode
Line Configuration mode
User Guidelines
This command enables saving user-entered commands for a specified line. You
can return to previous lines by using the up or down arrows.
The following are related commands:
•Use the terminal history size EXEC mode command to enable or disable this
command for the current terminal session.
•Use the history size Line Configuration mode command to set the number
of commands that are saved in the history.
Example
The following example enables the command for Telnet
Console(config)#
line telnet
.
Console(config-line)#
78-20269-01 Command Line Interface Reference Guide39
history
Page 39
User Interface Commands
2
2.10history size
The history size Line Configuration mode command changes the maximum
number of user commands that are saved in the history buffer for a particular line.
Use the no form of this command to reset the command history buffer size to the
default value.
Syntax
history size
no history size
Parameters
number-of-commands—Specifies the number of commands the system records
in its history buffer. (Range: 10–
Default Configuration
The default command history buffer size is 10 commands.
Command Mode
Line Configuration mode
User Guidelines
This command configures the command history buffer size for a particular line.
Use the terminal history size EXEC mode command to configure the command
history buffer size for the current terminal session.
The allocated command history buffer is per terminal user, and is taken from a
shared buffer. If there is not enough space available in the shared buffer, the
command history buffer size cannot be increased above the default size.
number-of-commands
207)
Example
The following example changes the command history buffer size to 100 entries for
Te l n e t .
Console(config)#
Console(config-line)#
78-20269-01 Command Line Interface Reference Guide40
line telnet
history size
100
Page 40
User Interface Commands
2
2.11terminal history
The terminal history EXEC mode command enables the command history function
for the current terminal session, meaning it is not stored in the Running
Configuration file. Use the no form of this command to disable the command.
Syntax
terminal history
terminal no history
Default Configuration
The default configuration for all terminal sessions is defined by the history Line
Configuration mode command.
Command Mode
EXEC mode
User Guidelines
The command enables the command history for the current session. The default is
determined by the history Line Configuration mode command.
Example
The following example disables the command history function for the current
terminal session.
Console>
terminal no history
2.12terminal history size
The terminal history size EXEC mode command changes the command history
buffer size for the current terminal session, meaning it is not stored in the Running
Configuration file. Use the no form of this command to reset the command history
buffer size to the default value.
Syntax
terminal history size
terminal no history size
78-20269-01 Command Line Interface Reference Guide41
number-of-commands
Page 41
User Interface Commands
2
Parameters
number-of-commands—Specifies the number of commands the system maintains
in its history buffer. (Range: 10–207)
Default Configuration
The default configuration for all terminal sessions is defined by the history size
Line Configuration mode command.
Command Mode
EXEC mode
User Guidelines
The terminal history size EXEC command changes the command history buffer
size for the current terminal session. Use the history Line Configuration mode
command to change the default history buffer size.
The maximum number of commands in all buffers is 207.
Example
The following example sets the command history buffer size to 20 commands for
the current terminal session.
Console>
terminal history size
20
2.13terminal datadump
The terminal datadump EXEC mode command enables dumping all the output of a
show command without prompting. Use the no form of this command to disable
dumping.
Syntax
terminal datadump
no terminal datadump
Parameters
N/A
78-20269-01 Command Line Interface Reference Guide42
Page 42
User Interface Commands
2
Default Configuration
When printing, dumping is disabled and printing is paused every 24 lines.
Command Mode
EXEC mode
User Guidelines
By default, a More prompt is displayed when the output contains more than 24
lines. Pressing the Enter key displays the next line; pressing the Spacebar displays
the next screen of output.
The terminal datadump command enables dumping all output immediately after
entering the show command by removing the pause.
The width is currently not limited (previously the limit was 77 chars), and the width
of the line being printed on the terminal is based on the terminal itself.
This command is relevant only for the current session.
Example
The following example dumps all output immediately after entering a show
command.
Console>
terminal datadump
2.14show history
The show history EXEC mode command lists commands entered in the current
session.
Syntax
show history
Parameters
N/A
Default Configuration
N/A
78-20269-01 Command Line Interface Reference Guide43
Page 43
User Interface Commands
2
Command Mode
EXEC mode
User Guidelines
The buffer includes executed and unexecuted commands.
Commands are listed from the first to the most recent command.
The buffer remains unchanged when entering into and returning from configuration
modes.
Example
The following example displays all the commands entered while in the current
Privileged EXEC mode.
Console#
SW version 3.131 (date 23-Jul-2005 time 17:34:19)
HW version 1.0.0
Console#
15:29:03 Jun 17 2005
Console#
show version
show clock
show history
3 commands were logged (buffer size is 10)
show version
show clock
show history
2.15show privilege
The show privilege EXEC mode command displays the current privilege level.
Syntax
show privilege
Parameters
N/A
78-20269-01 Command Line Interface Reference Guide44
Page 44
User Interface Commands
2
Default Configuration
N/A
Command Mode
EXEC mode
Example
The following example displays the privilege level for the user logged on.
Console#
Current privilege level is 15
show privilege
2.16do
The do command executes an EXEC-level command from Global Configuration
mode or any configuration submode.
Syntax
command
do
Parameters
command—Specifies the EXEC-level command to execute.
Command Mode
All configuration modes
Example
The following example executes the show vlan Privileged EXEC mode command
from Global Configuration mode.
78-20269-01 Command Line Interface Reference Guide45
do show vlan
Page 45
User Interface Commands
2
1 1 gi1-39,Po1,Po2, other Required
2 2 gi1 dynamicGvrp Required
10 v0010 gi1 permanent Not Required
11 V0011 gi1,gi3 permanent Required
20 20 gi1 permanent Required
30 30 gi1,gi3 permanent Required
31 31 gi1 permanent Required
91 91 gi1,gi4 permanent Required
4093 guest-vlan gi1,gi3 permanent Guest
console(config)#
2.17banner login
Use the banner login command in Global Configuration mode to specify a
message to be displayed before the username and password login prompts. This
banner is applied automatically on all the CLI interfaces: Console, Telnet and SSH
and also on the WEB GUI. Use the no form of this command to delete the existing
login banner.
Syntax
banner login
no banner login
Parameters
d message-text d
•d—Delimiting character of user’s choice—a pound sign (#), for example.
You cannot use the delimiting character in the banner message.
•message-text—Message text. The message must start on a new line. You
can enter multi-line messages. You can include tokens in the form of
$(token) in the message text. Tokens are replaced with the corresponding
configuration variable (see User Guidelines). The message can contain up
to 1000 characters (after every 510 characters, you must press <Enter> to
continue).
Default Configuration
Disabled (no Login banner is displayed).
78-20269-01 Command Line Interface Reference Guide46
Page 46
User Interface Commands
2
Command Mode
Global Configuration mode
User Guidelines
Follow this command with one or more blank spaces and a delimiting character of
your choice. Then enter one or more lines of text, terminating the message with
the second occurrence of the delimiting character.
Use tokens in the form of $(token) in the message text to customize the banner. The
tokens are described in the table below:
TokenInformation displayed in the banner
$(hostname)Displays the host name for the device.
$(domain)Displays the domain name for the device.
$(bold)Indicates that the next text is a bold text. Using this
token again indicates the end of the bold text.
$(inverse)Indicates that the next text is an inverse text. Using this
token again indicates the end of the inverse text.
$(contact)Displays the system contact string.
$(location)Displays the system location string.
$(mac-addre
ss)
Use the no banner login Line Configuration command to disable the Login banner
on a particular line or lines.
Example
The following example sets a Login banner that uses tokens. The percent sign (%)
is used as a delimiting character. Note that the $(token) syntax is replaced by the
corresponding configuration variable.
Displays the base MAC address of the device.
Device(config)# banner login %
Enter TEXT message. End with the character '%'.
You have entered $(hostname).$(domain)
%
78-20269-01 Command Line Interface Reference Guide47
Page 47
User Interface Commands
2
When the login banner is executed, the user will see the following banner:
You have entered host123.ourdomain.com
2.18login-banner
Use the login-banner command in Line Configuration mode to enable the display
of login banners. Use the no form of this command to disable the display of login
banners.
Syntax
login-banner
no login-banner
Parameters
N/A
Default Configuration
Enabled
Command Mode
Line Configuration mode
Example
console#
console(config)# line console
console(config-line)# login-banner
console(config-line)# exit
console(config)# line telnet
console(config-line)# login-banner
console(config-line)# exit
configure
console(config)# line ssh
console(config-line)# login-banner
78-20269-01 Command Line Interface Reference Guide48
Page 48
User Interface Commands
2
2.19show banner
Use the show banner commands in EXEC mode to display the banners that have
been defined.
78-20269-01 Command Line Interface Reference Guide49
Page 49
Macro Commands
3Macro Commands
3.1macro name
There are two types of macros that can be created with the macro name Global
Configuration mode command:
•Global macros are macros that are simple a group of CLI commands that
can be used at any time.
•Smartport macros are associated with Smartport types (see Section 43
"Smartport Commands" ). For each Smartport macro there must be an anti
macro that concatenates no_ with the name of the Smartport macro.
If a macro by the name you assign, already exists, this macro overrides the
previously-defined one.
3
Use the no form of this command to delete the macro definition.
Syntax
macro name
no macro name
Parameters
macro-name—Name of the macro. Macro names are case sensitive.
Default Configuration
The command has no default setting.
Command Mode
Global Configuration mode
User Guidelines
A macro is a script that contains CLI commands and is assigned a name by the
user. It can contain up to 3000 characters and 200 lines.
[macro-name]
[macro-name]
A macro can contain up to three keywords/parameters. A keyword is a name
prefixed with a '$' character, for example, $a_keyword. The keywords in the
macro’s CLI commands are substituted with the values specified when you invoke
the macro by using the macro apply/trace and macro global apply/trace CLI
commands.
78-20269-01 Command Line Interface Reference Guide50
Page 50
Macro Commands
3
Use the following guidelines to create a macro:
•Use the macro name command to assign a name to the macro.
•Enter one macro command per line.
•Use the @ character to end the macro.
•Use the # character at the beginning of a line to enter comment text within
the macro. In addition, # is used to identify certain preprocessor commands
that can only be used within a macro. There are two possible preprocessor
commands:
-#macro key description - Each macro can be configured with up to 3
keyword and description pairs. When a macro is displayed from the GUI,
its keywords and descriptions are displayed (if they exist).
The syntax for this preprocessor command is as follows:
-#macro key description: $
-#$
keyword2: description_string
-#$
keyword3: description_string
Parameters:
-keyword - A keyword must be prefixed with '$'
-description-string - description of the keyword
keyword1: description_string
-#macro keywords - This preprocessor command accepts up to 3
keywords. The command creates a CLI help string with the keywords for
the macro. The help string will be displayed if help on the macro is
requested from the macro apply/trace and macro global apply trace
commands. The GUI also uses the keywords specified in the command
as the parameter names for the macro. See Example 2 and 3 below for a
description of how this command is used in the CLI.
The syntax for this preprocessor command is as follows:
-#macro keywords: $
keyword-name1 $keyword-name2
Parameter:
-keyword-name - User-defined name of the keyword (parameter)
prefixed with '$'
It is important to consider the scope of any user-defined macro. Because of the
potential hazards of applying unintended configurations, do not change
78-20269-01 Command Line Interface Reference Guide51
Page 51
Macro Commands
3
configuration modes within the macro by using commands such as exit, end, or
interface
interface-id
macros in the various configuration modes.
You can modify a macro by creating a new macro with the same name as the
existing macro. The newer macro overwrites the existing macro. The exceptions to
this are the macros and corresponding anti-macros for Smartport. For example,
you cannot edit the host and the no_host macros.
Examples
Example 1 - The following example shows how to create a macro that when
applied configures the duplex mode and speed of a port.
. With few exceptions, there are other ways of executing
Switch(config)#
Enter macro commands one per line. End with the character ‘@’.
macro description
no negotiation
duplex full
negotiation
@
macro name
dup
dup
Example 2 - The following example shows how to create the same macro as in
Example 1, but in this example, the macro has the parameters: DUPLEX and
SPEED. When the macro is run, the values of DUPLEX and SPEED must be
provided by the user. The macro keywords command enables the user to receive
help for the macro as shown in Example 3.
Switch(config) #
Enter macro commands one per line. End with the character ‘@’.
duplex $DUPLEX
macro name
duplex
speed $SPEED
macro keywords
#
@
$DUPLEX $SPEED
Example 3 - The following example shows how to display the keywords using the
help character ? (as defined by the macro keywords command above):
switch<config-if>#
78-20269-01 Command Line Interface Reference Guide52
macro apply
duplex ?
Page 52
Macro Commands
3
WORD <1-32> Keyword to replace with value e.g. $DUPLEX, $SPEED
<cr>
Switch<config-if> #
WORD<1-32> First parameter value
<cr>
Switch<config-if> #
WORD<1-32> Second parameter value
Example 4 - The following example shows how to set the duplex mode of port gi1
to full and to set its speed to 100 Mb/s.
switch<config-if>#
switch<config-if>#
macro apply
macro apply
interface
macro apply
duplex $DUPLEX ?
duplex $DUPLEX full $SPEED ?
gi1
duplex $DUPLEX full $SPEED 100
3.2macro apply
Use the macro apply/trace Interface Configuration command to either:
•Apply a macro to an interface without displaying the actions being
performed
• Apply a macro to the interface while displaying the actions being
•trace—Apply and trace a macro to the specific interface.
•macro-name—Name of the macro.
•
parameter-name value
macro, specify its name and value. You can enter up to three
parameter-value pairs. Parameter keyword matching is case sensitive. All
matching occurrences of the parameter name in the macro are replaced
with the corresponding value.
—(Optional) For each parameter defined in the
78-20269-01 Command Line Interface Reference Guide53
Page 53
Macro Commands
3
Default Configuration
The command has no default setting.
Command Mode
Interface Configuration mode
User Guidelines
The macro apply Interface Configuration mode command hides the commands of
the macro from the user while it is being run. For debugging purposes, the macro
trace command displays the commands along with any errors which are
generated by them as they are executed." In this way, you can debug the macro
and find syntax or configuration errors.
When you run a macro, if commands in it fail because of a syntax or configuration
error, the macro continues to apply the remaining commands to the interface.
If you apply a macro that contains parameters in its commands, the command fails
if you do not provide the values for the parameters. You can use the macro apply
macro-name
have defined these with the #macro keywords preprocessor command).
with a '?' to display the help string for the macro keywords (if you
Parameter (keyword) matching is case sensitive. All matching occurrences of the
parameter are replaced with the provided value. Any full match of a keyword, even
if it is part of a large string, is considered a match and replaced by the
corresponding value.
When you apply a macro to an interface, the switch automatically generates a
macro description command with the macro name. As a result, the macro name is
appended to the macro history of the interface. You can display the macro history
of an interface using the show parser macro description command.
A macro applied to an interface range behaves the same way as a macro applied
to a single interface. When a macro is applied to an interface range, it is applied
sequentially to each interface within the range. If a macro command fails on one
interface, it is nonetheless applied to the remaining interfaces.
Examples.
Example 1 - The following is an example of a macro being applied to an interface
with the trace option.
Switch(config) #
Switch<config-if> #
interface
macro trace dup
gi2
Applying command… ‘duplex full’
78-20269-01 Command Line Interface Reference Guide54
Page 54
Macro Commands
3
Applying command… ‘speed 100’
Switch<config-if> #
Example 2 - The following is an example of a macro being applied without the
trace option.
Switch(config) #
Switch<config-if> #
Switch<config-if> #
interface
macro apply
gi2
duplex $DUPLEX full $SPEED 100
Example 3 - The following is an example of an incorrect macro being applied.
switch(config-if)#
Applying command...'duplex full'
Applying command...'speed auto'
% bad parameter value
macro trace dup
3.3macro description
Use the macro description Interface Configuration mode command to append a
description, for example, a macro name, to the macro history of an interface. Use
the no form of this command to clear the macro history of an interface. When the
macro is applied to an interface, the switch automatically generates a macro
description command with the macro name. As a result, the name of the macro is
appended to the macro history of the interface.
Syntax
macro description
text
no macro description
Parameters
text—Description text. The text can contain up to 160 characters. The text must be
double quoted if it contains multiple words.
Default Configuration
The command has no default setting.
78-20269-01 Command Line Interface Reference Guide55
Page 55
Macro Commands
3
Command Mode
Interface Configuration mode
User Guidelines
When multiple macros are applied on a single interface, the description text is a
concatenation of texts from a number of previously-applied macros.
You can verify your setting by entering the show parser macro description
privileged EXEC mode command.
are specific to the switch. You can enter up to three parameter-value pairs.
Parameter keyword matching is case sensitive. All matching occurrences of
the parameters are replaced with the corresponding value.
Default Configuration
The command has no default setting.
Command Mode
Global Configuration mode
value
—(Optional) Specify unique parameter values that
]
User Guidelines
You can use the macro global trace macro-name Global Configuration mode
command to apply and show the macros running on the switch or to debug the
macro in order to locate any syntax or configuration errors.
If a command fails because of a syntax error or a configuration error when you
apply a macro, the macro continues to apply the remaining commands to the
switch.
Use the parameter-name, value keywords to designate values specific to the
switch when creating a macro that requires the assignment of unique value.
Keyword matching is case sensitive. All matching occurrences of the keyword are
replaced with the corresponding value. Any full match of a keyword, even if it is
part of a large string, is considered a match and replaced by the corresponding
value.
78-20269-01 Command Line Interface Reference Guide57
Page 57
Macro Commands
3
If you apply a macro that contains keywords in its commands, the command fails if
you do not specify the proper values for the keywords when you apply the macro.
You can use the macro global apply macro-name with a '?' to display the help
string for the macro keywords. You define the keywords in the help string using the
preprocessor command #macro keywords when you define a macro.
When you apply a macro in Global Configuration mode, the switch automatically
generates a global macro description command with the macro name. As a result,
the macro name is appended to the global macro history. You can display the
global macro history using the show parser macro description command.
Example.
The following is an example of a macro being defined and then applied to the
switch with the trace option.
Switch(config)#
Enter macro commands one per line. End with the character ‘@’.
line console
exec-timeout $timeout-interval
@
Switch(config)#
Applying command… ‘line console’
Applying command… ‘exec-timeout 100’
Switch(config)#
macro name
macro global trace
console-timeout
console-timeout $timeout-interval 100
3.5macro global description
Use the macro global description Global Configuration command to enter a
description which is used to indicate which macros have been applied to the
switch. Use the no form of this command to remove the description.
Syntax
macro global description
no macro global description
Parameters
text—Description text. The text can contain up to 160 characters.
78-20269-01 Command Line Interface Reference Guide58
text
Page 58
Macro Commands
3
Default Configuration
The command has no default setting.
Command Mode
Global Configuration mode
User Guidelines
When multiple global macros are applied to a switch, the global description text is
a concatenation of texts from a number of previously applied macros.
You can verify your settings by entering the show parser macro description
privileged EXEC mode command.
Examples
Switch(conf)#
macro global description
"set console timeout interval"
3.6show parser macro
Use the show parser macro User EXEC mode command to display the parameters
for all configured macros or for one macro on the switch.
Syntax
show parser macro [
macro-name}
Parameters
•brief
]
—
Display the name of all macros.
•description [interface
interfaces or if an interface is specified, display the macro descriptions for
that interface.
•name
the macro name.
macro-name—
{brief | description [interface interface-id] | name
interface-id]—
Display information about a single macro identified by
Display the macro descriptions for all
Command Mode
User EXEC mode
78-20269-01 Command Line Interface Reference Guide59
Page 59
Macro Commands
3
Examples
Example 1 - This is a partial output example from the show parser macro
command.
78-20269-01 Command Line Interface Reference Guide61
show parser macro description interface
gi2
Page 61
RSA and Certificate Commands
4RSA and Certificate Commands
4.1crypto key generate dsa
The crypto key generate dsa Global Configuration mode command generates
DSA key pairs.
Syntax
crypto key generate dsa
Default Configuration
DSA key pairs do not exist.
Command Mode
4
Global Configuration mode
User Guidelines
DSA keys are generated in pairs - one public DSA key and one private DSA key.
If the device already has DSA keys, a warning is displayed with a prompt to
replace the existing keys with new keys.
This command is not saved in the router configuration. However, the keys
generated by this command are saved in the private configuration (which is never
displayed to the user or backed up to another device).
Example
The following example generates DSA key pairs.
Console(config)#
crypto key generate dsa
4.2crypto key generate rsa
The crypto key generate rsa Global Configuration mode command generates RSA
key pairs.
Syntax
crypto key generate rsa
78-20269-01 Command Line Interface Reference Guide62
Page 62
RSA and Certificate Commands
Default Configuration
RSA key paris do not exist.
Command Mode
Global Configuration mode
User Guidelines
RSA keys are generated in pairs - one public RSA key and one private RSA key.
If the device already has RSA keys, a warning is displayed with a prompt to
replace the existing keys with new keys.
This command is not saved in the router configuration; however, the keys
generated by this command are saved in the private configuration (which is never
displayed to the user or backed up to another device).
4
Example
The following example generates RSA key pairs.
Console(config)#
crypto key generate rsa
4.3show crypto key mypubkey
The show crypto key mypubkey Privileged EXEC mode command displays the
device SSH public keys.
Syntax
show crypto key mypubkey
Parameters
[rsa | dsa]
•rsa—Displays the RSA key.
•dsa—Displays the DSA key.
Command Mode
Privileged EXEC mode
78-20269-01 Command Line Interface Reference Guide63
Page 63
RSA and Certificate Commands
Example
The following example displays the SSH public RSA keys on the device.
•number—Specifies the certificate number. (Range: 1–2)
•key-generate—Regenerates SSL RSA key.
•length—Specifies the SSL's RSA key length. (Range: 512–2048)
•passphrase string—Specifies the passphrase used for exporting the
certificate in PKCS12 file format. (Length: 8–96 characters)
•cn common-name—Specifies the fully qualified device URL or IP address.
(Length: 1–64 characters)
•ou organization-unit—Specifies the organization-unit or department name.
(Length: 1–64 characters)
•or organization—Specifies the organization name. (Length: 1–64
characters)
78-20269-01 Command Line Interface Reference Guide64
Page 64
RSA and Certificate Commands
Default Configuration
The default certificate number is 1.
The default SSL’s RSA key length is 1024.
If passphrase string is not specified, the certificate is not exportable.
If cn common-name is not specified, it defaults to the device’s lowest static IPv6
address (when the certificate is generated), or to the device’s lowest static IPv4
address if there is no static IPv6 address, or to 0.0.0.0 if there is no static IP
address.
4
•loc location—Specifies the location or city name. (Length: 1–64 characters)
•st state—Specifies the state or province name. (Length: 1–64 characters)
•cu country—Specifies the country name. (Length: 2 characters)
•duration days—Specifies the number of days a certification is valid. (Range:
30–3650)
If duration days is not specified, it defaults to 365 days.
Command Mode
Global Configuration mode
User Guidelines
This command is not saved in the router configuration. However, the certificate and
keys generated by this command are saved in the private configuration (which is
never displayed to the user or backed up to another device).
When exporting a RSA key pair to a PKCS#12 file, the RSA key pair is as secure as
the passphrase. Keep the passphrase secure.
If the RSA key does not exist, you must use the parameter key-generate.
Example
The following example generates a self-signed certificate for HTTPS.
Console#
crypto certificate generate key-generate
78-20269-01 Command Line Interface Reference Guide65
Page 65
RSA and Certificate Commands
4.5crypto certificate request
The crypto certificate request Privileged EXEC mode command generates and
displays a certificate request for HTTPS.
•number—Specifies the certificate number. (Range: 1–2)
•common-name—Specifies the device’s fully qualified URL or IP address.
(Length: 1–64 characters)
•ou
•or
•loc
•st
•cu
Command Mode
Privileged EXEC mode
organization-unit
(Length: 1–64 characters)
organization
location
state
country
—Specifies the location or city name. (Length: 1–64 characters)
—Specifies the state or province name. (Length: 1–64 characters)
—Specifies the country name. (Length: 2 characters)
—Specifies the organization-unit or department name.
—Specifies the organization name. (Length: 1–64 characters)
User Guidelines
Use this command to export a certificate request to a Certification Authority. The
certificate request is generated in Base64-encoded X.509 format.
Before generating a certificate request, first generate a self-signed certificate
using the crypto certificate generate Global Configuration mode command to
generate the keys. The certificate fields must be re-entered.
After receiving the certificate from the Certification Authority, use the crypto
certificate import Global Configuration mode command to import the certificate
into the device. This certificate replaces the self-signed certificate.
78-20269-01 Command Line Interface Reference Guide66
Page 66
RSA and Certificate Commands
Example
The following example displays the certificate request for HTTPS.
The crypto certificate import Global Configuration mode command imports a
certificate signed by a Certification Authority for HTTPS.
Syntax
crypto certificate
Parameters
number—Specifies the certificate number. (Range: 1–2)
78-20269-01 Command Line Interface Reference Guide67
number
import
Page 67
RSA and Certificate Commands
Command Mode
Global Configuration mode
User Guidelines
To end the session, use a blank line.
The imported certificate must be based on a certificate request created by the
crypto certificate request privileged EXEC command.
If the public key found in the certificate does not match the device's SSL RSA key,
the command fails.
This command is not saved in the router configuration. However, the certificate
imported by this command is saved in the private configuration (which is never
displayed to the user or backed up to another device).
Example
4
The following example imports a certificate signed by Certification Authority for
HTTPS.
•ipv6-address—Unicast or Multicast IPv6 address to ping. When the IPv6
address is a Link Local address (IPv6Z address), the outgoing interface
name must be specified. Refer to the User Guidelines of this command for
the interface name syntax.
•hostname—Hostname to ping (160 characters. Maximum label size: 63.)
•size
packet_size
tag. The default is 64 bytes. (IPv4:64–1518, IPv6: 68–1518)
—Number of bytes in the packet not including the VLAN
•count
The default is 4 packets. If 0 is entered, it pings until stopped (0–65535).
•time
65535 milliseconds. The default is 2000 milliseconds (50–65535).
Default Usage
N/A
Command Mode
EXEC mode
78-20269-01 Command Line Interface Reference Guide71
packet_count
time-out
—Timeout in milliseconds to wait for each reply, from 50 to
—Number of packets to send, from 1 to 65535 packets.
Page 71
System Management Commands
User Guidelines
Press Esc to stop pinging. Following are sample results of the ping command:
5
•Destination does not respond—If the host does not respond, a “no answer
from host” appears within 10 seconds.
•Destination unreachable—The gateway for this destination indicates that
the destination is unreachable.
•Network or host unreachable—The switch found no corresponding entry in
the route table.
The format of an IPv6Z address is: <
•interface-name =
<physical-port-name> | 0
•integer = <
decimal-number> | <integer><decimal-number
•decimal-number =
vlan<integer> | po<integer> | isatap<integer> |
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
ipv6-link-local-address>%<interface-name
>
>
•physical-port-name = Designated port number, for example gi1. If the
physical-port-name = 0, then it is not defined and the default interface is
used
.
When using the ping ipv6 command to check network connectivity of a directly
attached host using its link local address, the egress interface may be specified in
the IPv6Z format. If the egress interface is not specified, the default interface is
selected.
When using the ping ipv6 command with a Multicast address, the information
displayed is taken from all received echo responses.
Examples
Example 1- Ping an IP address.
Console>
Pinging 10.1.1.1 with 64 bytes of data:
64 bytes from 10.1.1.1: icmp_seq=0. time=11 ms
64 bytes from 10.1.1.1: icmp_seq=1. time=8 ms
64 bytes from 10.1.1.1: icmp_seq=2. time=8 ms
64 bytes from 10.1.1.1: icmp_seq=3. time=7 ms
78-20269-01 Command Line Interface Reference Guide72
ping ip
10.1.1.1
Page 72
System Management Commands
----10.1.1.1 PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms) min/avg/max = 7/8/11
Example 2 - Ping a site.
5
Console>
Pinging yahoo.com [66.218.71.198] with 64 bytes of data:
64 bytes from 10.1.1.1: icmp_seq=0. time=11 ms
64 bytes from 10.1.1.1: icmp_seq=1. time=8 ms
64 bytes from 10.1.1.1: icmp_seq=2. time=8 ms
64 bytes from 10.1.1.1: icmp_seq=3. time=7 ms
----10.1.1.1 PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms) min/avg/max = 7/8/11
ping ip
yahoo.com
Example 3 - Ping an IPv6 address.
console>
Pinging 3003::11 with 64 bytes of data:
64 bytes from 3003::11: icmp_seq=1. time=0 ms
64 bytes from 3003::11: icmp_seq=2. time=50 ms
ping ipv6
3003::11
64 bytes from 3003::11: icmp_seq=3. time=0 ms
64 bytes from 3003::11: icmp_seq=4. time=0 ms
----3003::11 PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/12/50
console>
Pinging FF02::1 with 64 bytes of data:
64 bytes from 3003::11: icmp_seq=1. time=0 ms
78-20269-01 Command Line Interface Reference Guide73
ping ipv6
FF02::1
Page 73
System Management Commands
64 bytes from 3003::33: icmp_seq=1. time=70 ms
64 bytes from 3003::11: icmp_seq=2. time=0 ms
64 bytes from 3003::55: icmp_seq=1. time=1050 ms
64 bytes from 3003::33: icmp_seq=2. time=70 ms
64 bytes from 3003::55: icmp_seq=2. time=1050 ms
64 bytes from 3003::11: icmp_seq=3. time=0 ms
64 bytes from 3003::33: icmp_seq=3. time=70 ms
64 bytes from 3003::11: icmp_seq=4. time=0 ms
64 bytes from 3003::55: icmp_seq=3. time=1050 ms
64 bytes from 3003::33: icmp_seq=4. time=70 ms
64 bytes from 3003::55: icmp_sq=4. time=1050 ms
5
---- FF02::1 PING Statistics----
4 packets transmitted, 12 packets received
5.2traceroute
To display the routes that packets will take when traveling to their destination, use
the traceroute EXEC mode command.
Syntax
traceroute ip
packet_count] [timeout time_out] [source ip-address] [tos tos
traceroute ipv6
packet_count] [timeout time_out] [source ip-address] [tos tos
•ipv4-address—IPv4 address of the destination host. (Range: Valid IP
address)
•ipv6-address—IPv6 address of the destination host.
78-20269-01 Command Line Interface Reference Guide74
Page 74
System Management Commands
5
•hostname—Hostname of the destination host. (Range: 1–160 characters.
Maximum label size: 63)
•size
•ttl
packet_size
tag. The default is 64 bytes. (IPv4:64-1518, IPv6: 68-1518)
max-ttl
traceroute command terminates when the destination is reached or when
this value is reached. (Range: 1–255)
•count
The default count is 3. (Range: 1–10)
•timeout
packet. The default is 3 seconds. (Range: 1–60)
•source
a source address for the probes. The device selects the optimal source
address by default. (Range: Valid IP address)
•tos
Default Usage
N/A
tos
0–255)
—Number of bytes in the packet not including the VLAN
—The largest TTL value that can be used. The default is 30. The
packet_count
time_out
ip-address
—The Type-Of-Service byte in the IP Header of the packet. (Range:
—The number of probes to be sent at each TTL level.
—The number of seconds to wait for a response to a probe
—One of the interface addresses of the device to use as
Command Mode
EXEC mode
User Guidelines
The traceroute command works by taking advantage of the error messages
generated by routers when a datagram exceeds its time-to-live (TTL) value.
The traceroute command starts by sending probe datagrams with a TTL value of
one. This causes the first router to discard the probe datagram and send back an
error message. The traceroute command sends several probes at each TTL level
and displays the round-trip time for each.
The traceroute command sends out one probe at a time. Each outgoing packet can
result in one or two error messages. A "time exceeded” error message indicates
that an intermediate router has seen and discarded the probe. A "destination
unreachable" error message indicates that the destination node has received the
probe and discarded it because it could not deliver the packet. If the timer goes
off before a response comes in, the traceroute command prints an asterisk (*).
78-20269-01 Command Line Interface Reference Guide75
Page 75
System Management Commands
The traceroute command terminates when the destination responds, when the
maximum TTL is exceeded, or when the user interrupts the trace with Esc.
The traceroute command is not relevant to IPv6 link local addresses.
Example
5
Router>
Type Esc to abort.
Tracing the route to umaxp1.physics.lsa.umich.edu (141.211.101.64)
The following table describes the significant fields shown in the display:
FieldDescription
1Indicates the sequence number of the router
in the path to the host.
i2-gateway.stanford.
edu
192.68.191.83IP address of this router.
1 msec 1 msec 1
msec
78-20269-01 Command Line Interface Reference Guide76
Host name of this router.
Round-trip time for each of the probes that
are sent.
Page 76
System Management Commands
The following are characters that can appear in the traceroute command output:
FieldDescription
*The probe timed out.
?Unknown packet type.
AAdministratively unreachable. Usually, this output
FFragmentation required and DF is set.
HHost unreachable.
NNetwork unreachable.
PProtocol unreachable.
QSource quench.
5
indicates that an access list is blocking traffic.
RFragment reassembly time exceeded
SSource route failed.
UPort unreachable.
5.3telnet
The telnet EXEC mode command enables logging on to a host that supports
Te l n e t .
Syntax
telnet {
Parameters
ip-address
•ip-address
•hostname
Maximum label length: 63 characters.)
|
hostname
—
Specifies the destination host IP address (IPv4 or IPv6).
—
Specifies the destination host name. (Length: 1-160 characters.
} [
port
] [
keyword
...]
•port
78-20269-01 Command Line Interface Reference Guide77
—
Specifies the decimal TCP port number or one of the keywords
listed in the Ports table in the User Guidelines.
Page 77
System Management Commands
Default Configuration
The default port is the Telnet port (23) on the host.
By default, Telnet is disabled.
Command Mode
EXEC mode
User Guidelines
Telnet software supports special Telnet commands in the form of Telnet
sequences that map generic terminal control functions to operating
system-specific functions. To enter a Telnet sequence, press the escape
sequence keys (Ctrl-shift-6) followed by a Telnet command character.
5
•keyword—Specifies the one or more keywords listed in the Keywords
table in the User Guidelines.
Special Telnet Sequences
Telnet SequencePurpose
Ctrl-shift-6-bBreak
Ctrl-shift-6-cInterrupt Process (IP)
Ctrl-shift-6-hErase Character (EC)
Ctrl-shift-6-oAbort Output (AO)
Ctrl-shift-6-tAre You There? (AYT)
Ctrl-shift-6-uErase Line (EL)
At any time during an active Telnet session, available Telnet commands can be
listed by pressing the
A sample of this list follows.
Console> ?
/help
?/help
keys at the system prompt.
[Special telnet escape help]
^^ B sends telnet BREAK
^^ C sends telnet IP
78-20269-01 Command Line Interface Reference Guide78
Page 78
System Management Commands
^^ H sends telnet EC
^^ O sends telnet AO
^^ T sends telnet AYT
^^ U sends telnet EL
?/help suspends the session (return to system command prompt)
Several concurrent Telnet sessions can be opened, enabling switching between
the sessions. To open a subsequent session, the current connection has to be
suspended by pressing the escape sequence keys (Ctrl-shift-6) and x to return to
the system command prompt. Then open a new connection with the telnet EXEC
mode command.
This command lists concurrent Telnet connections to remote hosts that were
opened by the current Telnet session to the local device. It does not list Telnet
connections to remote hosts that were opened by other Telnet sessions.
5
Keywords Table
OptionsDescription
/echoEnables local echo.
/quiet Prevents onscreen display of all messages from
the software.
/source-interfaceSpecifies the source interface.
/streamTurns on stream processing, which enables a raw
TCP stream with no Telnet control sequences. A
stream connection does not process Telnet
options and can be appropriate for connections
to ports running UNIX-to-UNIX Copy Program
(UUCP) and other non-Telnet protocols.
Ctrl-shift-6 xReturns to the System Command Prompt.
Ports Table
KeywordDescriptionPort Number
BGPBorder Gateway Protocol179
chargenCharacter generator19
78-20269-01 Command Line Interface Reference Guide79
Page 79
System Management Commands
KeywordDescriptionPort Number
cmdRemote commands514
daytimeDaytime13
discardDiscard9
domainDomain Name Service53
echoEcho7
execExec512
fingerFinger79
ftpFile Transfer Protocol21
ftp-dataFTP data connections20
5
gopherGopher70
hostnameNIC hostname server101
identIdent Protocol113
ircInternet Relay Chat 194
kloginKerberos login543
kshellKerberos shell544
loginLogin513
lpdPrinter service515
nntpNetwork News Transport
Protocol
pim-auto-rpPIM Auto-RP496
pop2Post Office Protocol v2109
pop3Post Office Protocol v3110
119
smtpSimple Mail Transport
Protocol
sunrpcSun Remote Procedure Call111
78-20269-01 Command Line Interface Reference Guide80
25
Page 80
System Management Commands
KeywordDescriptionPort Number
syslogSyslog514
tacacsTAC Access Control System49
talkTalk517
telnetTelnet23
timeTime37
uucpUnix-to-Unix Copy Program540
whoisNickname43
wwwWorld Wide Web80
Example
5
The following example displays logging in to IP address 176.213.10.50 via Telnet.
Console>
telnet
176.213.10.50
5.4resume
The resume EXEC mode command enables switching to another open Telnet
session.
Syntax
resume [
Parameters
connection—Specifies the connection number. (Range: 1-4 connections.)
Default Configuration
The default connection number is that of the most recent connection.
connection
]
Command Mode
EXEC mode
78-20269-01 Command Line Interface Reference Guide81
Page 81
System Management Commands
Example
The following command switches to open Telnet session number 1.
5
Console>
resume
1
5.5hostname
The hostname Global Configuration mode command specifies or modifies the
device host name. Use the no form of the command to remove the existing host
name.
Syntax
hostname
no hostname
Parameters
Name—Specifies the device host name. (Length: 1-63). The hostname must start
with a letter, end with a letter or digit, and have as interior characters only letters,
digits, and hyphens.
Default Configuration
name
No host name is defined.
Command Mode
Global Configuration mode
Example
The following example specifies the device host name as ‘enterprise’.
Console(config)#
enterprise(config)#
hostname
enterprise
5.6reload
The reload Privileged EXEC mode command reloads the operating system.
78-20269-01 Command Line Interface Reference Guide82
Page 82
System Management Commands
Syntax
reload
Parameters
N/A
Default Usage
N/A
Command Mode
Privileged EXEC mode
Example
The following example reloads the operating system.
5
Console#
This command will reset the whole system and disconnect your current session.
Do you want to continue? (y/n) [n]
reload
5.7service cpu-utilization
The service cpu-utilization Global Configuration mode command enables
measuring CPU utilization. Use the no form of this command to restore the default
configuration.
Syntax
service cpu-utilization
no service cpu-utilization
Parameters
N/A
Default Configuration
Measuring CPU utilization is disabled.
78-20269-01 Command Line Interface Reference Guide83
Page 83
System Management Commands
Command Mode
Global Configuration mode
User Guidelines
Use the service cpu utilization command to measure information on CPU
utilization.
Example
The following example enables measuring CPU utilization.
5
Console(config)#
service cpu-utilization
5.8show cpu utilization
The show cpu utilization Privileged EXEC mode command displays information
about CPU utilization.
Syntax
show cpu utilization
Parameters
N/A
Default Usage
N/A
Command Mode
Privileged EXEC mode
User Guidelines
Use the show cpu-utilization command to enable measuring CPU utilization.
Example
The following example displays CPU utilization information.
78-20269-01 Command Line Interface Reference Guide84
five seconds: 5%; one minute: 3%; five minutes: 3%
show cpu utilization
5.9show users
The show users EXEC mode command displays information about the active
users.
Syntax
show users
Parameters
N/A
Default Usage
N/A
Command Mode
EXEC mode
78-20269-01 Command Line Interface Reference Guide85
Page 85
System Management Commands
Example
The following example displays information about the active users.
5
Console#
Username
----------
Bob
John
Robert
Betty
Sam
show users
Protocol
-----------
Serial
SSH
HTTP
Telnet
Location
------------
172.16.0.1
172.16.0.8
172.16.1.7
172.16.1.6
5.10show sessions
The show sessions EXEC mode command displays open Telnet sessions.
Syntax
show sessions
Parameters
N/A
Default Usage
N/A
Command Mode
EXEC mode
User Guidelines
The show sessions command displays Telnet sessions to remote hosts opened by
the current Telnet session to the local device. It does not display Telnet sessions to
remote hosts opened by other Telnet sessions to the local device.
78-20269-01 Command Line Interface Reference Guide86
Page 86
System Management Commands
Example
The following example displays open Telnet sessions.
5
Console#
Connection
----------
1
2
show sessions
Host
-------------
Remote router
172.16.1.2
Address
----------
172.16.1.1
172.16.1.2
Port
-----
23
23
Byte
----
89
8
The following table describes significant fields shown above.
FieldDescription
ConnectionThe connection number.
HostThe remote host to which the device is connected
through a Telnet session.
AddressThe remote host IP address.
PortThe Telnet TCP port number.
ByteThe number of unread bytes for the user to see on
the connection.
5.11show system
The show system EXEC mode command displays system information.
Syntax
show system
Parameters
There are no parameters for this command.
Command Mode
EXEC mode
78-20269-01 Command Line Interface Reference Guide87
Page 87
System Management Commands
Example
The following example displays the system information.
5
console#
switch151400(config)#exit
switch151400#show system
System Description: 20-port Gigabit Managed Switch
System Up Time (days,hour:min:sec): 03,02:27:46
System Contact:
System Name: switch151400
System Location:
System MAC Address: 00:24:ab:15:14:00
System Object ID: 1.3.6.1.4.1.9.6.1.83.20.1
show system
5.12show version
The show version EXEC mode command displays system version information.
Syntax
show version
Parameters
N/A
Default Usage
N/A
Command Mode
EXEC mode
Example
The following example displays system version information.
78-20269-01 Command Line Interface Reference Guide88
Page 88
System Management Commands
5
console >
SW Version 1.1.0.5 ( date 15-Sep-2010 time 10:31:33 )
Boot Version 1.1.0.2 ( date 04-Sep-2010 time 21:51:53 )
HW Version V01
show version
5.13show version md5
Use the show version md5 EXEC mode command to display external MD5 digest
of firmware.
Syntax
show version md5
Parameters
N/A
Default Usage
N/A
Command Mode
EXEC mode
Example
>
show version md5
FilenameStatusMD5 Digest
-------------------------------------------------
image1Active23FA000012857D8855AABC7577AB5562
image2Not Active23FA000012857D8855AABEA7451265456
boot23FA000012857D8855AABC7577AB8999
mage1Not Active23FA000012857D8855AABC757FE693844
image2Active23FA000012857D8855AABC7577AB5562
boot23FA000012857D8855AABC7577AC9999
78-20269-01 Command Line Interface Reference Guide89
Page 89
System Management Commands
5.14system resources routing
The system resources routing Global Configuration mode command configures
the routing table maximum size. Use the no form of this command to return to the
default size.
Syntax
5
system resources routing
no system resources routing
Parameters
routes hosts interfaces
•routes—Specifies the maximum number of remote networks in the routing
table.
•hosts—Specifies the maximum number of directly attached hosts.
•interfaces—Specifies the maximum number of IP interfaces.
Default Configuration
Hosts: 2-100, default = 100
Routes: 1-32, default = 32
IP Interfaces: 2-32, default = 32
Command Mode
Global Configuration mode
User Guidelines
The settings are effective after reboot.
Example
The following example configures the routing table maximum size.
Console#
78-20269-01 Command Line Interface Reference Guide90
system resources routing
20 23 5
Page 90
System Management Commands
5.15show system resources
The show system resources routings EXEC mode command displays system
routing and tcam resource information.
Syntax
5
show system resources {
Parameters
routing—Displays the number of hosts, routers and IP interfaces that are available.
tcam—Displays the number of TCAM rules that are available.
Command Mode
EXEC mode
Example
Example 1 - The following example displays the system routing resources
information. The values in the Current Value column show what resources are
currently available. The values in the After Reboot Value column show what
resources will be available after reboot as a result of system resources routing
command.
Example 2 - The following example displays the system routing resources
information. The values in the Current Value column show what resources are
currently available. The values in the After Reboot Value column show what
resources will be available after reboot as a result of system resources routing
command.
Console>
78-20269-01 Command Line Interface Reference Guide91
show system resources tcam
Page 91
System Management Commands
TCAM resources
--------------
Maximum number of miscellaneous TCAM rules: 314
Used number of miscellaneous TCAM rules: 26
Maximum number of routing TCAM rules: 196
Used number of routing TCAM rules: 3
5.16set system mode
The set system mode Privileged EXEC mode command puts the device into
switch mode (Layer 2 mode) or router mode (Layer 3 mode).
Syntax
5
set system mode {
Parameters
router | switch}
•router—Specifies that the device functions as a switch-router.
•switch—Specifies that the device functions as a switch.
Default Configuration
The default configuration is switch mode (Layer 2).
Command Mode
Privileged EXEC mode
User Guidelines
After executing the command, the Startup Configuration file is deleted and the
device is rebooted. It is highly recommended to back up the Startup Configuration
file before executing this command.
Example
The following example configures the device to function as a switch-router (Layer
3), with QoS and Policy based VLANs.
Console#
78-20269-01 Command Line Interface Reference Guide92
set system mode router
Page 92
System Management Commands
5.17show system mode
The show system mode EXEC mode command displays information on features
control.
Syntax
show system mode
Parameters
N/A
Default Usage
N/A
Command Mode
5
EXEC mode
Example
The following example displays system mode information.
Console>
Feature State
------------------- ---------
Mode: Router
Qos: Active
Policy-based-vlans: Active
show system mode
5.18show system languages
The show system languages EXEC mode command displays the list of supported
languages.
Syntax
show system languages
78-20269-01 Command Line Interface Reference Guide93
Page 93
System Management Commands
Parameters
N/A
Default Usage
N/A
Command Mode
EXEC mode
Example
The following example displays the languages configured on the device. Number
of Sections indicates the number of languages permitted on the device.
TCP172.16.1.1:23 172.16.1.18:8789 Telnet ESTABLISHED
TCP6All-23 Telnet LISTEN
78-20269-01 Command Line Interface Reference Guide95
show services tcp-udp
Page 95
System Management Commands
TCP6fe80::200:b0ff:fe00:0-23 Telnet
UDPAll:161 SNMP
UDP6All-161 SNMP
5.21show system id
The show system id EXEC mode command displays the system identity
information.
Syntax
show system id
Parameters
5
fe80::200:b0ff:fe00:0-8999 ESTABLISHED
There are no parameters for this command.
Command Mode
EXEC mode
Example
The following example displays the system identity information.
Console>
serial number 114
show system id
5.22show cpu input rate
The show cpu input rate EXEC mode command displays the rate of input frames to
the CPU in packets per seconds (pps).
Syntax
show cpu input rate
Command Mode
EXEC mode
78-20269-01 Command Line Interface Reference Guide96
Page 96
System Management Commands
User Guidelines
Example
The following example displays CPU input rate information.
5
Console#
Input Rate to CPU is 1030 pps.
show cpu input rate
78-20269-01 Command Line Interface Reference Guide97
Page 97
Clock Commands
6Clock Commands
6.1clock set
The clock set Privileged EXEC mode command manually sets the system clock.
Syntax
6
clock set
Parameters
hh:mm:ss
{[
day month
] | [
month day
]}
year
•hh:mm:ss—Specifies the current time in hours (military format), minutes,
and seconds. (Range: hh: 0-23, mm: 0-59, ss: 0-59)
•day—Specifies the current day of the month. (Range: 1-31)
•month—Specifies the current month using the first three letters of the
month name. (Range: Jan–Dec)
•year—Specifies the current year. (Range: 2000–2037)
Command Mode
Privileged EXEC mode
User Guidelines
It is recommended that the user enter the local clock time and date.
Example
The following example sets the system time to 13:32:00 on March 7th, 2005.
Console#
clock set
13:32:00 7 Mar 2005
6.2clock source
The clock source Global Configuration mode command configures an external
time source for the system clock. Use the no form of this command to disable the
external time source.
78-20269-01 Command Line Interface Reference Guide98
Page 98
Clock Commands
6
Syntax
clock source {sntp}
no clock source
Parameters
sntp—Specifies that an SNTP server is the external clock source.
Default Configuration
There is no external clock source.
Command Mode
Global Configuration mode
Example
The following example configures an SNTP server as an external time source for
the system clock.
Console(config)#
clock source sntp
6.3clock timezone
Use the clock timezone Global Configuration command to set the time zone for
display purposes. Use the no form of this command to set the time to Coordinated
Universal Time (UTC) or Greenwich Mean Time (GMT), which is the same.
Syntax
clock timezone
no clock timezone
Parameters
zone hours-offset [minutes-offset]
•zone—The acronym of the time zone.(Range: Up to 4 characters)
•hours-offset—Hours difference from UTC. (Range: (-12)–(+13))
•minutes-offset—Minutes difference from UTC. (Range: 0–59)
78-20269-01 Command Line Interface Reference Guide99
Page 99
Clock Commands
6
Default Configuration
Offsets are 0.
Acronym is empty.
Command Mode
Global Configuration mode
User Guidelines
The system internally keeps time in UTC, so this command is used only for display
purposes and when the time is manually set.
Example
console(config)#
clock timezone
abc +2 minutes 32
6.4clock summer-time
Use one of the formats of the clock summer-time Global Configuration command
to configure the system to automatically switch to summer time (Daylight Saving
Time). Use the no form of this command to configure the software not to
automatically switch to summer time.
Syntax
clock summer-time
month hh:mm}} [offset]
clock summer-time
[offset]
clock summer-time
[offset]
no clock summer-time
zone recurring {usa | eu | {week day month hh:mm week day
zone date day month year hh:mm date month year hh:mm
zone date month day year hh:mm month day year hh:mm
Parameters
•zone—The acronym of the time zone to be displayed when summer time is
in effect. (Range: up to 4 characters)
78-20269-01 Command Line Interface Reference Guide100
Page 100
Clock Commands
6
•recurring—Indicates that summer time starts and ends on the
corresponding specified days every year.
•date—Indicates that summer time starts on the first date listed in the
command and ends on the second date in the command.
•usa—The summer time rules are the United States rules.
•eu—The summer time rules are the European Union rules.
•week—Week of the month. Can be 1–4, first, last.
•day—Day of the week (first three characters by name, such as Sun).
•date—Date of the month. (Range: 1–31)
•month—Month (first three characters by name, such as Feb).
•year—year (no abbreviation). (Range: 2000–2097)
•hh:mm—Time (military format) in hours and minutes. (Range: hh:mmhh: 0-23,
mm: 0-59)
•offset—Number of minutes to add during summer time (default is 60).
(Range: 1440)
Default Configuration
Summer time is disabled.
Command Mode
Global Configuration mode
User Guidelines
In both the date and recurring forms of the command, the first part of the command
specifies when summer time begins, and the second part specifies when it ends.
All times are relative to the local time zone. The start time is relative to standard
time. The end time is relative to summer time. If the starting month is
chronologically after the ending month, the system assumes that you are in the
southern hemisphere.
USA rules for Daylight Saving Time:
•From 2007:
-Start: Second Sunday in March
-End: First Sunday in November
78-20269-01 Command Line Interface Reference Guide101
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.