HP Switch Software - Using The CLI
HP Switch Software - Using The CLI
Overview
The CLI offers these privilege levels to help protect the switch from unauthorized access:
1. Operator
2. Manager
3. Global Configuration
4. Context Configuration
When end-user use the CLI to make a configuration change, the switch writes the change to the Running-Config file in
volatile memory. This allows end-user to test their configuration changes before making them permanent. To make
changes permanent, end-user must use the write memory command to save them to the Startup-Config file in non-
volatile memory. If end-user reboot the switch without first using write memory, all changes made since the last reboot
or write memory (whichever is later) will be lost.
1/9
9/14/2021 HP Switch Software - Using the CLI
In the above case, end-user will enter the CLI at the level corresponding to the password end-user provide (operator or
manager).
If no passwords are set when end-user log onto the CLI, end-user will enter at the Manager level. For example:
HP Switch# _
HP strongly recommends that end-user configure a Manager password. If a Manager password is not
configured, then the Manager level is not password-protected, and anyone having in-band or out-of-band
access to the switch may be able to reach the Manager level and compromise switch and network security.
Note that configuring only an Operator password does not prevent access to the Manager level by intruders
who have the Operator password.
Pressing the Clear button on the front of the switch removes password protection. For this reason, it is
recommended that end-user protect the switch from physical access by unauthorized persons. If end-user
are concerned about switch security and operation, end-user should install the switch in a secure location,
such as a locked wiring closet.
Operator privileges
At the Operator level end-user can examine the current configuration and move between interfaces without being
able to change the configuration. A ">" character delimits the Operator-level prompt. For example:
HP Switch>_
Manager privileges
Manager privileges give end-user three additional levels of access: Manager, Global Configuration, and Context
Configuration. A "#" character delimits any Manager prompt. For example:
HP Switch#_
HP Switch> enable Enterenable at the Operator prompt. CLI prompt for the Manager password. The Manager prompt appears after the
Password:
Global configuration level: Provides all Operator and Manager level privileges, and enables end-user to make
configuration changes to any of the switch’s software features. The prompt for the Global Configuration level
includes the system name and "(config)". To select this level, enter the config command at the Manager
prompt. For example:
HP Switch# config
2/9
9/14/2021 HP Switch Software - Using the CLI
Context configuration level: Provides all Operator and Manager privileges, and enables end-user to make
configuration changes in a specific context, such as one or more ports or a VLAN. The prompt for the Context
Configuration level includes the system name and the selected context. For example:
HP Switch(eth-1)#
HP Switch(vlan-10)#
The Context level is useful, for example, for executing several commands directed at the same port or VLAN, or
if end-user want to shorten the command strings for a specific context area. To select this level, enter the
specific context at the Global Configuration level prompt. For example, to select the context level for an existing
VLAN with the VLAN ID of 10, end-user would enter the following command and see the indicated result:
HP Switch(config)# vlan 10
HP Switch(vlan-10)#
show
<argument>
enable
Exit from the CLI interface and terminate the console session.
exit
Manager HP Switch#
Perform system-level actions such as system control, monitoring, and diagnostic commands, plus any
Level of the Operator-level commands. For a list of available commands, enter ? at the prompt.
Global HP Switch(config)#
Execute configuration commands, plus all Operator and manager commands. For a list of available
Configuration commands, enter ? at the prompt.
Level
Context HP Switch(eth-5)#
Execute context-specific configuration commands, such as a particular VLAN or switch port. This is
Configuration useful for shortening the command strings end-user type, and for entering a series of commands for
HP Switch(vlan-100)#
Level the same context. For a list of available commands, enter ? at the prompt.
enable
Manager level HP Switch#_
, the Password prompt appears. After end-user enter the Manager password,
the system prompt appears with the # symbol:
Manager level HP Switch# config
to HP Switch(config)#
to a HP Switch(vlan-10)#
Context configuration level HP Switch(vlan-10)# interface e 3 The CLI accepts "e" as the abbreviated form of "ethernet".
to another HP Switch(int-3)#
preceding level
HP Switch(config)# exit
HP Switch# exit
HP Switch>
3/9
9/14/2021 HP Switch Software - Using the CLI
Move from any level to the HP Switch(int-3)# end
Manager level
HP Switch#
-or-
HP Switch(config)# end
HP Switch#
Moving between the CLI and the Menu interface. When moving between interfaces, the switch retains the current
privilege level (Manager or Operator). That is, if end-user are at the Operator level in the menu and select the
Command Line Interface (CLI) option from the Main Menu, the CLI prompt appears at the Operator level.
Changing parameter settings. Regardless of which interface is used (CLI, menu interface, or WebAgent), the most
recently configured version of a parameter setting overrides any earlier settings for that parameter. For example if end-
user use the menu interface to configure an IP address of "X" for VLAN 1 and later use the CLI to configure a different IP
address of "Y" for VLAN 1, then "Y" replaces "X" as the IP address for VLAN 1 in the running-config file. If end-user
subsequently execute write memory in the CLI, then the switch also stores "Y" as the IP address for VLAN 1 in the
startup-config file. (For more on the startup-config and running config files, click here to view the document "HP Switch
Software - Switch Memory and Configuration" .
Typing ? at the Manager level produces the listing in the following example:
4: The Manager-level command listing
4/9
9/14/2021 HP Switch Software - Using the CLI
When - - MORE - - appears, there are more commands in the listing. To list the next screen of commands, press the
Space bar. To list the remaining commands one-by-one, repeatedly press [Enter].
Typing ? at the Global Configuration level or the Context Configuration level produces similar results.
Use [Tab] To search for or complete a command word. end-user can use [Tab] to help end-user find CLI
commands or to quickly complete the current word in a command. To do so, type one or more consecutive
characters in a command and then press [Tab] (with no spaces allowed). For example, at the Global Configuration
level, if end-user press [Tab] immediately after typing “t”, the CLI displays the available command options that
begin with “t”. For example, enteringHP Switch(config)# t [Tab] displays the following:
HP Switch(config)# t
tacacs-server
telnet-server
tftp
time
timesync
trunk
trunk-load-balance
task-monitor
telnet
terminal
test
traceroute
traceroute6
As mentioned above, if end-user type part of a command word and press [Tab], the CLI completes the current word
(if end-user have typed enough of the word for the CLI to distinguish it from other possibilities), including
hyphenated extensions. For example, entering HP Switch(config)# port- [Tab] displays the following:
Pressing [Tab] after a completed command word lists the further options for that command. For example, entering
HP Switch(config)# qos [Tab] displays the following:
5: Using [TAB] to list more options for a command
5/9
9/14/2021 HP Switch Software - Using the CLI
Displays a listing of command Help summaries for all commands available at the current privilege level. That is, at the
Operator level, executing help displays the Help summaries only for Operator-Level commands. At the Manager level,
executing help displays the Help summaries for both the Operator and Manager levels, and so on.
For example, to list the Operator-Level commands with their purposes:
7: Context-sensitive command-list help
6/9
9/14/2021 HP Switch Software - Using the CLI
This option displays Help for any command available at the current context level.
For example, to list the Help for the interface command in the Global Configuration privilege level:
8: How to display help for a specific command
Note that trying to list the help for an individual command from a privilege level that does not include that command
results in an error message. For example, trying to list the help for the interface command while at the global
configuration level produces this result:
HP Switch# speed-duplex help
HP Switch(eth-C5-C8)#
HP Switch(eth-Trk1)#
Commands executed at configuration level for entering port and trk1 static trunk-group contexts, and resulting prompts
showing port or static trunk contexts.
HP Switch(eth-C5-C8)#
HP Switch(eth-Trk1)#
HP Switch(eth-C5-C8)# ?
HP Switch(eth-C5-C8)# ?
Lists the commands end-user can use in the port or static trunk context, plus the Manager, Operator and context
commands end-user can execute at this level.
9: Context-specific commands affecting port context
7/9
9/14/2021 HP Switch Software - Using the CLI
VLAN context. Includes VLAN-specific commands that apply only to the selected VLAN, plus Manager and Operator
commands. The prompt for this mode includes the VLAN ID of the selected VLAN. For example, if end-user had already
configured a VLAN with an ID of 100 in the switch:
HP Switch(config)# vlan 100
Lists commands end-user can use in the VLAN context, plus Manager, Operator, and context commands end-user can
execute at this level.
10: Context-specific commands affecting VLAN context
8/9
9/14/2021 HP Switch Software - Using the CLI
9/9