By default, Telnet is disabled on the device. You need to establish a Telnet login environment. This section provides an example for configuring how to log in to the CLI using Telnet.
Figure 1 shows that the FW has a local administrator. The local administrator has some administrator permissions and can use Telnet to log in to the CLI only from a local PC for FW management and maintenance. HWTACACS server authentication takes precedence over local authentication. The FW implements local authentication on administrators only when the HWTACACS server does not respond.
Item |
Data |
Description |
|---|---|---|
VTY interface timeout period |
5 minutes |
The default period is 10 minutes. |
Maximum number of authentication attempts allowed |
2 |
The default value is 3. |
Lockout period |
10 minutes |
The default period is 30 minutes. |
Administrator account/password |
vtyadmin/Mydevice@abc |
Note down the user name and password in case you forget them. |
Authentication scheme |
Name: hwtacacs Authentication methods: hwtacacs and local |
- |
HWTACACS server template |
Name: hwtacacs_server HWTACACS server address: 172.16.0.2 |
- |
IP address of the administrator's PC |
10.3.0.100/255.255.255.0 |
- |
Configure the IP address of the administrator PC and use the Telnet software to log in to the VTY interface.
<FW> system-view [FW] telnet server enable
If you use the default settings of management interface to log in to the device, do not perform this step.
Because the default IP address of the management interface has been set to 192.168.0.1, the interface has been added to the Trust zone, and the administrator is allowed to log in to the device using Telnet.
Set the authentication mode of the VTY administrator interface to AAA and idle disconnection duration to 5 minutes (the default value is 10 minutes).
The number of default VTY administrator interfaces is five. To add more interfaces, run the user-interface maximum-vty number command.
[FW] user-interface vty 0 4 [FW-ui-vty0-4] authentication-mode aaa [FW-ui-vty0-4] protocol inbound telnet [FW-ui-vty0-4] user privilege level 3 [FW-ui-vty0-4] idle-timeout 5 [FW-ui-vty0-4] quit
Set the interface IP address.
[FW] interface GigabitEthernet 0/0/2 [FW-GigabitEthernet0/0/2] ip address 172.16.0.1 255.255.255.0 [FW-GigabitEthernet0/0/2] quit
Add the interface to a security zone.
[FW] firewall zone dmz [FW-zone-dmz] add interface GigabitEthernet0/0/2 [FW-zone-dmz] quit
Configure a security policy.
[FW] security-policy [FW-policy-security] rule name rule1 [FW-policy-security-rule-rule1] source-zone local [FW-policy-security-rule-rule1] destination-zone dmz [FW-policy-security-rule-rule1] destination-address 172.16.0.2 32 [FW-policy-security-rule-rule1] action permit [FW-policy-security-rule-rule1] quit [FW-policy-security] quit
[FW] hwtacacs-server template hwtacacs_server [FW-hwtacacs-hwtacacs_server] hwtacacs-server authentication 172.16.0.2 49 [FW-hwtacacs-hwtacacs_server] hwtacacs-server authorization 172.16.0.2 49 [FW-hwtacacs-hwtacacs_server] hwtacacs-server shared-key cipher Admin@123 [FW-hwtacacs-hwtacacs_server] test-aaa testname testpassword hwtacacs-template hwtacacs_server [FW-hwtacacs-hwtacacs_server] quit
[FW] aaa [FW-aaa] authentication-scheme hwtacacs [FW-aaa-authen-hwtacacs] authentication-mode hwtacacs local [FW-aaa-authen-hwtacacs] quit
In this example, only the HWTACACS server is used for authentication, and the local role is used to authorize the administrator. To use the HWTACACS authorization mode, see CLI: Example for Logging In to the CLI Using STelnet (HWTACACS Authentication and Authorization).
# telnet server enable # interface GigabitEthernet0/0/2 ip address 172.16.0.1 255.255.255.0 # interface GigabitEthernet0/0/3 ip address 10.3.0.1 255.255.255.0 service-manage enable service-manage telnet permit # user-interface vty 0 4 authentication-mode aaa protocol inbound telnet user privilege level 3 idle-timeout 5 # aaa authentication-scheme hwtacacs authentication-mode hwtacacs local # manager-user vtyadmin password cipher %@%@*y:3*ZN}.%%qcL1cCyDwlB.|@XBVMDWq'6JF(iOz2D8>A\SN%@%@ service-type telnet level 15 authentication-scheme hwtacacs hwtacacs-server hwtacacs_server # lock-authentication enable lock-authentication failed-count 2 lock-authentication timeout 10 # bind manager-user vtyadmin role service-admin role service-admin description policy_object_network_readwrite_and_other_modules_none dashboard none monitor none system none network read-write object read-write policy read-write # hwtacacs-server template hwtacacs_server hwtacacs-server authentication 172.16.0.2 49 hwtacacs-server authorization 172.16.0.2 49 hwtacacs-server shared-key cipher %@%@'`Fo,5PRT<%+yu"zhf[18:7W%@%@ # firewall zone trust set priority 85 add interface GigabitEthernet0/0/3 # firewall zone dmz set priority 50 add interface GigabitEthernet0/0/2 # security-policy rule name rule1 source-zone local destination-zone dmz destination-address 172.16.0.2 32 action permit # return