H3C网管交换机环路检测 VLAN-block 处理模式配置举例

一、组网需求
• 三台设备 Device A、Device B 和 Device C 组成一个物理上的环形网络。
• 通过在 Device A 上开启环路检测功能,并采用 VLAN-block 模式,使系统能够自动阻塞 Device  A 上出现环路的 VLAN,并通过打印日志信息来通知用户检查网络。

二、 组网图
环路检测 VLAN-block 处理模式配置组网图

三、配置步骤
(1) 配置 Device A
# 创建 VLAN 100,指定 VLAN 100 为保护 VLAN,并全局开启该 VLAN 内的环路检测功能。
<DeviceA> system-view
[DeviceA] vlan 100
[DeviceA–vlan100] quit
[DeviceA] loopback-detection protected-vlan 100
[DeviceA] loopback-detection global enable vlan 100

# 配置端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 为 Trunk 类型,并允许VLAN 100 通过。
[DeviceA] interface ten-gigabitethernet 1/0/1
[DeviceA-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceA-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceA-Ten-GigabitEthernet1/0/1] quit
[DeviceA] interface ten-gigabitethernet 1/0/2
[DeviceA-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceA-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceA-Ten-GigabitEthernet1/0/2] quit

# 配置端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 的环路检测处理模式为VLAN-block 模式。
[DeviceA] interface ten-gigabitethernet 1/0/1
[DeviceA-Ten-GigabitEthernet1/0/1] undo stp enable
[DeviceA-Ten-GigabitEthernet1/0/1] loopback-detection action vlan-block
[DeviceA-Ten-GigabitEthernet1/0/1] quit
[DeviceA] interface ten-gigabitethernet 1/0/2
[DeviceA-Ten-GigabitEthernet1/0/2] undo stp enable
[DeviceA-Ten-GigabitEthernet1/0/2] loopback-detection action vlan-block
[DeviceA-Ten-GigabitEthernet1/0/2] quit

# 配置环路检测的时间间隔为 35 秒。
[DeviceA] loopback-detection interval-time 35

(2) 配置 Device B
# 创建 VLAN 100。
<DeviceB> system-view
[DeviceB] vlan 100
[DeviceB–vlan100] quit

# 配置端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 为 Trunk 类型,并允许VLAN 100 通过。
[DeviceB] interface ten-gigabitethernet 1/0/1
[DeviceB-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceB-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceB-Ten-GigabitEthernet1/0/1] quit
[DeviceB] interface ten-gigabitethernet 1/0/2
[DeviceB-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceB-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceB-Ten-GigabitEthernet1/0/2] quit

(3) 配置 Device C
# 创建 VLAN 100。
<DeviceC> system-view
[DeviceC] vlan 100
[DeviceC–vlan100] quit

# 配置端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 为 Trunk 类型,并允许VLAN 100 通过。
[DeviceC] interface ten-gigabitethernet 1/0/1
[DeviceC-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceC-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceC-Ten-GigabitEthernet1/0/1] quit
[DeviceC] interface ten-gigabitethernet 1/0/2
[DeviceC-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceC-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceC-Ten-GigabitEthernet1/0/2] quit

四、 验证配置
当配置完成后,系统在一个环路检测时间间隔内在 Device A 的端口 Ten-GigabitEthernet1/0/1 和Ten-GigabitEthernet1/0/2 上都检测到了环路,并打印了如下日志信息。
 验证配置
# 显示 Device A 上环路检测的配置和运行情况。
显示 Device A 上环路检测的配置和运行情况
由此可见,Device A 在端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 上检测到环路。由于环路检测功能运行在 VLAN-block 模式下,端口 Ten-GigabitEthernet1/0/1 和Ten-GigabitEthernet1/0/2 上出现环路后 VLAN 100 均已被阻塞,因此设备打印的日志信息显示这两个端口上的环路已消除。

H3C网管交换机环路检测典型配置举例

