某公司在组建局域网时所购置的交换机已经完成了基本配置,现在全部接入网络,并投入使用。为了方便对交换机进行维护和管理,现在需要配置其远程管理功能。
远程管理极大地提高了用户操作的灵活性。远程管理主要分为Telnet和STelnet两种方式。如果为交换机分配了管理IP地址,则可以使用Telnet和STelnet客户端连接到交换机。但是VTY线路并不安全,可以为VTY线路配置密码身份验证来保护通过VTY线路对交换机的访问。
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SWA
[SWA]
[SWA]undo info-center enable
Info: Information center is disabled.
[SWA]
[SWA]user-interface vty 0 4
[SWA-ui-vty0-4]
[SWA-ui-vty0-4]authentication-mode password
[SWA-ui-vty0-4]set authentication password simple huawei
[SWA-ui-vty0-4]user privilege level 2
[SWA-ui-vty0-4]idle-timeout 10
[SWA-ui-vty0-4]quit
在vlanif1中配置IP地址和子网掩码
[SWA]int vlanif 1
[SWA-Vlanif1]ip address 192.168.1.254 24
[SWA-Vlanif1]quit
开启远程登录功能
[SWA]telnet server enable
Info: The Telnet server has been enabled.
[SWA]
设置交换机的名字为PC1
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname PC1
[PC1]undo info-center enable //关闭干扰信息
Info: Information center is disabled.
设置计算机的IP
[PC1]interface vlan 1
[PC1-Vlanif1]ip add 192.168.1.1 24
[PC1-Vlanif1]quit
测试交换机(PC1)能否登录到交换机上(可以)
<PC1>telnet 192.168.1.254
Trying 192.168.1.254 ...
Press CTRL+K to abort
Connected to 192.168.1.254 ...
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-17 15:06:14.
<SWA>
<SWA>system-view
Enter system view, return user view with Ctrl+Z.
[SWA]aaa
[SWA-aaa]local-user admin password cipher hello privilege level 2
[SWA-aaa]
[SWA-aaa]local-user admin service-type telnet
[SWA-aaa]quit
[SWA]user-interface vty 0 4
[SWA-ui-vty0-4]authentication-mode aaa
[SWA-ui-vty0-4]
<SWA>telnet 192.168.1.254
Trying 192.168.1.254 ...
Press CTRL+K to abort
Connected to 192.168.1.254 ...
Login authentication
Username:admin
Password:
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 2.
The current login time is 2023-10-17 15:13:53.
<SWA>
注:以上两种password和aaa都为远程登录(telnet),都不够安全。
<SWA>reboot
Info: The system is now comparing the configuration, please wait.
Warning: All the configuration will be saved to the configuration file for the n
ext startup:, Continue?[Y/N]:n
Info: If want to reboot with saving diagnostic information, input 'N' and then e
xecute 'reboot save diagnostic-information'.
System will reboot! Continue?[Y/N]:y
<SWA>
<Huawei>
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname SWA
[SWA]
[SWA]stelnet server enable
Info: Succeeded in starting the Stelnet server.
[SWA]
[SWA]interface vlan 1
[SWA-Vlanif1]ip address 192.168.1.254 24
[SWA-Vlanif1]quit
[SWA]rsa local-key-pair create
The key name will be: SWA_Host
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
it will take a few minutes.
Input the bits in the modulus[default = 512]:
Generating keys...
.........++++++++++++
...++++++++++++
..++++++++
.................++++++++
[SWA]
[SWA]aaa
[SWA-aaa]local-user admin password cipher hello privilege level 2
[SWA-aaa]local-user admin service-type ssh
[SWA-aaa]quit
[SWA]ssh user admin authentication-type password
[SWA]user-interface vty 0 4
[SWA-ui-vty0-4]authentication-mode aaa
[SWA-ui-vty0-4]protocol inbound ssh
[SWA-ui-vty0-4]idle-timeout 10 //设置断连时间为10分钟
[SWA]ssh user admin service-type stelnet
<PC1>reboot
Info: The system is now comparing the configuration, please wait.
Warning: All the configuration will be saved to the configuration file for the n
ext startup:, Continue?[Y/N]:n
Info: If want to reboot with saving diagnostic information, input 'N' and then e
xecute 'reboot save diagnostic-information'.
System will reboot! Continue?[Y/N]:y
<PC1>##########
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname PC1
[PC1]interface vlan 1
[PC1-Vlanif1]ip address 192.168.1.1 24
[PC1-Vlanif1]quit
[PC1]ssh client first-time enable
[PC1]stelnet 192.168.1.254
Please input the username:admin
Trying 192.168.1.254 ...
Press CTRL+K to abort
Connected to 192.168.1.254 ...
The server is not authenticated. Continue to access it? [Y/N] :y
Save the server's public key? [Y/N] :y
The server's public key will be saved with the name 192.168.1.254. Please wait..
.
Enter 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-17 15:33:52.
<SWA>
<SWA>display users
User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag
+ 0 CON 0 00:00:00 no
Username : Unspecified
34 VTY 0 00:03:15 SSH 192.168.1.1 pass no
Username : admin
<SWA>
<SWA>display rsa local-key-pair public
=====================================================
Time of Key pair created: 15:22:58 2023/10/17
Key name: SWA_Host
Key type: RSA encryption Key
=====================================================
Key code:
3047
0240
D2C0DC32 776031BE 08E9A99D 478A213A 5A0B5DC3
32F4F68F D5325F6A 633D4B29 A56650E9 B1F3AC70
---------省略---------
0203
010001
<SWA>
(1)在PC1上,使用telnet 192.168.1.254进行Password方式登录测试。
(2)在PC1上,使用telnet 192.168.1.254进行AAA方式登录测试。
(3)在PC1上,使用stelnet 192.168.1.254进行登录测试。
(4)在SWA上,使用display users命令查看已经登录的用户信息。
(5)在SWA上,使用display rsa local-key-pair public命令查看本地秘钥对公钥信息。
(1)交换机进行远程连接的前提条件是需要配置IP地址使网络联通。
(2)访问交换机VTY接口有两种选择:Telnet和SSH。
(3)Telnet属于明文传送的信息,不够安全,而SSH使用密钥加密后传送,是推荐使用的带内管理方式。
(4)配置VTY用户界面的验证方式为AAA时,可以使用protocol inbound ssh命令设置只支持SSH协议,设备自动禁止Telent功能。
注:此为记录笔记,如有不足,还望海涵,可留言斧正
版权说明:如非注明,本站文章均为 扬州驻场服务-网络设备调试-监控维修-南京泽同信息科技有限公司 原创,转载请注明出处和附带本文链接。
请在这里放置你的在线分享代码