当前位置: 首页 > news >正文

实验2.1.3 交换机的远程配置

实验2.1.3 交换机的远程配置

  • 一、任务描述
  • 二、任务分析
  • 三、实验拓扑
  • 四、具体要求
  • 五、任务实施
      • (一) password认证
          • 1. 进入系统视图重命名交换机的名称为SWA
          • 2. 关闭干扰信息
          • 3. 设置vty为0-4
          • 4. 设置认证方式为password
          • 5. 设置登录密码为:huawei
          • 6. 设置用户级别为2级,这样才能远程登录
          • 7. 设置超时时间为10分钟
          • 8.远程管理地址
          • 9.用交换机模拟远程登录(因为模拟器中的计算机没有自带的telnet客户端)
      • (二) AAA认证
          • 1.设置用户名admin,密码为hello,级别为2
          • 2.设置认证类型为telnet
          • 3.设置vty(前面配置过,因为这里认证方式不一样,所以需要重新配置)
          • 4.测试交换机(PC1)能否登录到交换机上(可以)
      • (三)stelnet认证
          • 1.在不保存的情况下重启交换机(或重新建拓扑图)
          • 2.重命名和关闭干扰信息
          • 3.开启stelnet(ssh)服务
          • 4.配置Vlanif1的IP(远程管理的IP地址)
          • 5.使用rsa local-key-pair create命令生成本地RSA主机秘钥对,默认就行
          • 6.配置ssh用户登录界面。配置认证方式为aaa,设置用户名为admin,密码为hello,等级为2。
          • 8. 设置本地用户的接入类型为ssh
          • 9.设置ssh登录用户为admin,登录类型为password
          • 10.设置vty认证模式为aaa
          • 11.设置只能通过ssh登录(只支持ssh协议,禁止telnet功能)
          • 12.添加一个ssh user的stelnet,如果没有这一行是实现不了的
          • 13.在不保存的情况下重启PC1,重命名并配置IP
          • 14.在pc1上 开启ssh用户端首次认证功能
          • 15.在PC1上测试,用户名和密码为之前设置的
      • (四)使用display users命令查看已经登录的用户信息
      • (五)使用display rsa local-key-pair public命令查看本地秘钥对公钥信息
  • 六、任务验收
  • 七、任务小结


一、任务描述

某公司在组建局域网时所购置的交换机已经完成了基本配置,现在全部接入网络,并投入使用。为了方便对交换机进行维护和管理,现在需要配置其远程管理功能。

二、任务分析

远程管理极大地提高了用户操作的灵活性。远程管理主要分为Telnet和STelnet两种方式。如果为交换机分配了管理IP地址,则可以使用Telnet和STelnet客户端连接到交换机。但是VTY线路并不安全,可以为VTY线路配置密码身份验证来保护通过VTY线路对交换机的访问。

三、实验拓扑

在这里插入图片描述

四、具体要求

在这里插入图片描述

五、任务实施

(一) password认证

1. 进入系统视图重命名交换机的名称为SWA
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SWA
[SWA]
2. 关闭干扰信息
[SWA]undo info-center enable 
Info: Information center is disabled.
[SWA]
3. 设置vty为0-4
[SWA]user-interface vty 0 4
[SWA-ui-vty0-4]
4. 设置认证方式为password
[SWA-ui-vty0-4]authentication-mode password 
5. 设置登录密码为:huawei
[SWA-ui-vty0-4]set authentication password simple huawei
6. 设置用户级别为2级,这样才能远程登录
[SWA-ui-vty0-4]user privilege level 2
7. 设置超时时间为10分钟
[SWA-ui-vty0-4]idle-timeout 10
[SWA-ui-vty0-4]quit
8.远程管理地址

在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]
9.用交换机模拟远程登录(因为模拟器中的计算机没有自带的telnet客户端)

设置交换机的名字为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 authenticationPassword:
Info: The max number of VTY users is 5, and the numberof current VTY users on line is 1.The current login time is 2023-10-17 15:06:14.
<SWA>

(二) AAA认证

1.设置用户名admin,密码为hello,级别为2
<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]
2.设置认证类型为telnet
[SWA-aaa]local-user admin service-type telnet 
3.设置vty(前面配置过,因为这里认证方式不一样,所以需要重新配置)
[SWA-aaa]quit
[SWA]user-interface vty 0 4
[SWA-ui-vty0-4]authentication-mode aaa
[SWA-ui-vty0-4]
4.测试交换机(PC1)能否登录到交换机上(可以)
<SWA>telnet 192.168.1.254
Trying 192.168.1.254 ...
Press CTRL+K to abort
Connected to 192.168.1.254 ...Login authenticationUsername:admin
Password:
Info: The max number of VTY users is 5, and the numberof current VTY users on line is 2.The current login time is 2023-10-17 15:13:53.
<SWA>

