Configuration Examples for Routers in Typical Enterprise Scenarios 4.0

Logging In to a Device

Logging In to a Device

Logging In to a Device for the First Time

This example describes operations to perform after logging in to a device for the first time.

Applicable Products and Versions

All router products running V8

Precautions

For details, see the corresponding descriptions in this document.

Prerequisites

  • A terminal emulation program, such as PuTTY.exe, has been installed on the PC.
  • Serial cables have been prepared for logging in to the device through the console port.

  • No license items are required in this scenario.

Networking Requirements

You can log in to a device that is being powered on for the first time through the console port. This is the most basic login mode.

If STelnet is used to log in to a device that is powered on for the first time:

  • The IP address of the management interface (GE 0/0/0 or Ethernet 0/0/0) is 192.168.0.1.
  • If the device has accessed the network when it is powered on for the first time, the IP address 192.168.0.1 is automatically changed to the IP address obtained through DHCP during the startup.
  • By default, the username is root, and the password is Changeme_123. After logging in to the device, change the password promptly.

Procedure

  1. Power on all devices and ensure that the self-check is normal.
  2. Connect a COM port on a PC to the console port of the device through a cable.

    • If the device does not have a console port (ETH/OAM management port), use non-standard serial cables.

    • The PC may have multiple connection ports. You must select the port connected to the console cable. Generally, COM1 is selected. If the serial port communication parameters of the device are modified, change the communication parameters on the PC to be consistent with those of the device and then reconnect the device.

  3. Run the terminal emulation program (for example, PuTTY.exe) on the PC, create a connection, and set Connection type to Serial, as shown in Figure 1-54.

    Figure 1-54 New connection

  4. Set communication parameters, as shown in Figure 1-55.

    Figure 1-55 Communication parameters

  5. After the connection is set up, the system prompts you to set the authentication password, as shown in Figure 1-56. After the password is configured, the system automatically saves it.

    Figure 1-56 Login screen

    Then, the device displays a prompt, for example, <HUAWEI>, indicating the user view.

    You can enter commands to configure the device or view its running status. Enter a question mark (?) when you need help.

Using STelnet (SSH) to Remotely Log In to a Device

This section describes how to use STelnet (SSH) to remotely and securely log in to a device.

Applicable Products and Versions

All router products running V8

Precautions

If SSH is configured as the login protocol, the device automatically disables the Telnet function.

Prerequisites

  • The device is operating properly.
  • An IP address has been configured for the desired interface of the device through the console port.
  • The terminal and device are directly connected, or there is a reachable route between the terminal and device.
  • No license items are required in this scenario.

Networking Requirements

An enterprise has high security requirements, requiring strict authentication and authorization on device login and CLI permissions.

Configuration Roadmap

In scenarios with high network security requirements, SSH is recommended, and AAA can be used for authentication and authorization. To prevent user information loss due to causes such as hardware damage, you are advised to combine local authentication and remote server authentication. The authentication protocol can be RADIUS or HWTACACS. This example uses HWTACACS, which supports CLI authorization and offers higher security by encrypting all traffic.

Table 1-107 Data planning

Parameter

Planned Value

Protocol

SSH

Authentication type

Password authentication

Authentication method

AAA

Authentication mode

Local authentication first and then HWTACACS authentication

CLI authorization mode

HWTACACS authorization first and then local authorization

