ensp基础操作

拓扑图

请添加图片描述

实验要求,按照提示学习基础ensp命令

1、交换机恢复出厂设置
<SWA>reset saved-configuration \恢复出厂

<SWA>reboot \ \ 重启交换机
2、交换机改名字
[Huawei]sysname SWA [SWA]``
3、设置时区
<SWA>clock datetime 12:00:00 2020-05-27 //设置系统时间

<SWA>clock timezone ?

STRING<1-32> 时区名称

<SWA>clock timezone BJ add 08:23:00

<SWA>display clock

2023091212:38:20+08:23

星期二

时区(BJ) : UTC+08:23
4、设置语言
<SWA>language-mode Chinese
Change language mode, confirm? [Y/N] y
提示:改变语言模式成功。
5、配置交换机远程登录地址
[SWA]int Vlanif 1
[SWA-Vlanif1]ip ad
[SWA-Vlanif1]ip address 192.168.1.254 24
[SWA-Vlanif1]
6、配置取消干扰、永不超时
<SWA>undo terminal monitor
提示:当前终端禁止所有类信息输出。

[SWA]user-interface console 0
[SWA-ui-console0]id
[SWA-ui-console0]idle-timeout 0 // 用不超时
[SWA-ui-console0]q
7、配置 Console 密码
[SWA-ui-console0]authentication-mode password
[SWA-ui-console0]ser
[SWA-ui-console0]set
[SWA-ui-console0]set ?
authentication 配置用户终端接口的认证参数
bootrom

[SWA-ui-console0]set au
[SWA-ui-console0]set authentication pa
[SWA-ui-console0]set authentication password si
[SWA-ui-console0]set authentication password simple 1324

测试登录

Password:1324
<SWA>
8、aaa 认证
[SWA]user-interface console 0
[SWA-ui-console0]auth
[SWA-ui-console0]authentication-mode aaa

[SWA]aaa
[SWA-aaa]loc
[SWA-aaa]local-user admin pa
[SWA-aaa]local-user admin password si
[SWA-aaa]local-user admin password simple 1234
[SWA-aaa]re
[SWA-aaa]retu
[SWA-aaa]return
<SWA>q User interface con0 is available
User:admin
Password:1324
<SW>
9、关闭提示
[Huawei]undo info enable
Info: Information center is disabled.
[Huawei]
10、配置接口
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]po
[Huawei-GigabitEthernet0/0/1]port l
[Huawei-GigabitEthernet0/0/1]port link-t
[Huawei-GigabitEthernet0/0/1]port link-type ac
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]
11、配置接口带宽
[Huawei-GigabitEthernet0/0/1]speed ?
10 10M port speed mode
100 100M port speed mode
1000 1000M port speed mode
auto-negotiation Auto negotiation

[Huawei-GigabitEthernet0/0/1]speed 100
Error: Please undo negotiation auto first. //错误
[Huawei-GigabitEthernet0/0/1]undo neg
[Huawei-GigabitEthernet0/0/1]undo negotiation au
[Huawei-GigabitEthernet0/0/1]undo negotiation auto // 关闭系统带宽
[Huawei-GigabitEthernet0/0/1]sp
[Huawei-GigabitEthernet0/0/1]speed 100
[Huawei-GigabitEthernet0/0/1]

配置接口双工

[Huawei-GigabitEthernet0/0/1]duplex ?
full Full-Duplex mode
half Half-Duplex mode

[Huawei-GigabitEthernet0/0/1]undo negotiation au
[Huawei-GigabitEthernet0/0/1]undo negotiation auto
[Huawei-GigabitEthernet0/0/1]fu
[Huawei-GigabitEthernet0/0/1]du
[Huawei-GigabitEthernet0/0/1]duplex
[Huawei-GigabitEthernet0/0/1]duplex fu
[Huawei-GigabitEthernet0/0/1]duplex full
[Huawei-GigabitEthernet0/0/1]
12、管理 mac 地址
[Huawei]display mac-address

MAC address table of slot 0:

MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID

 VSI/SI MAC-Tunnel

**5489-9822-0d06 1 - - Eth0/0/1 dynamic 0/-**

Total matching items on slot 0 displayed = 1

(2)使用 mac-地址静态命令在交换机中添加静态条目,并显示 mac 地址表

[Huawei]mac-address static 5489-9822-0d7 Ethernet 0/0/1 vlan 1
[Huawei]
13、删除 mac 地址
<Huawei>reset arp all
Warning: This operation will reset all static and dynamic ARP entries, and clear
the configurations of all static ARP, continue?[Y/N]:y
<Huawei>display mac-address
<Huawei>
14、查看设备当前配置
[Huawei]display current-configuration

#

sysname Huawei

#

undo info-center enable

#

cluster enable
ntdp enable
ndp enable

#

drop illegal-mac alarm

#

diffserv domain default

#

drop-profile default

#

aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http

#

interface Vlanif1
ip address 192.168.1.250 255.255.255.0

#

interface MEth0/0/1

#

interface Ethernet0/0/1

#

#

interface GigabitEthernet0/0/1
port media type copper
port link-type access

#

interface GigabitEthernet0/0/2

#

interface NULL0

#

mac-address static 5489-9822-00d7 Ethernet0/0/1 vlan 1

#

user-interface con 0
user-interface vty 0 4

#

return

## 实验心得:



ort media type copper
port link-type access

#

interface GigabitEthernet0/0/2

#

interface NULL0

#

mac-address static 5489-9822-00d7 Ethernet0/0/1 vlan 1

#

user-interface con 0
user-interface vty 0 4

#

return
<think>好的,用户想在华为交换机上通过ENSP配置SSH服务。我需要回忆一下相关的配置步骤。首先,确保设备支持SSH,可能需要检查VRP版本。然后,基本步骤应该包括生成RSA密钥对,配置VTY用户界面,设置认证方式为AAA,并在AAA中创建用户和密码。另外,还要开启SSH服务,并将协议设置为SSH。可能会有一些细节需要注意,比如SSH版本的选择,或者是否启用STELNET服务。同时,用户可能遇到无法连接的问题,可能需要检查网络连通性、ACL限制或者SSH配置是否正确。还需要提醒用户保存配置,避免重启后丢失。接下来要组织这些步骤,确保逻辑清晰,并且用中文准确描述每个配置命令。最后生成相关问题,比如SSH版本的区别、常见故障排查方法等。确保引用正确的命令格式,避免错误。</think>### 华为交换机通过ENSP配置SSH服务步骤 #### **1. 基础环境准备** - 确保交换机VRP系统支持SSH功能(通常要求V200R003C00及以上版本) - 使用Console线连接设备完成初始配置 #### **2. 网络参数配置** ```bash system-view sysname SSH-SWITCH # 设备命名 interface Vlanif1 # 配置管理VLAN ip address 192.168.1.1 24 ``` #### **3. 密钥生成与配置** ```bash rsa local-key-pair create # 生成RSA密钥对 Keys generated successfully! # 确认密钥生成成功提示 ``` #### **4. SSH服务核心配置** ```bash stelnet server enable # 开启SSH服务 ssh user admin # 创建SSH用户 ssh user admin service-type stelnet # 指定服务类型为STelnet ssh user admin authentication-type password # 设置密码认证 ``` #### **5. AAA认证配置** ```bash aaa local-user admin password irreversible-cipher Huawei@123 # 设置不可逆加密密码 local-user admin privilege level 15 # 设置用户权限等级 local-user admin service-type ssh # 绑定SSH服务 ``` #### **6. VTY终端配置** ```bash user-interface vty 0 4 authentication-mode aaa # 认证模式设为AAA protocol inbound ssh # 指定SSH协议 idle-timeout 15 0 # 设置超时时间(分钟+秒) ``` #### **7. 功能验证** ```bash display ssh user admin # 查看用户状态 display ssh server-status # 检查服务状态 ``` 通过PC使用SSH客户端连接验证:`ssh admin@192.168.1.1` ### **关键配置要点** 1. **密钥长度要求**:VRPv8系统默认使用2048位RSA密钥,旧版本需指定模数`rsa local-key-pair modulus 2048` 2. **协议版本选择**:通过`ssh server compatible-ssh1x enable`可兼容老版本协议,但存在安全风险[^2] 3. **ACL访问控制**:可通过`acl 2000`+`rule permit source`配合`user-interface vty`下的`acl 2000 inbound`实现访问限制 ### **典型故障排查** - **连接超时**:检查`stelnet server enable`状态和VLAN接口状态 - **认证失败**:确认AAA密码加密方式是否匹配(`irreversible-cipher` vs `cipher`) - **协议拒绝**:验证VTY线路的`protocol inbound ssh`配置
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值