15 三层动态链路聚合 基本配置 <H3C>system-view [H3C]sysname sw1 [sw1]vlan 10 [sw1-vlan10]name pc [sw1-vlan10]description pcvlan [sw1-vlan10]quit [sw1]interface vlan-interface 10 [sw1-Vlan-interface10]ip address 192.168.10.1 24 [sw1-Vlan-interface10]quit [sw1]interface gigabitethernet 1/0/48 [sw1-GigabitEthernet1/0/48]port link-type access [sw1-GigabitEthernet1/0/48]port access vlan 10 [sw1-GigabitEthernet1/0/48]quit 配置交换机链路聚合控制协议的优先级 (值越小优先级越高使SW1成为主动端) [sw1]lacp system-priority 100 //配置LACP系统优先级100 [sw1]link-aggregation global load-sharing mode source-ipdestination-ip source-mac destination-mac //配置链路聚合全局负载分担模式 创建三层路由链路聚合组 [sw1]interface route-aggregation 1 //创建三层链路聚合组 [sw1-Route-Aggregation1]link-aggregation mode dynamic //配置链路聚合模式为动态 [sw1-Route-Aggregation1]ip address 172.16.100.1 24 //为聚合接口配置IP地址 [sw1-Route-Aggregation1]link-aggregation selected-portmaximum 2 //配置链路聚合最大选择两个端口(未选中的会成为备份链路) [sw1-Route-Aggregation1]quit 将二层端口转换成三层接口并划入链路聚合组 [sw1]interface range gigabitethernet 1/0/1 togigabitethernet 1/0/3 //进入端口范围 [sw1-if-range]port link-mode route //端口类型改为路由接口 [sw1-if-range]port link-aggregation group 1 //将端口划入链路聚合组 [sw1-if-range]quit [sw1]interface range GigabitEthernet 1/0/1 toGigabitEthernet 1/0/2 [sw1-if-range]link-aggregation port-priority 100 //配置链路聚合接口的优先级(高优先级会被选中为主动接口) [sw1-if-range]quit 配置静态路由 [sw1]ip route-static 192.168.20.0 255.255.255.0172.16.100.2 <H3C>system-view [H3C]sysname sw2 [sw2]interface gigabitethernet 1/0/48 [sw2-GigabitEthernet1/0/48]port link-mode route [sw2-GigabitEthernet1/0/48]ip address 192.168.20.1 24 [sw2-GigabitEthernet1/0/48]quit [sw2]link-aggregation global load-sharing modedestination-mac source-mac destination-ip source-ip [sw2-Route-Aggregation1]link-aggregation mode dynamic [sw2]interface route-aggregation 1 [sw2-Route-Aggregation1]ip address 172.16.100.2 24 [sw2-Route-Aggregation1]link-aggregation selected-portmaximum 2 [sw2-Route-Aggregation1]quit [sw2]interface range GigabitEthernet 1/0/1 toGigabitEthernet 1/0/3 [sw2-if-range]port link-mode route [sw2-if-range]port link-aggregation group 1 [sw2-if-range]quit [sw2]display link-aggregation summary [sw2]display link-aggregation verbose [sw2]ip route-static 192.168.10.0 255.255.255.0172.16.100.1 将SW1的G 1/0/2接口掉电 [sw1-GigabitEthernet1/0/2]shutdown [sw1]display link-aggregation verbose 此时G 1/0/3备份链路成为选中链路继续代替G 1/0/2接口工作。
|