配置Eth-Trunk接口流量本地优先转发示例
组网需求
如图3-24所示,为了增加设备的容量采用设备堆叠技术,将SwitchB和SwitchC通过专用的堆叠电缆链接起来,对外呈现为一台逻辑交换机,本例中以SwitchB作为堆叠主交换机,SwitchC作为堆叠备份交换机。
为了实现设备间的备份、提高可靠性,采用跨设备Eth-Trunk技术,将不同设备上的物理接口加入同一个Eth-Trunk接口。在网络无任何故障情况下,在SwitchA查看成员口信息时,发现VLAN2的数据流量会通过成员口10GE1/0/1和10GE1/0/2转发,VLAN3的数据流量通过成员口10GE1/0/1和10GE1/0/2转发。增加了堆叠设备之间的带宽承载能力,也降低了流量转发效率。
为了保证无故障情况下VLAN2的数据流量通过成员口10GE1/0/1转发,VLAN3的数据流量通过成员口10GE1/0/2转发,可在堆叠设备上使能Eth-Trunk接口流量本地优先转发功能。
配置思路
采用如下的思路配置Eth-Trunk接口流量本地优先转发功能:
创建Eth-Trunk接口,实现链路聚合功能。
加入Eth-Trunk的成员接口。
使能Eth-Trunk接口流量本地优先转发功能,实现本设备流量优先从本设备的出接口转发。
配置二层转发功能,实现二层互通。
操作步骤
- 创建Eth-Trunk接口,并配置允许通过的VLAN
# 配置堆叠设备。本例中SwitchB是堆叠主交换机。
<HUAWEI> system-view [~HUAWEI] sysname SwitchB [*HUAWEI] commit [~SwitchB] vlan batch 2 3 [*SwitchB] interface eth-trunk 1 [*SwitchB-Eth-Trunk1] port link-type trunk [*SwitchB-Eth-Trunk1] port trunk allow-pass vlan 2 3 [*SwitchB-Eth-Trunk1] commit [~SwitchB-Eth-Trunk1] quit
# 配置SwitchA。
<HUAWEI> system-view [~HUAWEI] sysname SwitchA [*HUAWEI] commit [~SwitchA] vlan batch 2 3 [*SwitchA] interface eth-trunk 1 [*SwitchA-Eth-Trunk1] port link-type trunk [*SwitchA-Eth-Trunk1] port trunk allow-pass vlan 2 3 [*SwitchA-Eth-Trunk1] commit [~SwitchA-Eth-Trunk1] quit
- 加入Eth-Trunk的成员接口
# 配置堆叠设备。
[~SwitchB] interface 10GE 1/1/0/1 [~SwitchB-10GE1/1/0/1] eth-trunk 1 [*SwitchB-10GE1/1/0/1] quit [*SwitchB] interface 10GE 2/1/0/1 [*SwitchB-10GE2/1/0/1] eth-trunk 1 [*SwitchB-10GE2/1/0/1] quit [*SwitchB] commit
# 配置SwitchA。
[~SwitchA] interface 10GE 1/0/1 [~SwitchA-10GE1/0/1] eth-trunk 1 [*SwitchA-10GE1/0/1] quit [*SwitchA] interface 10GE 1/0/2 [*SwitchA-10GE1/0/2] eth-trunk 1 [*SwitchA-10GE1/0/2] quit [*SwitchA] commit
- 在堆叠设备上使能Eth-Trunk接口流量本地优先转发功能
[~SwitchB] interface eth-trunk 1 [~SwitchB-Eth-Trunk1] undo local-preference disable [*SwitchB-Eth-Trunk1] commit [~SwitchB-Eth-Trunk1] quit
- 配置二层转发功能
# 配置堆叠设备。
[~SwitchB] interface 10GE 1/1/0/2 [~SwitchB-10GE1/1/0/2] port link-type trunk [*SwitchB-10GE1/1/0/2] port trunk allow-pass vlan 2 [*SwitchB-10GE1/1/0/2] quit [*SwitchB] interface 10GE 2/1/0/2 [*SwitchB-10GE2/1/0/2] port link-type trunk [*SwitchB-10GE2/1/0/2] port trunk allow-pass vlan 3 [*SwitchB-10GE2/1/0/2] quit [*SwitchB] commit
# 配置SwitchD。
<HUAWEI> system-view [~HUAWEI] sysname SwitchD [*HUAWEI] commit [~SwitchD] vlan 2 [*SwitchD-vlan2] quit [*SwitchD] interface 10GE 1/0/1 [*SwitchD-10GE1/0/1] port link-type trunk [*SwitchD-10GE1/0/1] port trunk allow-pass vlan 2 [*SwitchD-10GE1/0/1] quit [*SwitchD] interface 10GE 1/0/2 [*SwitchD-10GE1/0/2] port link-type trunk [*SwitchD-10GE1/0/2] port trunk allow-pass vlan 2 [*SwitchD-10GE1/0/2] quit [*SwitchD] commit
# 配置SwitchE。
<HUAWEI> system-view [~HUAWEI] sysname SwitchE [*HUAWEI] commit [~SwitchE] vlan 3 [*SwitchE-vlan3] quit [*SwitchE] interface 10GE 1/0/1 [*SwitchE-10GE1/0/1] port link-type trunk [*SwitchE-10GE1/0/1] port trunk allow-pass vlan 3 [*SwitchE-10GE1/0/1] quit [*SwitchE] interface 10GE 1/0/2 [*SwitchE-10GE1/0/2] port link-type trunk [*SwitchE-10GE1/0/2] port trunk allow-pass vlan 3 [*SwitchE-10GE1/0/2] quit [*SwitchE] commit
- 检查配置结果
上述配置成功后,在任意视图下执行命令display eth-trunk membership,可以看到Eth-Trunk接口的成员口信息。例如:
以堆叠设备的显示为例。
[~SwitchB] display eth-trunk membership 1 Trunk ID: 1 Used Status: Valid Type: Ethernet Working Mode: Normal Number Of Ports in Trunk: 2 Number Of Up Ports in Trunk: 2 Operating Status: up Interface 10GE1/1/0/1, valid, operate up, weight=1, Interface 10GE2/1/0/1, valid, operate up, weight=1,
配置文件
堆叠设备的配置文件
# sysname SwitchB # vlan batch 2 to 3 # interface Eth-Trunk1 port link-type trunk port trunk allow-pass vlan 2 to 3 # interface 10GE1/1/0/1 eth-trunk 1 # interface 10GE1/1/0/2 port link-type trunk port trunk allow-pass vlan 2 # interface 10GE2/1/0/1 eth-trunk 1 # interface 10GE2/1/0/2 port link-type trunk port trunk allow-pass vlan 3 # return
SwitchA的配置文件
# sysname SwitchA # vlan batch 2 to 3 # interface Eth-Trunk1 port link-type trunk port trunk allow-pass vlan 2 to 3 # interface 10GE1/0/1 eth-trunk 1 # interface 10GE1/0/2 eth-trunk 1 # return
SwitchD的配置文件
# sysname SwitchD # vlan batch 2 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 2 # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 2 # return
SwitchE的配置文件
# sysname SwitchE # vlan batch 3 # interface 10GE1/0/1 port link-type trunk port trunk allow-pass vlan 3 # interface 10GE1/0/2 port link-type trunk port trunk allow-pass vlan 3 # return