H3C S6813-48X6C-6615P07 交换机 常用配置举例

本地登录用户账号配置

# 创建名为ssh-admin的用户
local-user ssh-admin class manage

# 配置用户密码为PASSWORD.123
 password simple PASSWORD.123

# 配置用户服务类型为SSH
 service-type ssh

# 配置用户权限角色
 authorization-attribute user-role network-admin
 authorization-attribute user-role network-operator

#(可选)配置用户密码安全性要求
 password-control length 16
 password-control composition type-number 4 type-length 2
 password-control login-attempt 3 exceed lock-time 30

SSH服务配置

# 开启SSH服务
 ssh server enable

#(可选)配置可使用SSH服务的白名单IP
acl basic 2999
 description ssh.login.permit.list--------
 rule 0 permit source 10.0.20.0 0.0.0.255

#(可选)应用白名单给SSH服务
 ssh server acl 2999

VTY开启SSH登录支持

# 选择vty范围
line vty 0 63

# 登录验证模式
 authentication-mode scheme

# 用户角色
 user-role network-admin
 user-role network-operator

# 认证协议
 protocol inbound ssh

# 无操作超时时间
 idle-timeout 300 0

# 每次执行命令后打印的行数
 screen-length 50

console口登录配置

line aux 1
 authentication-mode password
 user-role network-admin
 set authentication password simple PASSWORD.123

上行连「核心/汇聚交换机」设备的(根)端口配置聚合口

# 先创建聚合口
interface Bridge-Aggregation1
 description up.link.Core.SW------
 port link-type trunk
 undo port trunk permit vlan 1
 port trunk permit vlan 2 to 4094
 link-aggregation mode dynamic

# 再将物理口加入聚合口
interface HundredGigE1/0/50
 port link-mode bridge
 description up.link.Core.SW-BAGG1-----
 port link-type trunk
 undo port trunk permit vlan 1
 port trunk permit vlan 2 to 4094
 port link-aggregation group 1


STP生成树 相关 配置说明

image

下行连「接入交换机」设备的(指定)端口配置根保护功能 stp root-protection

缺省情况下,端口上的根保护功能处于关闭状态。

在同一个端口上,不允许同时配置根保护功能和环路保护功能。

对于开启了根保护功能的端口,其在所有MSTI上的端口角色只能为指定端口。

一旦该端口收到某MSTI优先级更高的BPDU,立即将该MSTI端口设置为侦听状态,不再转发报文(相当于将此端口相连的链路断开)。

当在2倍的Forward Delay时间内没有收到更优的BPDU时,端口会恢复原来的正常状态。

interface Ten-GigabitEthernet1/0/48
 port link-mode bridge
 port link-type trunk
 undo port trunk permit vlan 1
 port trunk permit vlan 2 to 4094
 stp root-protection

接入交换机连终端(服务器/PC等)设备配置边缘端口 stp edged-port

纯边缘端口配置edged-port + bpdu-protection即可,无需loop-protection。BPDU保护功能对开启了环回测试功能的端口无效。

缺省情况下,全局的BPDU保护功能处于关闭状态。

缺省情况下,边缘端口的BPDU保护功能与全局的BPDU保护功能的开关状态保持一致。

BPDU保护功能支持在系统视图下配置或在指定端口配置。

对于一个端口来说,优先采用该端口的配置,只有该端口内未进行配置时,才采用全局的配置。

配置端口的BPDU保护功能时,请在直连用户终端的端口上配置,勿在连接其他设备或共享网段的端口上配置。

interface Ten-GigabitEthernet2/0/1
 port link-mode bridge
 port access vlan 2021
 stp edged-port
 stp port bpdu-protection enable
 undo lldp enable

上行连「核心/汇聚交换机」设备的(根/替换)端口配置环路保护功能 stp loop-protection

在设备的根端口和替换端口上配置本功能。

在开启了环路保护功能的端口上,其所有MSTI的初始状态均为Discarding状态:如果该端口收到了BPDU,这些MSTI可以进行正常的状态迁移;否则,这些MSTI将一直处于Discarding状态以避免环路的产生。

请不要在与用户终端相连的端口上开启环路保护功能,否则该端口会因收不到BPDU而导致其所有MSTI将一直处于Discarding状态。

在同一个端口上,不允许同时配置边缘端口和环路保护功能,或者同时配置根保护功能和环路保护功能。

以下端口配置环路保护功能后,该端口不会因收不到BPDU而导致其一直处于Discarding状态,而是进行端口状态迁移,经过两个Forward Delay时长后再次变为Forwarding状态:

1、端口状态从down变成up。

2、处于up状态的端口,生成树功能状态从关闭变成开启。

缺省情况下,端口的环路保护功能处于关闭状态。

# 按需配置,我没配置此参数
posted @ 2025-06-20 14:53  Ojox  阅读(36)  评论(0)    收藏  举报