Procedure

  1. Configure a VTY user interface.

    #
    acl name ACL_VTY basic       //Create a basic ACL.
     description ACL_FOR_VTY    //Configure a description for the ACL to prevent misuse of the ACL.
     rule 10 permit vpn-instance MGT source 10.7.16.0 0.0.0.255  //Allow a user at 10.7.16.0/24 to log in to the device.
     rule 20 permit vpn-instance MGT source 10.8.34.135 0      //Allow a user at 10.8.34.135/32 to log in to the device.
     .... //Add the IP addresses of other users who are allowed to log in as required.
    #
    user-interface vty 0 14
     acl ACL_VTY inbound          //Configure permission control on the user interface to allow only users who satisfy a specified ACL rule to access the device.
     authentication-mode aaa      //Specify the authentication mode as AAA authentication.
     idle-timeout 5 0             //Set the VTY interface to be disconnected if it is idle for more than 5 minutes 0 seconds.
     protocol inbound ssh         //Set the VTY interface to support only the SSH protocol.
    #

  2. Configure AAA user management.
    1. Configure HWTACACS.

      #
      hwtacacs-server template for_aaa             //Configure an HWTACACS server template.
       hwtacacs-server authentication 10.7.35.63 vpn-instance MGT  //Set the IP address of the primary HWTACACS authentication server.
       hwtacacs-server authentication 10.7.35.64 vpn-instance MGT secondary  //Set the IP address of the secondary HWTACACS authentication server.
       hwtacacs-server authorization 10.7.35.63 vpn-instance MGT       //Set the IP address of the primary HWTACACS authorization server.
       hwtacacs-server authorization 10.7.35.64 vpn-instance MGT secondary //Set the IP address of the secondary HWTACACS authorization server.
       hwtacacs-server shared-key cipher %^%#BG%G;uUm2ns<(X5@mt^%#2eIf1^Jqz#%^:,;N>D)`y4(#b%#  //Specify a shared key displayed in ciphertext.
       hwtacacs-server user-name original //Set the username format of the HWTACACS server to be the same as that entered by the user.
      #

    2. Configure AAA.

      #
      aaa
       local-user admin password irreversible-cipher %^%#8[*1[4M;$e{}F$iU6_f*MWX"I:7a)-e}F$i1[4M;$e{ M;$e{}F$"I:7a)$i    //Create a local user admin and set the login password of the user to an irreversible ciphertext key.
       local-user admin service-type ssh               //Configure the admin user to access only in SSH mode.
       local-user admin level 3                       //Set the level of admin to level 3 (management level).
       local-user admin state block fail-times 3 interval 5  //Set admin to be locked out for 5 minutes after three consecutive failed login attempts.
      .... //Add other users who are allowed to log in as required. For details, see the preceding configuration method of the admin user.
      #
       authentication-scheme default            //Configure an AAA authentication template.
        authentication-mode local hwtacacs      //Configure an authentication mode of local authentication first and then HWTACACS authentication.
       #
       authorization-scheme default            //Configure an AAA authorization template.
        authorization-mode local hwtacacs      //Configure an authorization mode of local authorization first and then HWTACACS authorization.
        authorization-cmd 0 hwtacacs local      //Set the level-0 CLI authorization mode to HWTACACS authorization first and then local authorization. That is, if the HWTACACS server does not respond, the CLI authorization is performed locally.
        authorization-cmd 1 hwtacacs local
        authorization-cmd 3 hwtacacs local
        authorization-cmd 15 hwtacacs local
      #
       domain default_admin
        authorization-scheme default           //Apply the configured AAA authentication template.
        accounting-scheme default              //Apply the configured AAA authorization template.
        hwtacacs-server for_aaa                //Apply the configured HWTACACS server template.
      #

  3. Configure SSH user management.

    #
    ssh authentication-type default password   //Configure password authentication as the default authentication mode for SSH users.
    ssh user admin     //Create an SSH user named admin.
    ssh user admin authentication-type password  //Configure password authentication for the admin user.
    ssh user admin service-type stelnet          //Configure the service type for the admin user.
    … …  //Add other SSH users as required. For details, see the preceding configuration method of the admin user.
    ssh authorization-type default aaa       //Set the authorization type of SSH connections to AAA.
    #
    ssh client first-time enable      //Enable initial authentication for the SSH client, so that the validity of the public key of the SSH server is not checked when a user logs in to the SSH server for the first time. After the login, the system automatically allocates and saves a public key for authentication upon next login.
    #

  4. Enable the STelnet server function.

    #
    stelnet server enable
    #

  5. Verify SSH-based remote login.

    This section uses PuTTY running on a PC as an example to describe how to log in to a device.

    1. As shown in Figure 1-57, set the IP address of the management interface (GE 0/0/0 or Ethernet 0/0/0) to 192.168.0.1 and set the login mode to SSH. For a non-box-shaped device, you need to configure the IP address of the management interface on the device to be logged in through the console port in advance.

      If STelnet is used to log in to a box-shaped device that is powered on for the first time:

      • The IP address of the management network port (GE 0/0/0 or Ethernet 0/0/0) is 192.168.0.1.
      • If the device has accessed the network when it is powered on for the first time, the IP address 192.168.0.1 is automatically changed to the IP address obtained through DHCP during the startup.
      • By default, the username is root, and the password is Changeme_123. After logging in to the device, change the password promptly. After logging in to the device, change the default password promptly.
      Figure 1-57 Logging in to the device using PuTTY (1)

    2. Enter the username and password.

      Figure 1-58 Logging in to the device using PuTTY (2)

Translation
Favorite
Download
Update Date:2025-01-07
Document ID:EDOC1000120969
Views:139140
Downloads:3816
Average rating:4.75Points

Digital Signature File

digtal sigature tool