< Home

Example for Performing Basic Configurations on a Switch at First Login Through the Console Port

Networking Requirements

After logging in to a switch for the first time through the console port, perform basic configurations, and set the user level to 15 and authentication mode to AAA for users 0-4 who perform remote login through Telnet. Ensure that PC2 and the switch are routable to each other.

Figure 1 Networking diagram for performing basic configurations on a switch at first login through the console port

Configuration Roadmap

  1. Log in to the switch through the console port.

  2. Perform basic configurations on the switch.

Procedure

  1. Log in to the switch from PC1 through the console port. For details, see First Login Through the Console Port.
  2. Perform basic configurations on the switch.

    # Set the system date, time, and time zone.

    <HUAWEI> clock timezone BJ add 08:00:00
    <HUAWEI> clock datetime 20:20:00 2018-08-08

    Before setting the current date and time, run the clock timezone command to set the time zone. If the time zone is not set, you can run the clock datetime command to configure the UTC time.

    # Set the switch name and management IP address.

    <HUAWEI> system-view
    [HUAWEI] sysname Server
    [Server] vlan 10 [Server-vlan10] quit [Server] interface vlanif 10 [Server-Vlanif10] ip address 10.137.217.177 24 [Server-Vlanif10] quit [Server] interface gigabitethernet 0/0/10 [Server-GigabitEthernet0/0/10] port link-type access [Server-GigabitEthernet0/0/10] port default vlan 10 [Server-GigabitEthernet0/0/10] quit
    # Configure a default route for the switch, assuming that the switch's gateway address is 10.137.217.1.
    [Server] ip route-static 0.0.0.0 0 10.137.217.1

    # Set the user level and authentication mode for Telnet users.

    [Server] telnet server enable
    [Server] user-interface vty 0 4
    [Server-ui-vty0-4] protocol inbound telnet
    [Server-ui-vty0-4] authentication-mode aaa
    [Server-ui-vty0-4] user privilege level 15
    [Server-ui-vty0-4] quit
    [Server] aaa
    [Server-aaa] local-user admin1234 password irreversible-cipher Helloworld@6789
    [Server-aaa] local-user admin1234 privilege level 15
    [Server-aaa] local-user admin1234 service-type telnet
    [Server-aaa] quit

  3. Verify the configuration.

    After the configuration is completed, you can log in to the switch through Telnet from PC2.

    # Access the Windows CLI and log in to the switch through Telnet by running the following command.

    C:\Documents and Settings\Administrator> telnet 10.137.217.177

    Press Enter. On the displayed login interface, enter the user name and password. If the authentication succeeds, the CLI for the user view is displayed. (The following information is only for reference.)

    Login authentication
    
    
    Username:admin1234
    Password:
    Info: The max number of VTY users is 20, and the number
          of current VTY users on line is 1.
          The current login time is 2012-07-26 20:10:05+08:00.
    <Server>

Configuration File

Switch configuration file

#
sysname Server
#
telnet server enable
#
clock timezone BJ add 08:00:00
#
aaa
 local-user admin1234 password irreversible-cipher $1a$aVW8S=aP=B<OWi1Bu'^R[=_!~oR*85r_nNY+kA(I}[TiLiVGR-i/'DFGAI-O$
 local-user admin1234 privilege level 15
 local-user admin1234 service-type telnet
# interface Vlanif10  ip address 10.137.217.177 255.255.255.0 # interface GigabitEthernet0/0/10  port link-type access  port default vlan 10
#
ip route-static 0.0.0.0 0.0.0.0 10.137.217.1
#
user-interface vty 0 4
 authentication-mode aaa
 user privilege level 15
 protocol inbound telnet
#
return
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic