< Home

Configuring System Information

Context

This section describes how to set basic system parameters of a switch. The following tasks may be involved after the first login:
  1. Set the name of the switch.
  2. Set the location and time zone of the switch.
  3. Set the date and time of the switch.
  4. View the date and time of the switch.
  5. Set the management IP address and default gateway of the switch.
  6. View the IP routing information.
  7. Configure login through STelnet.
  8. View configuration information about the current switch.

Procedure

  1. 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.

  2. Run the clock timezone command to set the location and time zone of the switch.

    [HUAWEI] clock timezone Beijing add 08:00:00
    [HUAWEI] quit

  3. Run the clock datetime command to set the current time and date.

    <HUAWEI> clock datetime 08:00:00 2018-12-01 

  4. 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 
    

  5. 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> 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

  6. 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 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     
                                                                                    

  7. 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.
    

    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.

  8. 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.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >