<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] undo sysname //Restore the default host name.
[HUAWEI] clock timezone Beijing add 08:00:00 [HUAWEI] quit
<HUAWEI> clock datetime 08:00:00 2018-12-01
<HUAWEI> display clock
2018-12-01 08:02:30+08:00
Saturday
Time Zone(Beijing) : UTC+08:00
For a switch with the management interface, configure a management IP address for the management interface.
<HUAWEI> system-view [HUAWEI] interface MEth 0/0/1 [HUAWEI-MEth0/0/1] ip address 10.10.10.2 255.255.255.0 //Management IP address for the switch [HUAWEI-MEth0/0/1] quit [HUAWEI] ip route-static 0.0.0.0 0 10.10.10.1 //Default gateway for the switch
For a switch without the management interface, configure a management IP address for a VLANIF interface.
<HUAWEI> system-view [HUAWEI] interface Vlanif 10 [HUAWEI-Vlanif10] ip address 10.10.10.2 255.255.255.0 //IP management IP address for the switch [HUAWEI-Vlanif10] quit [HUAWEI] ip route-static 0.0.0.0 0 10.10.10.1 //Default gateway for the switch
[HUAWEI] display ip interface brief *down: administratively down ^down: standby (l): loopback (s): spoofing (E): E-Trunk down The number of interface that is UP in Physical is 2 The number of interface that is DOWN in Physical is 1 The number of interface that is UP in Protocol is 2 The number of interface that is DOWN in Protocol is 1 Interface IP Address/Mask Physical Protocol NULL0 unassigned up up(s) Vlanif10 10.10.10.2/24 up up [HUAWEI] display ip routing-table Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 5 Routes : 5 Destination/Mask Proto Pre Cost Flags NextHop Interface 0.0.0.0/0 Static 60 0 RD 10.10.10.1 Vlanif10 10.0.0.0/8 Direct 0 0 D 10.0.0.1 InLoopBack0 10.0.0.1/32 Direct 0 0 D 10.0.0.1 InLoopBack0 10.10.10.0/24 Direct 0 0 D 10.10.10.2 Vlanif10 10.10.10.2/32 Direct 0 0 D 10.0.0.1 Vlanif10
<HUAWEI> system-view [HUAWEI] user-interface vty 0 4 [HUAWEI-ui-vty0-4] authentication-mode aaa //Set the authentication mode of the VTY user to AAA authentication. [HUAWEI-ui-vty0-4] protocol inbound ssh //By default, the VTY UI supports SSH. [HUAWEI-ui-vty0-4] quit [HUAWEI] aaa [HUAWEI-aaa] local-user admin password irreversible-cipher admin@123 //Create a local user with the same user name as the SSH user and set a login password for the local user. [HUAWEI-aaa] local-user admin service-type ssh terminal //Set a service type for the local user. [HUAWEI-aaa] local-user admin privilege level 15 //Set the local user level. [HUAWEI-aaa] quit [HUAWEI] ssh user admin //Create an SSH user. [HUAWEI] ssh user admin authentication-type password //Set the authentication mode of the SSH user to password authentication. [HUAWEI] ssh user admin service-type stelnet //Set a service type for the SSH user. [HUAWEI] stelnet server enable //Enable the STelnet server function on the switch.
Ensure that the name of the SSH user is the same as that of the local user.
This section describes only how to use password authentication to implement login to a switch through STelnet. For more detailed operations about how to implement remote login through Telnet or STelnet, see Configuring Telnet Login or Configuring STelnet Login.
<HUAWEI> system-view [HUAWEI] display current-configuration | include ip ip address 10.10.10.2 255.255.255.0 ip route-static 0.0.0.0 0.0.0.0 10.10.10.1
You can use the following commands to view system information: