When configuring CLI,
go to these sections for information you are interested in:
l
Introduction to the CLI
l
Command Hierarchy
l
CLI Views
l
CLI Features
A command line interface (CLI) is a user
interface to interact with a switch. Through the CLI on a switch, a user can
enter commands to configure the switch and check output information to verify
the configuration. Each S5600 series Ethernet switch provides an easy-to-use
CLI and a set of configuration commands for the convenience of the user to
configure and manage the switch.
The CLI on S5600 series Ethernet switches
provides the following features, and so has good manageability and operability.
l
Hierarchical command protection: After users of
different levels log in, they can only use commands at their own, or lower,
levels. This prevents users from using unauthorized commands to configure
switches.
l
Online help: Users can gain online help at any
time by entering a question mark (?).
l
Debugging: Abundant and detailed debugging
information is provided to help users diagnose and locate network problems.
l
Command history function: This enables users to
check the commands that they have lately executed and re-execute the commands.
l
Partial matching of commands: The system will
use partially matching method to search for commands. This allows users to
execute a command by entering partially-spelled command keywords as long as the
keywords entered can be uniquely identified by the system.
I. Command level
The S5600 series Ethernet switches use
hierarchical command protection for command lines, so as to inhibit users at
lower levels from using higher-level commands to configure the switches.
Based on user privilege, commands are
classified into four levels, which default to:
l
Visit level (level 0): Commands at this level
are mainly used to diagnose network, and they cannot be saved in configuration
file. For example, ping, tracert and telnet are level 0
commands.
l
Monitor level (level 1): Commands at this level
are mainly used to maintain the system and diagnose service faults, and they cannot
be saved in configuration file. Such commands include debugging and terminal.
l
System level (level 2): Commands at this level
are mainly used to configure services. Commands concerning routing and network
layers are at this level. These commands can be used to provide network
services directly.
l
Manage level (level 3): Commands at this level
are associated with the basic operation modules and support modules of the
system. These commands provide support for services. Commands concerning file
system, FTP/TFTP/XModem downloading, user management, and level setting are at
this level.
II. User privilege level
Users logged into the switch fall into four
user privilege levels, which correspond to the four command levels respectively.
Users at a specific level can only use the commands at the same level or lower
levels.
By default, the Console user (a user who logs
into the switch through the Console port) is a level-3 user, and Telnet users
are level-0 users.
You can use the user privilege level
command to set the default user privilege level for users logging in through a
certain user interface. For details, refer to Login Operation.
If a user logs in using AAA authentication, the user privilege level
depends on the configuration of the AAA scheme. For details, refer to AAA
Operation.
I. Modifying the Command Level
Commands fall into four levels: visit
(level 0), monitor (level 1), system (level 2), and manage (level 3). By using
the following command, the administrator can change the level of a command in a
specific view as required.
Follow these
steps to set the level of a command in a specific view:
|
To do…
|
Use the command…
|
Remarks
|
|
Enter system view
|
system-view
|
—
|
|
Configure the level of a command in a
specific view
|
command-privilege level level view view command
|
Required
|
Caution:
l
It is recommended not to change the level of a
command arbitrarily, for it may cause inconvenience to maintenance and
operation.
l
When you change the level of a command with
multiple keywords, you should input the keywords one by one in the order they
appear in the command syntax. Otherwise, your configuration will not take
effect.
II. Configuration example
The network administrator (a level 3 user)
wants to change some TFTP commands (such as tftp get) from level 3 to
level 0, so that general Telnet users (level 0 users) are able to download
files through TFTP.
# Change the tftp get command in
user view (shell) from level 3 to level 0. (Originally, only level 3 users can change
the level of a command.)
<Sysname> system-view
[Sysname] command-privilege level 0
view shell tftp
[Sysname] command-privilege level 0
view shell tftp 192.168.0.1
[Sysname] command-privilege level 0
view shell tftp 192.168.0.1 get
[Sysname] command-privilege level 0
view shell tftp 192.168.0.1 get bootrom.btm
After the above configuration, general
Telnet users can use the tftp get command to download file bootrom.btm
and other files from TFTP server 192.168.0.1 and other TFTP servers.
Complete the following tasks to configure
user level switching:
You can switch between user levels through
corresponding commands after logging into a switch successfully. The
high-to-low user level switching is unlimited. However, the low-to-high user
level switching requires the corresponding authentication. The super password authentication
mode and HWTACACS authentication mode are available at the same time to provide
authentication redundancy.
The configuration of authentication mode
for user level switching is performed by Level-3 users.
Follow these steps
to specify the authentication mode for user level switching:
|
To do…
|
Use the command…
|
Remarks
|
|
Enter system view
|
system-view
|
—
|
|
Enter user interface view
|
user-interface [ type ] first-number [ last-number ]
|
—
|
|
Specify
the authentication mode for user level switching
|
Super
password authentication
|
super
authentication-mode super-password
|
Optional
By default, super password authentication
is adopted for user level switching.
|
|
HWTACACS authentication
|
super
authentication-mode scheme
|
|
Super
password authentication preferred (with the HWTACACS authentication as the
backup authentication mode)
|
super
authentication-mode super-password scheme
|
|
HWTACACS authentication
preferred (with the super password authentication as the backup authentication
mode)
|
super
authentication-mode scheme super-password
|
When both the super
password authentication and the HWTACACS authentication are specified, the
device adopts the preferred authentication mode first. If the preferred
authentication mode cannot be implemented (for example, the super password is
not configured or the HWTACACS authentication server is unreachable), the
backup authentication mode is adopted.
With the super password set, you can pass
the super password authentication successfully only when you provide the super
password as prompted. If no super password is set, the system prompts “%Password
is not set” when you attempt to switch to a higher user level. In this
case, you cannot pass the super password authentication.
The following table lists the operations to
configure super password authentication for user level switching, which can
only be performed by level-3 users.
Follow these
steps to set a password for
use level switching:
|
To do…
|
Use the command…
|
Remarks
|
|
Enter
system view
|
system-view
|
—
|
|
Set the super password for user level
switching
|
super password [ level level ] { cipher | simple
} password
|
Required
By default, the super password is not set.
|
To implement HWTACACS authentication for
user level switching, a level-3 user must perform the commands listed in the
following table to configure the HWTACACS authentication scheme used for
low-to-high user level switching. With HWTACACS authentication enabled, you can
pass the HWTACACS authentication successfully only after you provide the right user
name and the corresponding password as prompted. Note that if you have passed
the HWTACACS authentication when logging in to the switch, only the password is
required.
The following table lists the operations to
configure HWTACACS authentication for user level switching, which can only be
performed by Level-3 users.
Follow these steps
to set the HWTACACS authentication scheme for user level switching:
|
To do…
|
Use the command…
|
Remarks
|
|
Enter system
view
|
system-view
|
—
|
|
Enter ISP domain view
|
domain domain-name
|
—
|
|
Set the HWTACACS authentication scheme for
user level switching
|
authentication super hwtacacs-scheme hwtacacs-scheme-name
|
Required
By default, the HWTACACS authentication
scheme for user level switching is not set.
|
When setting the
HWTACACS authentication scheme for user level switching using the authentication
super hwtacacs-scheme command, make sure the HWTACACS authentication
scheme identified by the hwtacacs-scheme-name argument already exists. Refer
to AAA Operation for information about HWTACACS authentication scheme.
Follow these steps to switch to a specific user
level:
|
To do…
|
Use the command…
|
Remarks
|
|
Switch to a specified user level
|
super [ level
]
|
Required
Execute this command in user view.
|
l
If no user level is specified in the super
password command or the super command, level 3 is used by default.
l
For security purpose, the password entered is
not displayed when you switch to another user level. You will remain at the original
user level if you have tried three times but failed to enter the correct authentication
information.
V. Configuration examples
After a general user telnets to the switch,
his/her user level is 0. Now, the network administrator wants to allow general
users to switch to level 3, so that they are able to configure the switch.
1)
Super password authentication configuration
example
# A level 3 user sets a switching password
for user level 3.
<Sysname> system-view
[Sysname] super password level 3
simple 123
# A general user telnets to the switch, and
then uses the set password to switch to user level 3.
<Sysname> super 3
Password:
User privilege level is 3, and only
those commands can be used
whose level is equal or less than
this.
Privilege note: 0-VISIT, 1-MONITOR,
2-SYSTEM, 3-MANAGE
# After configuring the switch, the general
user switches back to user level 0.
<Sysname> super 0
User privilege level is 0, and only
those commands can be used
whose level is equal or less than
this.
Privilege note: 0-VISIT, 1-MONITOR,
2-SYSTEM, 3-MANAGE
2)
HWTACACS authentication configuration example
# Configure a HWTACACS authentication
scheme named acs, and specify the user name and password used for user
level switching on the HWTACACS server defined in the scheme. Refer to AAA
Operation for detailed configuration procedures.
# Enable HWTACACS authentication for VTY 0 user
level switching.
<Sysname> system-view
[Sysname] user-interface vty 0
[Sysname-ui-vty0] super authentication-mode scheme
[Sysname-ui-vty0] quit
# Specify to adopt the HWTACACS authentication
scheme named acs for user level switching in the ISP domain named system.
[Sysname] domain system
[Sysname-isp-system] authentication
super hwtacacs-scheme acs
# Switch to user level 3 (assuming that you
log into the switch as a VTY 0 user by Telnet).
<Sysname> super 3
Username: user@system
Password:
User privilege level is 3, and only
those commands can be used
whose level is equal or less than
this.
Privilege note: 0-VISIT, 1-MONITOR,
2-SYSTEM, 3-MANAGE
CLI views are designed for different configuration
tasks. They are both correlated and distinguishing. For example, once a user logs
into a switch successfully, the user enters user view, where the user can
perform some simple operations such as checking the operation status and
statistics information of the switch. After executing the system-view
command, the user enters system view, where the user can go to other views by entering
corresponding commands.
Table 1-1 lists the CLI
views provided by S5600 series Ethernet switches, operations that can be performed
in different CLI views and the commands used to enter specific CLI views.
Table 1-1 CLI views
|
View
|
Available operation
|
Prompt example
|
Enter method
|
Quit method
|
|
User view
|
Display operation status and statistical
information of the switch
|
<Sysname>
|
Enter user view once logging into the
switch.
|
Execute the quit command to log out of the switch.
|
|
System view
|
Configure system parameters
|
[Sysname]
|
Execute the system-view command in
user view.
|
Execute the quit or return command to return to user view.
|
|
Ethernet port view
|
Configure Ethernet port parameters
|
1000 Mbps Ethernet port view:
[Sysname-GigabitEthernet1/0/1]
|
Execute the interface gigabitethernet
command in system view.
|
Execute the
quit command to return to system view.
Execute the
return command to return to user view.
|
|
Aux1/0/0 port (the console port) view
|
The S5600 series do not support
configuration on port Aux1/0/0
|
[Sysname-Aux1/0/0]
|
Execute the interface aux 1/0/0
command in system view
|
|
VLAN view
|
Configure VLAN parameters
|
[Sysname-vlan1]
|
Execute the vlan command in system
view.
|
|
VLAN interface view
|
Configure VLAN interface parameters,
including the management VLAN parameters
|
[Sysname-Vlan-interface1]
|
Execute the interface Vlan-interface
command in system view.
|
|
Loopback interface view
|
Configure loopback interface parameters
|
[Sysname-LoopBack0]
|
Execute the interface loopback
command in system view.
|
|
NULL interface view
|
Configure NULL interface parameters
|
[Sysname-NULL0]
|
Execute the interface null
command in system view.
|
|
Cascade interface view
|
Configure Cascade interface parameters
|
[Sysname-Cascade1/2/1]
|
Execute the interface Cascade command
in system view
|
|
Local user view
|
Configure local user parameters
|
[Sysname-luser-user1]
|
Execute the local-user command in
system view.
|
|
User interface view
|
Configure user interface parameters
|
[Sysname-ui-aux0]
|
Execute the user-interface command
in system view.
|
|
FTP client view
|
Configure FTP client parameters
|
[ftp]
|
Execute the ftp command in user
view.
|
|
SFTP client view
|
Configure SFTP client parameters
|
sftp-client>
|
Execute the sftp command in system
view.
|
|
MST region view
|
Configure MST region parameters
|
[Sysname-mst-region]
|
Execute the stp region-configuration
command in system view.
|
|
Cluster view
|
Configure cluster parameters
|
[Sysname-cluster]
|
Execute the cluster command in
system view.
|
|
Public key view
|
Configure the RSA public key for SSH
users
|
[Sysname-rsa-public-key]
|
Execute the rsa peer-public-key
command in system view.
|
Execute the peer-public-key end
command to return to system view.
|
|
Configure the RSA or DSA public key for
SSH users
|
[Sysname-peer-public-key]
|
Execute the public-key peer command
in system view.
|
|
Public key editing view
|
Edit the RSA public key for SSH users
|
[Sysname-rsa-key-code]
|
Execute the public-key-code begin command
in public key view.
|
Execute the public-key-code end
command to return to public key view.
|
|
Edit the RSA or DSA public key for SSH
users
|
[Sysname-peer-key-code]
|
|
DHCP address pool view
|
Configure DHCP address pool parameters
|
[Sysname-dhcp-pool-a123]
|
Execute the dhcp server ip-pool
command in system view.
|
Execute the quit command to return
to system view.
Execute the return command to
return to user view.
|
|
PIM view
|
Configure PIM parameters
|
[Sysname-pim]
|
Execute the pim command in system
view.
If multicast routing is not enabled, you
should first execute the multicast routing-enable command.
|
Execute the return command to return
to user view.
|
|
RIP view
|
Configure RIP protocol parameters
|
[Sysname-rip]
|
Execute the rip command in system
view.
|
|
OSPF view
|
Configure OSPF protocol parameters
|
[Sysname-ospf-1]
|
Execute the ospf command in system
view.
|
|
OSPF area view
|
Configure OSPF area parameters
|
[Sysname-ospf-1-area-0.0.0.1]
|
Execute the area command in OSPF
view.
|
Execute the quit command to return
to OSPF view.
Execute the return command to
return to user view.
|
|
BGP view
|
Configure BGP protocol parameters
|
[Sysname-bgp]
|
Execute the bgp command in system
view
|
Execute the quit command to return
to system view.
Execute the return command to
return to user view.
|
|
BGP IPv4 multicast address family view
|
Configure the BGP IPv4 address family
|
[Sysname-bgp-af-mul]
|
Execute the ipv4-family multicast
command in OSPF view
|
Execute the quit command to return
to BGP view.
Execute the return command to
return to user view.
|
|
Routing policy view
|
Configure routing policy
|
[Sysname-route-policy]
|
Execute the route-policy command
in system view.
|
Execute the quit command to return
to system view.
Execute the return command to
return to user view.
|
|
Basic ACL view
|
Define rules for a basic ACL (with ID
ranging from 2000 to 2999)
|
[Sysname-acl- basic-2000]
|
Execute the acl number
command in system view.
|
|
Advanced ACL view
|
Define rules for an advanced ACL (with ID
ranging from 3000 to 3999)
|
[Sysname-acl-adv-3000]
|
Execute the acl number
command in system view.
|
|
Layer 2 ACL view
|
Define rules for an layer 2 ACL (with ID
ranging from 4000 to 4999)
|
[Sysname-acl-ethernetframe-4000]
|
Execute the acl number
command in system view.
|
|
User-defined ACL view
|
Define rules for a user-defined ACL (with
ID ranging from 5000 to 5999)
|
[Sysname-acl-user-5000]
|
Execute the acl number
command in system view.
|
|
QoS profile view
|
Define QoS profile
|
[Sysname-qos-profile-a123]
|
Execute the qos-profile command in
system view.
|
|
RADIUS scheme view
|
Configure RADIUS scheme parameters
|
[Sysname-radius-1]
|
Execute the radius scheme
command in system view.
|
|
ISP domain view
|
|