HUAWEI 华为交换机 配置 Eth-Trunk 接口流量本地优先转发示例(堆叠)

组网需求
说明
S5720I-10X-PWH-SI-AC 和 S5720I-6X-PWH-SI-AC 不支持此配置。
3-23 所示,为了增加设备的容量采用设备堆叠技术,将 Switch3 和 Switch4通过专用的堆叠电缆链接起来,对外呈现为一台逻辑交换机。为了实现设备间的备份、提高可靠性,采用跨堆叠设备Eth-Trunk接口技术,将不同设备上的物理接口加入同一个Eth-Trunk接口。在网络无任何故障情况下,在PE设备上查看成员口信息时,发现VLAN2的数据流量会通过成员口GE1/0/1和GE1/0/2转发,VLAN3的数据流量通过成员口GE1/0/1和GE1/0/2转发。增加了堆叠设备之间的带宽承载能力,也降低了流量转发效率。为了有效保证VLAN2的数据流量通过成员口GE1/0/1转发,VLAN3的数据流量通过成员口GE1/0/2转发,可在堆叠设备上使能Eth-Trunk接口流量本地优先转发功能。

配置思路
采用如下的思路配置 Eth-Trunk 接口流量本地优先转发功能:

  1. 创建 Eth-Trunk 接口。
  2. 加入 Eth-Trunk 的成员接口。
  3. 使能 Eth-Trunk 接口流量本地优先转发功能。
  4. 配置各接口加入相应 VLAN ,实现二层互通。
    操作步骤
    步骤 1 创建 Eth-Trunk 接口,并配置允许通过的 VLAN

配置 Stack 。

<HUAWEI> system-view

HUAWEI\] **sysname Stack** \[Stack\] **interface eth-trunk 10** \[Stack-Eth-Trunk10\] **port link-type trunk** \[Stack-Eth-Trunk10\] **port trunk allow-pass vlan all** \[Stack-Eth-Trunk10\] **undo port trunk allow-pass vlan 1** \[Stack-Eth-Trunk10\] **quit** # 配置 PE 。 \ **system-view** \[HUAWEI\] **sysname PE** \[PE\] **interface eth-trunk 10** \[PE-Eth-Trunk10\] **port link-type trunk** \[PE-Eth-Trunk10\] **port trunk allow-pass vlan all** \[PE-Eth-Trunk10\] **undo port trunk allow-pass vlan 1** \[PE-Eth-Trunk10\] **quit** **步骤** **2** 加入 Eth-Trunk 的成员接口 # 配置 Stack 。 \[Stack\] **interface gigabitethernet 1/0/4** \[Stack-GigabitEthernet1/0/4\] **eth-trunk 10** \[Stack-GigabitEthernet1/0/4\] **quit** \[Stack\] **interface gigabitethernet 2/0/4** \[Stack-GigabitEthernet2/0/4\] **eth-trunk 10** \[Stack-GigabitEthernet2/0/4\] **quit** # 配置 PE 。 \[PE\] **interface gigabitethernet 1/0/1** \[PE-GigabitEthernet1/0/1\] **eth-trunk 10** \[PE-GigabitEthernet1/0/1\] **quit** \[PE\] **interface gigabitethernet 1/0/2** \[PE-GigabitEthernet1/0/2\] **eth-trunk 10** \[PE-GigabitEthernet1/0/2\] **quit** **步骤** **3** 在堆叠设备上使能 Eth-Trunk 接口流量本地优先转发功能 对于 S2730S-S 、 S5735-L-I 、 S5735-L1 、 S300 、 S5735-L 、 CloudEngine S5735S-L1 、 S5735S-L 、 S5735-S 、 S5735S-S 、 S5735S-L-M 、 S500 : \[Stack\] **local-preference enable** 对于除 S2730S-S 、 S5735-L-I 、 S5735-L1 、 S300 、 S5735-L 、 CloudEngine S5735S L1 、 S5735S-L 、 S5735-S 、 S5735S-S 、 S5735S-L-M 、 S500 之外的设备: \[Stack\] **interface eth-trunk 10** \[Stack-Eth-Trunk10\] **local-preference enable** \[Stack-Eth-Trunk10\] **quit** **步骤** **4** 配置二层转发功能 # 配置 Stack 。 \[Stack\] **vlan batch 2 3** \[Stack\] **interface gigabitethernet 1/0/3** \[Stack-GigabitEthernet1/0/3\] **port link-type trunk** \[Stack-GigabitEthernet1/0/3\] **port trunk allow-pass vlan 2** \[Stack-GigabitEthernet1/0/3\] **undo port trunk allow-pass vlan 1** \[Stack-GigabitEthernet1/0/3\] **quit** \[Stack\] **interface gigabitethernet 2/0/3** \[Stack-GigabitEthernet2/0/3\] **port link-type trunk** \[Stack-GigabitEthernet2/0/3\] **port trunk allow-pass vlan 3** \[Stack-GigabitEthernet2/0/3\] **undo port trunk allow-pass vlan 1** \[Stack-GigabitEthernet2/0/3\] **quit** # 配置 Switch1 。 \ **system-view** \[HUAWEI\] **sysname Switch1** \[Switch1\] **vlan 2** \[Switch1-vlan2\] **quit** \[Switch1\] **interface gigabitethernet 0/0/1** \[Switch1-GigabitEthernet0/0/1\] **port link-type trunk** \[Switch1-GigabitEthernet0/0/1\] **port trunk allow-pass vlan 2** \[Switch1-GigabitEthernet0/0/1\] **undo port trunk allow-pass vlan 1** \[Switch1-GigabitEthernet0/0/1\] **quit** \[Switch1\] **interface gigabitethernet 0/0/2** \[Switch1-GigabitEthernet0/0/2\] **port link-type trunk** \[Switch1-GigabitEthernet0/0/2\] **port trunk allow-pass vlan 2** \[Switch1-GigabitEthernet0/0/2\] **undo port trunk allow-pass vlan 1** \[Switch1-GigabitEthernet0/0/2\] **quit** # 配置 Switch2 。 \ **system-view** \[HUAWEI\] **sysname Switch2** \[Switch2\] **vlan 3** \[Switch2-vlan3\] **quit** \[Switch2\] **interface gigabitethernet 0/0/1** \[Switch2-GigabitEthernet0/0/1\] **port link-type trunk** \[Switch2-GigabitEthernet0/0/1\] **port trunk allow-pass vlan 3** \[Switch2-GigabitEthernet0/0/1\] **undo port trunk allow-pass vlan 1** \[Switch2-GigabitEthernet0/0/1\] **quit** \[Switch2\] **interface gigabitethernet 0/0/2** \[Switch2-GigabitEthernet0/0/2\] **port link-type trunk** \[Switch2-GigabitEthernet0/0/2\] **port trunk allow-pass vlan 3** \[Switch2-GigabitEthernet0/0/2\] **undo port trunk allow-pass vlan 1** \[Switch2-GigabitEthernet0/0/2\] **quit** **步骤** **5**检查配置结果 上述配置成功后,在任意视图下执行命令 **display trunkmembership eth-trunk** ,可 以看到 Eth-Trunk 接口的成员口信息。例如: 以 Stack 的显示为例。 \ **display trunkmembership eth-trunk 10** Trunk ID: 10 Used status: VALID TYPE: ethernet Working Mode : Normal Number Of Ports in Trunk = 2 Number Of Up Ports in Trunk = 2 Operate status: up Interface GigabitEthernet1/0/4, valid, operate up, weight=1 Interface GigabitEthernet2/0/4, valid, operate up, weight=1 **----** **结束** **配置文件** ● Stack 的配置文件 # sysname Stack # vlan batch 2 3 # interface Eth-Trunk10 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 2 to 4094 # interface GigabitEthernet1/0/3 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 2 # interface GigabitEthernet2/0/3 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 3 # interface GigabitEthernet1/0/4 eth-trunk 10 # interface GigabitEthernet2/0/4 eth-trunk 10 # return ● PE 的配置文件 # sysname PE # interface Eth-Trunk10 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 2 to 4094 # interface GigabitEthernet1/0/1 eth-trunk 10 # interface GigabitEthernet1/0/2 eth-trunk 10 # return ● Switch1 的配置文件 # sysname Switch1 # vlan batch 2 # interface GigabitEthernet0/0/1 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 2 # interface GigabitEthernet0/0/2 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 2 # return ● Switch2 的配置文件 # sysname Switch2 # vlan batch 3 # interface GigabitEthernet0/0/1 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 3 # interface GigabitEthernet0/0/2 port link-type trunk undo port trunk allow-pass vlan 1 port trunk allow-pass vlan 3 # return

相关推荐
Coding_Doggy13 分钟前
苍穹外卖Day10 | 订单状态定时处理、来单提醒、客户催单、SpringTask、WebSocket、cron表达式
网络·websocket·网络协议
tan180°14 分钟前
Linux系统编程守护进程(36)
linux·服务器·网络
小马哥编程25 分钟前
计算机网络:以太网中的数据传输
网络·网络协议·计算机网络
小马哥编程26 分钟前
计算机网络:无线局域网加密与认证方式
网络·计算机网络·安全
zzc92142 分钟前
Packet Radio Network,PRNET
网络·tcp/ip·互联网·arpanet·自组网·prnet
江拥羡橙2 小时前
【目录-多选】鸿蒙HarmonyOS开发者基础
前端·ui·华为·typescript·harmonyos
sdszoe49224 小时前
0904网络设备配置与管理第二次授课讲义
网络·华为交换机基础
努力的小帅4 小时前
CAN通信入门
网络·stm32·单片机·嵌入式硬件·stm32c8t6·can总线通信
久绊A5 小时前
指定端口-SSH连接的目标(告别 22 端口暴力破解)
linux·网络·ssh
爱笑的眼睛118 小时前
HarmonyOS Stage 模型深度解析:构建现代化、高性能应用
华为·harmonyos