
设备Telnet远程管理协议
1.华为设备实施远程管理协议
- 1.IP规划
R1和SW1的地址分别为10.1.11.1/29和10.1.11.2/29,注意SW1请使用默认的VLAN作为管理IP。
- 2.远程管理配置要点
1.需要给交换机配置一个管理IP,如果PC与交换机不是同一个网段,需要给交换机配置一个默认网关,确保设备之间可以通行
2.需要配置登录设备的级别,否则无法进入远程设备
- 3.远程管理配置详解
1.首先完成网络设备的基本通信
1.1配置R1
<Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname HW-R1 [HW-R1]interface g0/0/1 #进入设备的G0/0/1接口 [HW-R1-GigabitEthernet0/0/1]ip address 10.1.11.1 29 #配置接口的IP地址,华为设备上可以直接键入/29长度的掩码 [HW-R1-GigabitEthernet0/0/1]display this [V200R003C00] # interface GigabitEthernet0/0/1 ip address 10.1.11.1 255.255.255.248 # return [HW-R1-GigabitEthernet0/0/1]1.2配置SW1并测试网络连通性
<Huawei>system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname SW1 [SW1]interface vlan 1 #进入SW1设备的管理接口 [SW1-Vlanif1]ip address 10.1.11.2 29 #配置管理VLAN(管理接口)华为在物理上是默认开启的,赋予IP地址后可以工作,不要忘记掩码29 [SW1-Vlanif1]display this # interface Vlanif1 ip address 10.1.11.2 255.255.255.248 # return [SW1-Vlanif1]ping 10.1.11.1 #测试网络连通性 PING 10.1.11.1: 56 data bytes, press CTRL_C to break Request time out Reply from 10.1.11.1: bytes=56 Sequence=2 ttl=255 time=60 ms Reply from 10.1.11.1: bytes=56 Sequence=3 ttl=255 time=60 ms Reply from 10.1.11.1: bytes=56 Sequence=4 ttl=255 time=30 ms Reply from 10.1.11.1: bytes=56 Sequence=5 ttl=255 time=40 ms --- 10.1.11.1 ping statistics --- 5 packet(s) transmitted 4 packet(s) received 20.00% packet loss round-trip min/avg/max = 30/47/60 ms [SW1-Vlanif1]2.开启设备的telnet服务命令
前置条件实现之后,开启设备的telnet服务命令
[SW1]telnet server enable #开启telnet服务功能 Info: The Telnet server has been enabled. [SW1]user-interface vty 0 4 #进入VTY的0到4通道 [SW1-ui-vty0-4]set authentication password simple 123456 #开启远程通道0到4,设置简单密码认证为123456 [SW1-ui-vty0-4]display th [SW1-ui-vty0-4]set authentication password simple ******3.实施远程登录测试
3.1在R1上远程SW1
<HW-R1>telnet 10.1.11.2 #注意测试的模式处于用户模式 Press CTRL_] to quit telnet mode Trying 10.1.11.2 ... Connected to 10.1.11.2 ... Login authentication Password: #输入密码123456 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 2020-02-12 21:58:47. <SW1>sys #无法进入远程设备的系统视图,无法补全配置命令,原因是用户的登录级别不足3.2在SW1上设置用户级别
[SW1-ui-vty0-4]display this # user-interface con 0 user-interface vty 0 4 set authentication password simple 123456 # return [SW1-ui-vty0-4]user privilege level 153.3在R1上远程SW1测试用户权限
<HW-R1>telnet 10.1.11.2 Press CTRL_] to quit telnet mode Trying 10.1.11.2 ... Connected to 10.1.11.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 2020-02-12 22:03:10. <SW1>system-view Enter system view, return user view with Ctrl+Z. [SW1]display users User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag 0 CON 0 00:01:28 no Username : Unspecified + 34 VTY 0 00:00:00 TEL 10.1.11.1 pass no Username : Unspecified [SW1]华为设备的telnet服务配置实施完毕
2.H3C设备实施远程管理协议
在交换机1上开启telnet服务,R1作为客户端远程登录SW1,我们把网络设备既作为了telnet协议的服务器端也作为了telnet协议的客户端,既从一台网络设备去远程管理另一台网络设备,在现实网络中,客户端是运行CRTR或者XShell等终端设备的电脑,而服务器是被管理的网络设备。
1.远程管理配置要点
- 1.需要给交换机配置一个管理IP,如果PC与交换机不是同一个网段,需要给交换机配置一个默认网关,确保设备之间可以通行
- 2.需要配置登录设备的级别,另外需要开启telnet服务
2.华三远程管理实施
1.首先配置设备之间通信
R1:<H3C>SYS System View: return to User View with Ctrl+Z. [H3C]interface g0/1 [H3C-GigabitEthernet0/1]ip address 10.1.11.1 255.255.255.248 [H3C-GigabitEthernet0/1]display this # interface GigabitEthernet0/1 port link-mode route combo enable copper ip address 10.1.11.1 255.255.255.248 # return [H3C-GigabitEthernet0/1]SW1:
<H3C>sys System View: return to User View with Ctrl+Z. [H3C]sysname H3C-SW1 [H3C-SW1]INTE [H3C-SW1]interface vlan 1 [H3C-SW1-Vlan-interface1]ip address 10.1.11.2 255.255.255.248 [H3C-SW1-Vlan-interface1]display this # interface Vlan-interface1 ip address 10.1.11.2 255.255.255.248 # return [H3C-SW1-Vlan-interface1]ping 10.1.11.2 Ping 10.1.11.2 (10.1.11.2): 56 data bytes, press CTRL_C to break 56 bytes from 10.1.11.2: icmp_seq=0 ttl=255 time=7.718 ms 56 bytes from 10.1.11.2: icmp_seq=1 ttl=255 time=0.764 ms 56 bytes from 10.1.11.2: icmp_seq=2 ttl=255 time=0.333 ms 56 bytes from 10.1.11.2: icmp_seq=3 ttl=255 time=0.792 ms 56 bytes from 10.1.11.2: icmp_seq=4 ttl=255 time=0.352 ms --- Ping statistics for 10.1.11.2 --- 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.333/1.992/7.718/2.870 ms %Feb 12 22:53:25:419 2020 H3C-SW1 PING/6/PING_STATISTICS: Ping statistics for 10.1.11.2: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std -dev = 0.333/1.992/7.718/2.870 ms. [H3C-SW1-Vlan-interface1]2.配置交换机,开启telnet服务
[H3C-SW1]telnet server enable #手动配置开启telnet服务 [H3C-SW1]line vty 0 4 #进入vty通道,命令和思科相同 [H3C-SW1-line-vty0-4]set authentication password simple 123456 #设置通过vty登录的密码123456 [H3C-SW1-line-vty0-4]display this # line aux 0 user-role network-operator # line con 0 user-role network-admin # line vty 0 4 user-role network-operator #HCL模拟器上自带登录用户为网络用户,既已经通过角色授权,类比华为的用户级别 set authentication password hash $h$6$nXYc/9jyvXLw10Rq$KUVeqIpTPE47UWR79/PbCT+5+HSp+sJ82g5NCLrINUP2ahSnmB/N9k6myk2E0T/TOBp99wr5rw2DlWJitkgevA== [H3C-SW1-line-vty0-4]3.进行远程登录测试
<H3C-R1>telnet 10.1.11.2 Trying 10.1.11.2 ... Press CTRL+K to abort Connected to 10.1.11.2 ... ****************************************************************************** * Copyright (c) 2004-2017 New H3C Technologies Co., Ltd. All rights reserved.* * Without the owner's prior written consent, * * no decompiling or reverse-engineering shall be allowed. * ****************************************************************************** Password: <H3C-SW1>%Feb 12 23:03:36:368 2020 H3C-SW1 SHELL/5/SHELL_LOGIN: VTY logged in from 10.1.11.2. <H3C-SW1>sys <H3C-SW1>system-view System View: return to User View with Ctrl+Z. [H3C-SW1]disp [H3C-SW1]display use [H3C-SW1]display users Idx Line Idle Time Pid Type 0 CON 0 00:00:00 Feb 12 22:51:41 218 + 84 VTY 0 00:00:00 Feb 12 23:03:35 239 TEL #远程用户已经成功通过vty0登录了SW1 Following are more details. VTY 0 : Location: 10.1.11.2 + : Current operation user. F : Current operation user works in async mode. [H3C-SW1]H3C远程登录实施完毕