案例3 配置明文远程管理协议

发布时间 2023-10-09 23:22:47作者: xl4ng

1. 华为设备

image

1.1 配置R1

<Huawei>sys
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname HW-R1
[HW-R1]int g0/0/1
[HW-R1-GigabitEthernet0/0/1]ip address 10.1.11.1 29

1.2 配置SW1

<Huawei>system-view 
[Huawei]sysname SW1
[SW1]
[SW1]interface vlan 1
[SW1-Vlanif1]ip address 10.1.11.2 29
[SW1-Vlanif1]
[SW1-Vlanif1]ping 10.1.11.1
  PING 10.1.11.1: 56  data bytes, press CTRL_C to break
    Reply from 10.1.11.1: bytes=56 Sequence=1 ttl=255 time=90 ms
    Reply from 10.1.11.1: bytes=56 Sequence=2 ttl=255 time=50 ms
    Reply from 10.1.11.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 10.1.11.1: bytes=56 Sequence=4 ttl=255 time=50 ms
    Reply from 10.1.11.1: bytes=56 Sequence=5 ttl=255 time=50 ms

  --- 10.1.11.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/54/90 ms

[SW1-Vlanif1]quit
[SW1]telnet server enable
Info: The Telnet server has been enabled.
[SW1]user-interface vty 0 4
[SW1-ui-vty0-4]aut
[SW1-ui-vty0-4]authentication-mode passw
[SW1-ui-vty0-4]authentication-mode password 
[SW1-ui-vty0-4]set aut
[SW1-ui-vty0-4]set authentication pa
[SW1-ui-vty0-4]set authentication password si
[SW1-ui-vty0-4]set authentication password simple qytang

1.3 通过telnet从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 2023-10-09 22:28:33.
<SW1>system-view
     ^
Error: Unrecognized command found at '^' position.

1.4 登录后发现不能进入系统视图,原因是用户登录级别不够


[SW1-ui-vty0-4]user privilege level 15

配置后,顺利进入系统视图

<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 2023-10-09 22:41:21.
<SW1>sys
<SW1>system-view 
Enter system view, return user view with Ctrl+Z.
[SW1]

2. 华三设备

image

[SW1]interface Vlan-interface 1
[SW1-Vlan-interface1]
[SW1-Vlan-interface1]ip address 10.1.11.2 29
[SW1]telnet server enable
[SW1-line-vty0-4]set authentication password simple qytang
[SW1-line-vty0-4]dis th
[R1]interface g0/1
[R1-GigabitEthernet0/1]ip address 10.1.11.1 29
[R1-GigabitEthernet0/1]dis th
[R1-GigabitEthernet0/1]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=4.000 ms
56 bytes from 10.1.11.2: icmp_seq=1 ttl=255 time=0.000 ms
56 bytes from 10.1.11.2: icmp_seq=2 ttl=255 time=0.000 ms
56 bytes from 10.1.11.2: icmp_seq=3 ttl=255 time=0.000 ms
56 bytes from 10.1.11.2: icmp_seq=4 ttl=255 time=1.000 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.000/1.000/4.000/1.549 ms
[H3C-GigabitEthernet0/1]%Oct  9 23:07:48:834 2023 H3C 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.000/1.000/4.000/1.549 ms.
[R1]quit
<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:
<R1>
<R1>system-view
[R1]