方式一
步骤1:
配置sw1名称及逻辑(虚拟)IP地址
<Huawei>sys
[Huawei]sys sw1 \\改名为sw1
[sw1]int vlanif1 \\进入逻辑接口
[sw1-Vlanif1]ip add 192.168.12.1 24 \\添加IP
[sw1-Vlanif1]qu
[sw1]qu
<sw1>
配置sw2名称及逻辑(虚拟)IP地址
<Huawei>sys
[Huawei]sys sw2
[sw2]int vlanif1
[sw2-Vlanif1]ip add 192.168.12.2 24
[sw2-Vlanif1]qu
[sw2]
步骤2:
配置sw2远程登录
[sw2]user-interface vty 0 4 \\设置同时登录用户数量
[sw2-ui-vty0-4]authentication-mode password
\\使用密码登录
[sw2-ui-vty0-4]set authentication password simple 123
\\设置密码为123(越是高端的交换机对密码的格式要求就越高,比如密码长度、不能包含用户名字段等等,注意有没有报错信息)
[sw2-ui-vty0-4]user privilege level 15
\\设置登录用户的操作权限15为最高
[sw2-ui-vty0-4]idle-timeout 3
\\用户3分钟无操作退出登录
步骤3:
在sw1登录sw2
<sw1>telnet 192.168.12.2
\\注意在用户视图下敲命令<sw1>
Trying 192.168.12.2 ...
Press CTRL+K to abort
Connected to 192.168.12.2 ...
Login authentication
Password:
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 1.
The current login time is 2022-10-11 13:37:16
<sw2>
方式二
步骤1:配置IP,修改名称(略)
步骤2:分别在sw1和sw2上配置以下代码
aaa
local-user hf password cipher hf@123
local-user hf privilege level 15
local-user hf service-type telnet
qu
user-interface vty 0 4
authentication-mode aaa
protocol inbound telnet
交换机开启telnet命令:
另电脑终端也需开启telnet功能组件。
console加密:
[sw1]user-interface console 0
[sw1-ui-console0]authentication-mode aaa
[sw1-ui-console0]qu
[sw1]aaa
[sw1-aaa]local-user admin1 password cipher hf@12345678
[sw1-aaa]local-user admin1 privilege level 15
ssh配置:
[sw1]stelnet server enable
#
[sw1]user-interface vty 0 4
[sw1-ui-vty0-4]authentication-mode aaa
[sw1-ui-vty0-4]protocol inbound ssh
#
[sw1]aaa
[sw1-aaa]local-user admin2 password cipher 123456
[sw1-aaa]local-user admin2 service-type ssh
[sw1-aaa]local-user admin2 privilege level 15
#
[sw1]ssh user admin2
[sw1]ssh user admin2 authentication-type all
[sw1]ssh user admin2 service-type stelnet
检验:
[sw1]stelnet 127.0.0.1 \\127.0.0.1环回地址。实际工作中用这个地址检验
Please input the username:admin2
Trying 127.0.0.1 ...
Press CTRL+K to abort
Connected to 127.0.0.1 ...
Error: Failed to verify the server's public key.
Please run the command "ssh client first-time enable"to enable the first-time access function and try again.
[sw1]ssh client first-time enable \\第一次登陆需要输入“ssh client first-time enable”
Nov 29 2023 09:24:23-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 14, the change loop count is 0, and the maximum number of records is 4095.e
[sw2]stelnet 127.0.0.1
Please input the username:admin2
Trying 127.0.0.1 ...
Press CTRL+K to abort
Connected to 127.0.0.1 ...
The server is not authenticated. Continue to access it? [Y/N] :y
Save the server's public key? [Y/N] :
Nov 29 2023 09:24:42-08:00 sw2 %%01SSH/4/CONTINUE_KEYEXCHANGE(l)[0]:The server had not been authenticated in the process of exchanging keys. When deciding whether to continue, the user chose Y.y
The server's public key will be saved with the name 127.0.0.1. Please wait...
Nov 29 2023 09:24:50-08:00 sw2 %%01SSH/4/SAVE_PUBLICKEY(l)[1]:When deciding whether to save the server's public key 127.0.0.1, the user chose Y.
Enter password:
原创不易,转载请注明出处:
【HCIA 02】华为交换机配置telnet远程登录_sxhuafeng的博客-CSDN博客_华为交换机telnet登陆