华为交换机修改telnet连接时默认端口

- 网络

公司自己研发的一些硬件设备的系统,为了保证自己网络正常,会每次启动时尝试telnet连接登录自己的网关地址确认路由器配置(目的为了判断我们工控机中自带的路由器是否正常工作)。但是在公司测试的时候,工控机是没有连路由器,而是直接接入了内网中。就会导致内网交换机上有很多异常登录日志。 为了避免这种情况,这里调整下默认 telnet 端口。


查看交换机当前telnet配置

[sw01]display telnet server status
 TELNET IPv4 server                       :Enable
 TELNET IPv6 server                       :Disable
 TELNET server port                       :23
 TELNET server source address             :0.0.0.0
 ACL4 number                              :0
 ACL6 number                              :0
[sw01]


修改 telnet 端口

修改端口后当前连接会断掉。

[sw01]telnet server port 2121
Warning: This operation will cause all the online Telnet users to be offline. Continue?[Y/N]:Y
Info: Succeeded in changing the listening port of the Telnet server.
[sw01]
Info: The max number of VTY users is 10, and the number
      of current VTY users on line is 0.

遗失对主机的连接。

C:\Users\imzcy>


telnet 连接验证效果

使用默认端口连接会失败

C:\Users\imzcy>telnet 192.168.1.1
正在连接192.168.1.1...无法打开到主机的连接。 在端口 23: 连接失败

C:\Users\imzcy>

输入指定telnet端口则正常连接

C:\Users\imzcy>telnet 192.168.1.1 2121