14 动态二层链路聚合 <H3C>system-view [H3C]sysname sw1 [sw1]vlan 10 //创建vlan [sw1-vlan10]port gigabitethernet 1/0/48 //vlan内加入端口 [sw1-vlan10]quit 配置交换机链路聚合控制协议的优先级 [sw1]lacp system-priority 100 //配置lacp优先级(值越小优先级越高) 创建链路聚合组 [sw1]interface bridge-aggregation 1 //创建链路聚合组1 [sw1-Bridge-Aggregation1]link-aggregation mode dynamic //配置链路聚合的模式为动态 [sw1-Bridge-Aggregation1]quit 把端口加入链路聚合组 [sw1]interface range gigabitethernet 1/0/1 togigabitethernet 1/0/2 //进入端口范围1-2 [sw1-if-range]port link-aggregation group 1 //将端口加入链路聚合组 [sw1-if-range]lacp period short //配置链路聚合控制协议为短周期 [sw1-if-range]quit 配置交换机端口的链路聚合控制协议的优先级 [sw1]interface gigabitethernet 1/0/2 [sw1-GigabitEthernet1/0/2]link-aggregation port-priority100 [sw1-GigabitEthernet1/0/2]quit 把链路聚合组当成“端口”配置放行vlan [sw1]interface Bridge-Aggregation 1 //进入链路聚合组 [sw1-Bridge-Aggregation1]port link-type trunk //配置链路类型为trunk [sw1-Bridge-Aggregation1]port trunk permit vlan 10 //放行vlan [sw1-Bridge-Aggregation1]undo port trunk permit vlan 1 //拒绝通行vlan [sw1-Bridge-Aggregation1]quit 配置链路聚合负载分担 [sw1]link-aggregation global load-sharing mode source-macdestination-mac //配置链路聚合负载分担模式(针对不同报文采用不同的负载分担方式) 一般来说,二层用:source-mac、destination-mac;三层报文用:source-mac、destination-mac、source-ip、destination-ip;四层报文用:基于二三层增加source-port、destination-port。
<H3C>system-view [H3C]sysname sw2 [sw2]vlan 10 [sw2-vlan10]port gigabitethernet 1/0/48 [sw2-vlan10]quit [sw2]interface Bridge-Aggregation 1 (华为interface eth-trunk 1) [sw2-Bridge-Aggregation1]quit [sw2]interface range gigabitethernet 1/0/1 togigabitethernet 1/0/2 [sw2-if-range]port link-aggregation group 1 (华为eth-trunk 1) [sw2-if-range]quit [sw2]interface Bridge-Aggregation 1 [sw2-Bridge-Aggregation1]port link-type trunk [sw2-Bridge-Aggregation1]port trunk permit vlan 10 [sw2-Bridge-Aggregation1]undo port trunk permit vlan 1 [sw2-Bridge-Aggregation1]quit [sw2]link-aggregation global load-sharing mode source-macdestination-mac [sw1]display link-aggregation summary //显示当前所有聚合组的摘要信息
术语解释: AGG Interface 对应BAGG1 表示二层的聚合接口1; AGG Mode 对应 S 表示聚合组的类型是静态; Partner ID 对应 None 表示此为静态聚合,获取不到对端的设备ID信息; Selected Ports 对应2 表示聚合中包含了两个处于激活状态的端口; Share Type 对应Shar 表示采用了负载分担的类型; [sw1]display link-aggregation verbose //显示当前所有聚合组的详细信息 术语解释: Oper-key 表示操作key。在同一聚合组中,所有选中端口都必须具有相同的操作key。这说明同一组聚合组中端口属性和配置一到才能被选中。 |