Configuring System Information on S Series Switches
Introduction
This document describes how to set the system parameters on s series switches. Below are the tasks that are performed in this document.
- Set the name of the switch.
- Set the date and time of the switch.
- Set the location and time zone of the switch.
- View the date and time of the switch.
- Set the management IP address and default gateway of the switch.
- View the IP routing information.
- Configure login through STelnet.
- View configuration information about the current switch.
NOTE:
- The information in this document is based on equipment in a specific lab environment. All devices used in this document are initially launched with the default configuration. Failure to do so may result in some or all of the steps in this document failing. If you are using a real network, make sure you understand the potential impact of all commands.
- This document uses the S5700 series switches as an example to describe the basic information of configuring the system. Different versions of the switch may have different operations. Please refer to the specific product documentation.
Procedure
- Run the sysname host-name command to set the name of the switch.
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] undo sysname //Restore the default host name. [HUAWEI] quit
- Run the clock datetime command to set the current time and date.
<HUAWEI> clock datetime 08:00:00 2018-12-01
- Run the clock timezone command to set the location and time zone of the switch.
<HUAWEI> system-view [HUAWEI] clock timezone Beijing add 08:00:00
- Run the display clock command to view the current system date and clock.
[HUAWEI] display clock 2018-12-01 08:02:30+08:00 Saturday Time Zone(Beijing) : UTC+08:00
- Run the ip address command to set the management IP address of the switch. Run the ip route-static command to set the default gateway of the switch.
- For a switch with the management interface, configure a management IP address for the management interface.
[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 the Vlanif interface.
[HUAWEI] vlan 10 [HUAWEI-vlan10] quit [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
- For a switch with the management interface, configure a management IP address for the management interface.
- Run the display ip interface brief command to view brief information about the interface IP address. Run the display ip routing-table command to view the IP routing information.
[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
- Run the ssh user command to configure SSH user-related parameters. Run the local-user command to configure local user-related parameters. In this case, login to a switch through SSH is implemented.
<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.
NOTE:
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 Basic Configuration Guide.
- Run the display current-configuration command to view the current configuration of the switch.
<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
Commands for Viewing System Information
You can use the following commands to view system information:
- View the system configuration using the display current-configuration command.
- View the brief interface information using the display interface brief command.
- View the current system date and clock using the display clock command.
- View brief information about the interface IP address using the display ip interface brief command.
- View the system routing information using the display ip routing-table command.
- View the physical attributes and configurations about the UI using the display user-interface command.
- View the local user list using the display local-user command.
- View SSH user information on the SSH server using the display ssh user-information command.
- View the global configuration information about the SSH server using the display ssh server status command.
- View information about the session connected to the SSH client using the display ssh server session command.