文章目录
- Telnet
- server
- client
- 总结
提示:以下是本篇文章正文内容,下面案例可供参考
Telnet
![](https://img.laitimes.com/img/9ZDMuAjOiMmIsIjOiQnIsICM38FdsYkRGZkRG9lcvx2bjxiNx8VZ6l2cs0TP310dVpXT4FEVNFDOsJGcohVYsR2MMBjVtJWd0ckW65UbM5WOHJWa5kHT20ESjBjUIF2X0hXZ0xCMx81dvRWYoNHLrdEZwZ1Rh5WNXp1bwNjW1ZUba9VZwlHdssmch1mclRXY39CXldWYtlWPzNXZj9mcw1ycz9WL49zZuBnLzMWNyEWNygDM0U2NmRTYhJ2NmRDMmBjYxYzYyYmN3Y2Lc52YucWbp5GZzNmLn9Gbi1yZtl2Lc9CX6MHc0RHaiojIsJye.png)
步骤:
1.服务器上设置管理IP
2.开启Telnet功能
3.设置Telnet模式为密码模式
4.设置明文/密文密码
5.客户机上设置管理IP
6.客户机验证Telnet服务器是否可以登录
server
<Huawei>undo terminal monitor 关闭传输信息
<Huawei>system-view 进入系统视图
[Huawei]sysname SW1 给交换机命名为SW1
[SW1]user-interface console 0 进入console0接口
[SW1-ui-console0]idle-timeout 0 0 设置用户界面永不超时
[SW1-ui-console0]quit 退出console0接口
[SW1]interface Vlanif 1 进入交换机虚拟接口
[SW1-Vlanif1]ip address 192.168.1.5 255.255.255.0 设置服务器IP地址
[SW1-Vlanif1]quit 退出到系统视图
[SW1]user-interface vty 0 4 进入telnet
[SW1-ui-vty0-4]authentication-mode password 设置验证模式为密码模式
[SW1-ui-vty0-4]set authentication password simple huawei 设置明文密码huawei
[SW1-ui-vty0-4]user privilege level 3 设置用户权限为管理员级
[SW1-ui-vty0-4]return 退出到用户视图
<SW1>save 保存当前配置文件
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y 输入y确认
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 0.
Save the configuration successfully. 表示保存成功
<SW1>
client
<Huawei>undo terminal monitor 关闭传输信息
<Huawei>system-view 进入系统视图
[Huawei]sysname client 给交换机命名为client
[client]user-interface console 0 进入console0接口
[client-ui-console0]idle-timeout 0 0 设置用户界面永不超时
[client-ui-console0]quit 退出console0接口
[client]interface Vlanif 1 进入交换机虚拟接口
[client-Vlanif1]ip address 192.168.1.10 255.255.255.0 设置服务器IP地址
[client-Vlanif1]return 退出到用户视图
<client>ping 192.168.1.5 ping服务器
PING 192.168.1.5: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.5: bytes=56 Sequence=1 ttl=255 time=60 ms
Reply from 192.168.1.5: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 192.168.1.5: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 192.168.1.5: bytes=56 Sequence=4 ttl=255 time=40 ms
Reply from 192.168.1.5: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 192.168.1.5 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/42/60 ms
<client>telnet 192.168.1.5 远程连接服务器
Trying 192.168.1.5 ...
Press CTRL+K to abort
Connected to 192.168.1.5 ...
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 2021-08-05 20:04:11.
<SW1> 显示出服务器名字说明连接成功
总结
1.交换机的物理接口是不能配置IP地址的,交换机有一个默认的虚拟接口vlan1,我们可以给默认虚拟接口配置IP,即给二层交换机配置一个管理IP。
2.undo shutdown 开启接口,交换机的物理接口默认是开启状态,不需要输入这条命令,路由器需要。
3.设置明文密码用simple,设置密文密码用cipher
4.当前配置文件断电后会丢失,所以需要在用户视图下输入save保存当前配置文件。