一、组网需求
• 三台设备 Device A、Device B 和 Device C 组成一个物理上的环形网络。
• 通过在 Device A 上配置环路检测功能,使系统能够自动关闭 Device A 上出现环路的端口,并通过打印日志信息来通知用户检查网络。

二、 组网图
环路检测典型组网图

三、配置步骤
(1) 配置 Device A
# 创建 VLAN 100,并全局开启该 VLAN 内的环路检测功能。
<DeviceA> system-view
[DeviceA] vlan 100
[DeviceA–vlan100] quit
[DeviceA] loopback-detection global enable vlan 100

# 配置端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 为 Trunk 类型,并允许 VLAN 100
通过。
[DeviceA] interface ten-gigabitethernet 1/0/1
[DeviceA-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceA-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceA-Ten-GigabitEthernet1/0/1] quit
[DeviceA] interface ten-gigabitethernet 1/0/2
[DeviceA-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceA-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceA-Ten-GigabitEthernet1/0/2] quit

# 全局配置环路检测的处理模式为 Shutdown 模式。
[DeviceA] loopback-detection global action shutdown

# 配置环路检测的时间间隔为 35 秒。
[DeviceA] loopback-detection interval-time 35

(2) 配置 Device B
# 创建 VLAN 100。
<DeviceB> system-view
[DeviceB] vlan 100
[DeviceB–vlan100] quit

# 配置端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 为 Trunk 类型,并允许 VLAN 100
通过。
[DeviceB] interface ten-gigabitethernet 1/0/1
[DeviceB-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceB-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceB-Ten-GigabitEthernet1/0/1] quit
[DeviceB] interface ten-gigabitethernet 1/0/2
[DeviceB-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceB-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceB-Ten-GigabitEthernet1/0/2] quit

(3) 配置 Device C
# 创建 VLAN 100。
<DeviceC> system-view
[DeviceC] vlan 100
[DeviceC–vlan100] quit

# 配置端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 为 Trunk 类型,并允许 VLAN 100
通过。
[DeviceC] interface ten-gigabitethernet 1/0/1
[DeviceC-Ten-GigabitEthernet1/0/1] port link-type trunk
[DeviceC-Ten-GigabitEthernet1/0/1] port trunk permit vlan 100
[DeviceC-Ten-GigabitEthernet1/0/1] quit
[DeviceC] interface ten-gigabitethernet 1/0/2
[DeviceC-Ten-GigabitEthernet1/0/2] port link-type trunk
[DeviceC-Ten-GigabitEthernet1/0/2] port trunk permit vlan 100
[DeviceC-Ten-GigabitEthernet1/0/2] quit

四、 验证配置
当配置完成后,系统在一个环路检测时间间隔内在 Device A 的端口 Ten-GigabitEthernet1/0/1 和
Ten-GigabitEthernet1/0/2 上都检测到了环路,于是将这两个端口自动关闭,并打印了如下日志信息
验证配置
使用 display loopback-detection 命令可以查看 Device A 上环路检测的配置和运行情况:
# 显示 Device A 上环路检测的配置和运行情况。
查看 Device A 上环路检测的配置和运行情况
由此可见,Device A 上显示在端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 上检测到环路,由于 环 路 检 测 功能运行在 Shutdown 模式下,端口 Ten-GigabitEthernet1/0/1 和Ten-GigabitEthernet1/0/2 上出现环路后均已被自动关闭,因此设备打印的日志信息显示这两个端口上的环路已消除 。 此时, 使 用 display interface 命 令 分 别 查 看 Device A 上 端 口Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 的状态信息:

# 显示 Device A 上端口 Ten-GigabitEthernet1/0/1 的状态信息。
显示 Device A 上端口 Ten-GigabitEthernet1/0/1 的状态信息

# 显示 Device A 上端口 Ten-GigabitEthernet1/0/2 的状态信息。
显示 Device A 上端口 Ten-GigabitEthernet1/0/2 的状态信息

由此可见,端口 Ten-GigabitEthernet1/0/1 和 Ten-GigabitEthernet1/0/2 均已被环路检测模块自动关闭。

H3C网管交换机基于协议的VLAN典型配置举例

一、组网需求
如下图所示,实验室网络中大部分主机运行 IPv4 网络协议,另外为了教学需要还部署了 IPv6 实验局,因此,有些主机运行 IPv6 网络协议。为了避免互相干扰,将 VLAN 100 与 IPv4 协议、ARP 协议关联,VLAN 200 与 IPv6 协议关联,通过协议 VLAN 将 IPv4 流量和 IPv6 流量二层互相隔离。

二、 组网图
基于协议的 VLAN 组网图

三、配置步骤
(1) 配置 Device
# 创建 VLAN 100,将端口 GigabitEthernet1/0/3 加入 VLAN 100。
<Device> system-view
[Device] vlan 100
[Device-vlan100] description protocol VLAN for IPv4
[Device-vlan100] port gigabitethernet 1/0/3
[Device-vlan100] quit

# 创建 VLAN 200,将端口 GigabitEthernet1/0/4 加入 VLAN 200。
[Device] vlan 200
[Device-vlan200] description protocol VLAN for IPv6
[Device-vlan200] port gigabitethernet 1/0/4

# 将 IPv6 协议报文划分到 VLAN 200 中传输。
[Device-vlan200] protocol-vlan 1 ipv6
[Device-vlan200] quit

# 将 IPv4 协议报文和采用 Ethernet II 封装格式的 ARP 协议报文(ARP 报文对应的封装格式为Ethernet II)划分到 VLAN 100 中传输。
[Device] vlan 100
[Device-vlan100] protocol-vlan 1 ipv4
[Device-vlan100] protocol-vlan 2 mode ethernetii etype 0806
[Device-vlan100] quit

# 配置端口GigabitEthernet1/0/1为Hybrid端口,允许VLAN 100、200通过,并且在发送VLAN 100、200 的报文时不携带 VLAN Tag。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] port link-type hybrid
[Device-GigabitEthernet1/0/1] port hybrid vlan 100 200 untagged

# 配置端口 GigabitEthernet1/0/1 与 VLAN 100 的协议模板 1(即 IPv4 协议模板)、协议模板 2(即ARP 协议模板)和 VLAN 200 的协议模板 1(即 IPv6 协议模板)进行绑定。
[Device-GigabitEthernet1/0/1] port hybrid protocol-vlan vlan 100 1 to 2
[Device-GigabitEthernet1/0/1] port hybrid protocol-vlan vlan 200 1
[Device-GigabitEthernet1/0/1] quit

# 配置端口GigabitEthernet1/0/2为Hybrid端口,允许VLAN 100、200通过,并且在发送VLAN 100、200 的报文时不携带 VLAN Tag。
[Device] interface gigabitethernet 1/0/2
[Device-GigabitEthernet1/0/2] port link-type hybrid
[Device-GigabitEthernet1/0/2] port hybrid vlan 100 200 untagged

# 配置端口 GigabitEthernet1/0/2 与 VLAN 100 的协议模板 1(即 IPv4 协议模板)、协议模板 2(即ARP 协议模板)和 VLAN 200 的协议模板 1(即 IPv6 协议模板)进行绑定。
[Device-GigabitEthernet1/0/2] port hybrid protocol-vlan vlan 100 1 to 2
[Device-GigabitEthernet1/0/2] port hybrid protocol-vlan vlan 200 1
[Device-GigabitEthernet1/0/2] quit

(2) L2 switch A 和 L2 switch B 采用缺省配置

(3) 配置 Host 和 Server
将 IPv4 Host A、IPv4 Host B 和 IPv4 Server 配置在一个网段,比如 192.168.100.0/24;将 IPv6 Host  A、IPv6 Host B 和 IPv6 Server 配置在一个网段,比如 2001::1/64。

四、显示与验证
(1) 通过 ping 命令查看
VLAN 100 内的主机和服务器能够互相 Ping 通;VLAN 200 内的主机和服务器能够互相 Ping 通。但 VLAN 100 内的主机/服务器与 VLAN 200 内的主机/服务器之间会 Ping 失败。
(2) 通过显示信息查看
# 查看所有协议 VLAN 的信息。
[Device] display protocol-vlan vlan all
查看所有协议 VLAN 的信息

# 查看所有端口关联的协议 VLAN 的信息。
[Device] display protocol-vlan interface all
查看所有端口关联的协议 VLAN 的信息

H3C网管交换机基于MAC的VLAN典型配置举例

一、组网需求
如下图所示,办公区的主机属于不同的网段 192.168.5.0/24 和 192.168.50.0/24,Device C 在收到来自办公区主机的报文时,根据报文的源 IP 地址,使来自不同网段主机的报文分别在指定的 VLAN中传输,其中,来自网段 192.168.5.0/24 的报文在 VLAN 100 中传输,来自网段 192.168.50.0/24的报文在 VLAN 200 中传输。

二、 组网图
基于 IP 子网的 VLAN 组网图

三、配置步骤
(1) 配置 Device C
# 配置子网 192.168.5.0/24 与 VLAN 100 关联。
<DeviceC> system-view
[DeviceC] vlan 100
[DeviceC-vlan100] ip-subnet-vlan ip 192.168.5.0 255.255.255.0
[DeviceC-vlan100] quit

# 配置子网 192.168.50.0/24 与 VLAN 200 关联。
[DeviceC] vlan 200
[DeviceC-vlan200] ip-subnet-vlan ip 192.168.50.0 255.255.255.0
[DeviceC-vlan200] quit

# 配置端口 GigabitEthernet1/0/2 为 Hybrid 端口,允许 VLAN 100 通过,并且在发送 VLAN 100 的报文时携带 VLAN Tag。
[DeviceC] interface gigabitethernet 1/0/2
[DeviceC-GigabitEthernet1/0/2] port link-type hybrid
[DeviceC-GigabitEthernet1/0/2] port hybrid vlan 100 tagged
[DeviceC-GigabitEthernet1/0/2] quit

# 配置端口 GigabitEthernet1/0/3 为 Hybrid 端口,允许 VLAN 200 通过,并且在发送 VLAN 200 的报文时携带 VLAN Tag。
[DeviceC] interface gigabitethernet 1/0/3
[DeviceC-GigabitEthernet1/0/3] port link-type hybrid
[DeviceC-GigabitEthernet1/0/3] port hybrid vlan 200 tagged
[DeviceC-GigabitEthernet1/0/3] quit

# 配置端口GigabitEthernet1/0/1为Hybrid端口,允许VLAN 100、200通过,并且在发送VLAN 100、200 的报文时不携带 VLAN Tag。
[DeviceC] interface gigabitethernet 1/0/1
[DeviceC-GigabitEthernet1/0/1] port link-type hybrid
[DeviceC-GigabitEthernet1/0/1] port hybrid vlan 100 200 untagged

# 配置端口 GigabitEthernet1/0/1 和基于 IP 子网的 VLAN 100、200 关联。
[DeviceC-GigabitEthernet1/0/1] port hybrid ip-subnet-vlan vlan 100
[DeviceC-GigabitEthernet1/0/1] port hybrid ip-subnet-vlan vlan 200
[DeviceC-GigabitEthernet1/0/1] quit

(2) 配置 Device A 和 Device B
配置 Device A 和 Device B 允许对应 VLAN 通过,配置过程略

四、显示与验证
# 查看所有子网 VLAN 的信息。
[DeviceA]display ip-subnet-vlan vlan all
查看所有子网 VLAN 的信息

# 查看端口 GigabitEthernet1/0/1 关联的子网 VLAN 的信息
[DeviceC] display ip-subnet-vlan interface gigabitethernet 1/0/1
查看端口 GigabitEthernet1/0/1 关联的子网 VLAN 的信息

H3C网管交换机基于MAC的VLAN典型配置举例

一、组网需求
• 如下图所示,Device A 和 Device C 的 GigabitEthernet1/0/1 端口分别连接到两个会议室,Laptop1 和 Laptop2 是会议用笔记本电脑,会在两个会议室间移动使用。
• Laptop1 和 Laptop2 分别属于两个部门,两个部门间使用 VLAN 100 和 VLAN 200 进行隔离。现要求这两台笔记本电脑无论在哪个会议室使用,均只能访问自己部门的服务器,即 Server1和 Server2。

二、 组网图
基于 MAC 的 VLAN 组网图

三、配置步骤
(1) Device A 的配置
# 创建 VLAN 100 和 VLAN 200。
<DeviceA> system-view
[DeviceA] vlan 100
[DeviceA-vlan100] quit
[DeviceA] vlan 200
[DeviceA-vlan200] quit

# 将 Laptop1 的 MAC 地址与 VLAN 100 关联,Laptop2 的 MAC 地址与 VLAN 200 关联。
[DeviceA] mac-vlan mac-address 000d-88f8-4e71 vlan 100
[DeviceA] mac-vlan mac-address 0014-222c-aa69 vlan 200

# 配置终端的接入端口: Laptop1 和 Laptop2 均可能从 GigabitEthernet1/0/1 接入,将GigabitEthernet1/0/1 的端口类型配置为 Hybrid,并使其在发送 VLAN 100 和 VLAN 200 的报文时去掉 VLAN Tag;开启 GigabitEthernet1/0/1 端口的 MAC VLAN 功能。
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] port link-type hybrid
[DeviceA-GigabitEthernet1/0/1] port hybrid vlan 100 200 untagged
[DeviceA-GigabitEthernet1/0/1] mac-vlan enable
[DeviceA-GigabitEthernet1/0/1] quit

# 为了终端能够访问 Server1 和 Server2,需要将上行端口 GigabitEthernet1/0/2 的端口类型配置为Trunk,并允许 VLAN 100 和 VLAN 200 的报文通过。
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] port link-type trunk
[DeviceA-GigabitEthernet1/0/2] port trunk permit vlan 100 200
[DeviceA-GigabitEthernet1/0/2] quit

(2) Device B 的配置
# 创建 VLAN 100 和 VLAN 200,并将 GigabitEthernet1/0/3 加入 VLAN 100,GigabitEthernet1/0/4加入 VLAN 200。
<DeviceB> system-view
[DeviceB] vlan 100
[DeviceB-vlan100] port gigabitethernet 1/0/3
[DeviceB-vlan100] quit
[DeviceB] vlan 200
[DeviceB-vlan200] port gigabitethernet 1/0/4
[DeviceB-vlan200] quit

# 配置 GigabitEthernet1/0/1 和 GigabitEthernet1/0/2 端口为 Trunk 端口,均允许 VLAN 100 和 VLAN200 的报文通过。
[DeviceB] interface gigabitethernet 1/0/1
[DeviceB-GigabitEthernet1/0/1] port link-type trunk
[DeviceB-GigabitEthernet1/0/1] port trunk permit vlan 100 200
[DeviceB-GigabitEthernet1/0/1] quit
[DeviceB] interface gigabitethernet 1/0/2
[DeviceB-GigabitEthernet1/0/2] port link-type trunk
[DeviceB-GigabitEthernet1/0/2] port trunk permit vlan 100 200
[DeviceB-GigabitEthernet1/0/2] quit

(3) Device C 的配置
Device C 的配置与 Device A 完全一致,这里不再赘述。

四、显示与验证
(1) Laptop1 只能访问 Server1,不能访问 Server2;Laptop2 只能访问 Server2,不能访问Server1。
(2) 在 Device A 和 Device C 上可以查看到 Laptop1 和 VLAN 100、Laptop2 和 VLAN 200 的静态MAC VLAN 地址表项已经生成。以 Device A 为例:
[DeviceA] display mac-vlan all
 显示与验证

H3C网管交换机基于端口的VLAN典型配置举例

一、组网需求
•  Host A 和 Host C 属于部门 A,但是通过不同的设备接入公司网络;Host B 和 Host D 属于部门 B,也通过不同的设备接入公司网络。
• 为了通信的安全性,也为了避免广播报文泛滥,公司网络中使用 VLAN 技术来隔离部门间的二层流量。其中部门 A 使用 VLAN 100,部门 B 使用 VLAN 200。

二、 组网图
基于端口的 VLAN 组网图

三、配置步骤
(1) 配置 Device A
# 创建 VLAN 100,并将 GigabitEthernet1/0/1 加入 VLAN 100。
<DeviceA> system-view
[DeviceA] vlan 100
[DeviceA-vlan100] port gigabitethernet 1/0/1
[DeviceA-vlan100] quit

# 创建 VLAN 200,并将 GigabitEthernet1/0/2 加入 VLAN 200。
[DeviceA] vlan 200
[DeviceA-vlan200] port gigabitethernet 1/0/2
[DeviceA-vlan200] quit

# 为了使 Device A 上 VLAN 100 和 VLAN 200 的报文能发送给 Device B,将 GigabitEthernet1/0/3的链路类型配置为 Trunk,并允许 VLAN 100 和 VLAN 200 的报文通过。
[DeviceA] interface gigabitethernet 1/0/3
[DeviceA-GigabitEthernet1/0/3] port link-type trunk
[DeviceA-GigabitEthernet1/0/3] port trunk permit vlan 100 200

(2) Device B 上的配置与 Device A 上的配置相同,不再赘述。

(3) 将 Host A 和 Host C 配置在一个网段,比如 192.168.100.0/24;将 Host B 和 Host D 配置在一个网段,比如 192.168.200.0/24。

四、验证配置
(1) Host A 和 Host C 能够互相 ping 通,但是均不能 ping 通 Host B 和 Host D。Host B 和 Host D能够互相 ping 通,但是均不能 ping 通 Host A 和 Host C。
(2) 通过查看显示信息验证配置是否成功。
# 查看 Device A 上 VLAN 100 和 VLAN 200 的配置信息,验证以上配置是否生效。
[DeviceA-GigabitEthernet1/0/3] display vlan 100
查看 Device A 上 VLAN 100 和 VLAN 200 的配置信息

H3C网管交换机端口隔离典型配置举例

一、组网需求
如下图所示,小区用户 Host A、Host B、Host C 分别与 Device 的端口GigabitEthernet1/0/1、GigabitEthernet1/0/2、GigabitEthernet1/0/3 相连,Device 设备通过 GigabitEthernet1/0/4 端口与外部网络相连。现需要实现小区用户 Host A、Host B 和 Host C 彼此之间二层报文不能互通,但可以和外部网络通信。

二、 组网图
端口隔离组网图

三、配置步骤
# 创建隔离组 2。
<Device> system-view
[Device] port-isolate group 2
[Device-port-isolate-group2] quit

# 将端口 GigabitEthernet1/0/1、GigabitEthernet1/0/2、GigabitEthernet1/0/3 加入隔离组 2。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] port-isolate enable group 2
[Device-GigabitEthernet1/0/1] quit
[Device] interface gigabitethernet 1/0/2
[Device-GigabitEthernet1/0/2] port-isolate enable group 2
[Device-GigabitEthernet1/0/2] quit
[Device] interface gigabitethernet 1/0/3
[Device-GigabitEthernet1/0/3] port-isolate enable group 2
[Device-GigabitEthernet1/0/3] quit

四、验证配置
# 显示隔离组 2 中的信息。
[DeviceA] display port-isolate group 2
显示隔离组 2 中的信息
以上信息显示 Device 上的端口 GigabitEthernet1/0/1、GigabitEthernet1/0/2、GigabitEthernet1/0/3已经加入隔离组 2,从而实现二层隔离,Host A、Host B 和 Host C 彼此之间不能 ping 通。

H3C网管交换机S-MLAG跨设备链路聚合配置举例

一、组网需求
•Device A 通过二层以太网接口 GigabitEthernet1/0/1~GigabitEthernet1/0/3 分别与 Device B、Device C、Device D 的二层以太网接口 GigabitEthernet1/0/1 相互连接。
• Device B、Device C、Device D 为独立运行的设备,由于用户对于业务的可靠性要求很高,要求 Device A 和 Device B、Device C、Device D 之间配置链路聚合。为了实现 Device B、Device C、Device D 之间跨设备聚合,这时用户可以配置 S-MLAG 功能,保证正常工作时链路进行负载分担且任何一台设备故障对业务均没有影响,提高可靠性。

二、 组网图
S-MLAG 配置组网图

三、配置步骤
(1) 配置 Device A
# 创建二层聚合接口 10,并配置该接口为动态聚合模式。
<DeviceA> system-view
[DeviceA] interface bridge-aggregation 10
[DeviceA-Bridge-Aggregation10] link-aggregation mode dynamic
[DeviceA-Bridge-Aggregation10] quit

# 分别将端口 GigabitEthernet1/0/1 至 GigabitEthernet1/0/3 加入到聚合组 10 中。
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] port link-aggregation group 10
[DeviceA-GigabitEthernet1/0/1] quit
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] port link-aggregation group 10
[DeviceA-GigabitEthernet1/0/2] quit
[DeviceA] interface gigabitethernet 1/0/3
[DeviceA-GigabitEthernet1/0/3] port link-aggregation group 10
[DeviceA-GigabitEthernet1/0/3] quit

(2) 配置 Device B
# 配置 LACP 的系统地址为 0001-0001-0001。
<DeviceB> system-view
[DeviceB] lacp system-mac 1-1-1

# 配置 LACP 的系统优先级为 123。
[DeviceB] lacp system-priority 123

# 配置 LACP 的系统编号为 1。
[DeviceB] lacp system-number 1

# 创建二层聚合接口 2,并配置该接口为动态聚合模式。
[DeviceB] interface bridge-aggregation 2
[DeviceB-Bridge-Aggregation2] link-aggregation mode dynamic

# 将二层聚合接口 2 加入 S-MLAG 组 100。
[DeviceB-Bridge-Aggregation2] port s-mlag group 100

# 将端口 GigabitEthernet1/0/1 加入到聚合组 2 中。
[DeviceB] interface gigabitethernet 1/0/1
[DeviceB-GigabitEthernet1/0/1] port link-aggregation group 2
[DeviceB-GigabitEthernet1/0/1] quit

(3) 配置 Device C
# 配置 LACP 的系统地址为 0001-0001-0001。
<DeviceC> system-view
[DeviceC] lacp system-mac 1-1-1

# 配置 LACP 的系统优先级为 123。
[DeviceC] lacp system-priority 123

# 配置 LACP 的系统编号为 2。
[DeviceC] lacp system-number 2

# 创建二层聚合接口 3,并配置该接口为动态聚合模式。
[DeviceC] interface bridge-aggregation 3
[DeviceC-Bridge-Aggregation3] link-aggregation mode dynamic

# 将二层聚合接口 3 加入 S-MLAG 组 100。
[DeviceC-Bridge-Aggregation3] port s-mlag group 100

# 将端口 GigabitEthernet1/0/1 加入到聚合组 3 中。
[DeviceC] interface gigabitethernet 1/0/1
[DeviceC-GigabitEthernet1/0/1] port link-aggregation group 3
[DeviceC-GigabitEthernet1/0/1] quit

(4) 配置 Device D
# 配置 LACP 的系统地址为 0001-0001-0001。
<DeviceD> system-view
[DeviceD] lacp system-mac 1-1-1

# 配置 LACP 的系统优先级为 123。
[DeviceD] lacp system-priority 123

# 配置 LACP 的系统编号为 3。
[DeviceD] lacp system-number 3

# 创建二层聚合接口 4,并配置该接口为动态聚合模式。
[DeviceD] interface bridge-aggregation 4
[DeviceD-Bridge-Aggregation4] link-aggregation mode dynamic

# 将二层聚合接口 4 加入 S-MLAG 组 100。
[DeviceD-Bridge-Aggregation4] port s-mlag group 100

# 将端口 GigabitEthernet1/0/1 加入到聚合组 4 中。
[DeviceD] interface gigabitethernet 1/0/1
[DeviceD-GigabitEthernet1/0/1] port link-aggregation group 4
[DeviceD-GigabitEthernet1/0/1] quit

四、验证配置
# 查看 Device A 上所有聚合组的详细信息。
[DeviceA] display link-aggregation verbose
验证配置
以上信息表明,Device A 的端口 GigabitEthernet1/0/1~GigabitEthernet1/0/3 均处于选中状态,此时 Device A 将 Device B、Device C、Device D 认为是一台设备,从而实现了跨设备的聚合。

H3C网管交换机二层链路聚合边缘接口配置举例

一、组网需求
•Device 与服务器 Server 通过端口 GigabitEthernet1/0/1、GigabitEthernet1/0/2 相互连接。
• 在 Device 上配置一个二层动态链路聚合组。
• 在 Device 上配置二层聚合接口为聚合边缘接口,以便当服务器上未配置动态聚合组时,Device上聚合组成员端口都能作为普通端口正常转发报文。

二、 组网图
二层聚合边缘接口配置组网图

三、配置步骤
配置 Device
# 创建二层聚合接口 1,配置该接口为动态聚合模式。
<Device> system-view
[Device] interface bridge-aggregation 1
[Device-Bridge-Aggregation1] link-aggregation mode dynamic

# 配置二层聚合接口 1 为聚合边缘接口。
[Device-Bridge-Aggregation1] lacp edge-port
[Device-Bridge-Aggregation1] quit

# 分别将端口 GigabitEthernet1/0/1、GigabitEthernet1/0/2 加入到聚合组 1 中。
[Device] interface gigabitethernet 1/0/1
[Device-GigabitEthernet1/0/1] port link-aggregation group 1
[Device-GigabitEthernet1/0/1] quit
[Device] interface gigabitethernet 1/0/2
[Device-GigabitEthernet1/0/2] port link-aggregation group 1
[Device-GigabitEthernet1/0/2] quit

四、验证配置
# 当 Server 未完成动态聚合模式配置时,查看 Device 上所有聚合组的详细信
[DeviceA] display link-aggregation verbose
验证配置
以上信息表明,当Device未收到Server的LACP报文时,Device的聚合成员端口都工作在Individual状态,该状态下所有聚合成员端口可以作为普通物理口转发报文,以保证此时 Server 与 Device 间的链路都可以正常转发报文,且相互形成备份。

H3C网管交换机三层静态链路聚合配置举例

一、组网需求
• Device A 与 Device B 通过各自的三层以太网接口 GigabitEthernet1/0/1~
GigabitEthernet1/0/3 相互连接。
• 在 Device A 和 Device B 上分别配置三层静态链路聚合组,并为对应的三层聚合接口配置 IP地址和子网掩码。

二、 组网图
三层静态聚合配置组网图

三、配置步骤
(1) 配置 Device A
# 创建三层聚合接口 1,并为该接口配置 IP 地址和子网掩码。
<DeviceA> system-view
[DeviceA] interface route-aggregation 1
[DeviceA-Route-Aggregation1] ip address 192.168.1.1 24
[DeviceA-Route-Aggregation1] quit

# 分别将接口 GigabitEthernet1/0/1 至 GigabitEthernet1/0/3 加入到聚合组 1 中。
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] port link-aggregation group 1
[DeviceA-GigabitEthernet1/0/1] quit
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] port link-aggregation group 1
[DeviceA-GigabitEthernet1/0/2] quit
[DeviceA] interface gigabitethernet 1/0/3
[DeviceA-GigabitEthernet1/0/3] port link-aggregation group 1
[DeviceA-GigabitEthernet1/0/3] quit

(2) 配置 Device B
Device B 的配置与 Device A 相似,配置过程略。

四、验证配置
# 查看 Device A 上所有聚合组的详细信息。
[DeviceA] display link-aggregation verbose
查看 Device A 上所有聚合组的详细信息
以上信息表明,聚合组 1 为负载分担类型的三层静态聚合组,包含有三个选中端口。

ICP备案号:晋ICP备18007549号-1
站长微信:15534641008