Configuration Examples for Routers in Typical Enterprise Scenarios 4.0
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.
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
- Power on all devices and ensure that the self-check is normal.
- 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.
- 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.
- Set communication parameters, as shown in Figure 1-55.
- 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.
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.
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.
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
- 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. #
- Configure AAA user management.
- 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. #
- Enable the STelnet server function.
# stelnet server enable #
- 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.