注:以上两种password和aaa都为远程登录(telnet),都不够安全。

(三)stelnet认证

1.在不保存的情况下重启交换机(或重新建拓扑图)
<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>
2.重命名和关闭干扰信息
<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]
3.开启stelnet(ssh)服务
[SWA]stelnet server enable 
Info: Succeeded in starting the Stelnet server.
[SWA]
4.配置Vlanif1的IP(远程管理的IP地址)
[SWA]interface vlan 1
[SWA-Vlanif1]ip address 192.168.1.254 24
[SWA-Vlanif1]quit
5.使用rsa local-key-pair create命令生成本地RSA主机秘钥对,默认就行
[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]
6.配置ssh用户登录界面。配置认证方式为aaa,设置用户名为admin,密码为hello,等级为2。
[SWA]aaa
[SWA-aaa]local-user admin password cipher hello privilege level 2
8. 设置本地用户的接入类型为ssh
[SWA-aaa]local-user admin service-type ssh
[SWA-aaa]quit
9.设置ssh登录用户为admin,登录类型为password
[SWA]ssh user admin authentication-type password
10.设置vty认证模式为aaa
[SWA]user-interface vty 0 4
[SWA-ui-vty0-4]authentication-mode aaa
11.设置只能通过ssh登录(只支持ssh协议,禁止telnet功能)
[SWA-ui-vty0-4]protocol inbound ssh 
[SWA-ui-vty0-4]idle-timeout 10 //设置断连时间为10分钟
12.添加一个ssh user的stelnet,如果没有这一行是实现不了的
[SWA]ssh user admin service-type stelnet 
13.在不保存的情况下重启PC1,重命名并配置IP
<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
14.在pc1上 开启ssh用户端首次认证功能
[PC1]ssh client first-time enable 
15.在PC1上测试,用户名和密码为之前设置的
[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 numberof current VTY users on line is 1.The current login time is 2023-10-17 15:33:52.
<SWA>

(四)使用display users命令查看已经登录的用户信息

<SWA>display usersUser-Intf    Delay    Type   Network Address     AuthenStatus    AuthorcmdFlag
+ 0   CON 0   00:00:00                                                  no      Username : Unspecified34  VTY 0   00:03:15  SSH    192.168.1.1               pass           no      Username : admin
<SWA>

(五)使用display rsa local-key-pair public命令查看本地秘钥对公钥信息

<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:
30470240D2C0DC32 776031BE 08E9A99D 478A213A 5A0B5DC332F4F68F D5325F6A 633D4B29 A56650E9 B1F3AC70---------省略---------0203010001
<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功能。


注:此为记录笔记,如有不足,还望海涵,可留言斧正

http://www.lryc.cn/news/196050.html

相关文章:

  • 基于边缘网关构建水污染监测治理方案
  • Spring事件ApplicationEvent源码浅读
  • 51单片机点阵
  • 远程VPN登录,IPsec,VPN,win10
  • “零代码”能源管理平台:智能管理能源数据
  • 【SA8295P 源码分析 (一)】06 - SA8295P XBL Loader 阶段 sbl1_main_ctl 函数代码分析
  • Java版本spring cloud + spring boot企业电子招投标系统源代码
  • 软考高级信息系统项目管理师系列论文一:论信息系统项目的整体管理
  • 【前端】JS - WebAPI
  • H5+Vue3编写官网,并打包发布到同一个域名下
  • 黑马mysql教程笔记(mysql8教程)基础篇——函数(字符串函数、数值函数、日期函数、流程函数)
  • Python武器库开发-基础篇(一)
  • Qt (QFileDialogQColorDialogQFontDialog) 对话框实战
  • 2.SpringSecurity - 处理器简单说明
  • AGI热门方向:国内前五!AI智能体TARS-RPA-Agent落地,实在智能打造人手一个智能助理
  • 运动品牌如何做到“全都要”?来看看安踏的答案
  • LeetCode75——Day6
  • http代理有什么好处,怎么通过http代理服务安全上网呢?
  • vue3后台管理框架之axios二次封装
  • 你的Github账户可能被封禁!教你应对Github最新的2FA二次验证! 无地区限制, 无额外设备的全网最完美方案
  • 【C语言】#define宏与函数的优劣对比
  • flask基础开发知识学习
  • 内网和热点同时连接使用配置
  • C语言 形参、实参
  • linux入门到精通-第四章-gcc编译器
  • HCIP静态路由综合实验
  • nginx前端配置(新)
  • js,jquery,vue设置html标签隐藏不显示
  • 口袋参谋:如何实时监控对手数据?
  • Q-learning如何与ABC等一些元启发式算法能够结合在一起?