链路聚合是将多条物理链路汇聚成一条逻辑链路,在实际生产环境下这种技术很常见
链路聚合主要功能:
1.增加带宽 2.均衡负载 3.提高可靠性
链路聚合模式:
on强制模式:无需协议,手动配置,所有成员链路均活动。
LACP动态模式(active/passive):使用LACP协议,其中active是主动协商,passive是被动响应。
PAgP协议模式(auto/desirable):思科私有协议,功能与LACP一样。
在思科Cisco中配置步骤分为:
1.创建聚合组 2.将端口加入到聚合组 3.设置聚合组模式
创建聚合组命令:interface port-channel <number> 组号范围1-6
示例1 创建一个聚合组1,并且将Fa0/1 Fa0/2 Fa0/3加入,模式设置为on
SW1(config)#interface port-channel 1 //创建聚合组 组号为1
SW1(config-if)#exit
SW1(config)#interface range fastEthernet 0/1-3 // 选择要加入的端口号
SW1(config-if-range)#channel-group 1 mode on // 将fa0/1-3号端口加入到链路组中 模式为on
%LINK-5-CHANGED: Interface Port-channel1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel1, changed state to up
// 这里显示加入成功 并且处于开启状态
SW1(config-if-range)#exit
SW1(config)#interface port-channel 1 //进入汇聚组设置模式
SW1(config-if)#switchport mode trunk
// 完成基本配置我们看查看聚合组状态
SW1#show etherchannel summary //查看状态命令
Group Port-channel Protocol Ports
------+-------------+-----------+----------------------------------------------
1 Po1(SU) - Fa0/1(P) Fa0/2(P) Fa0/3(P)
// Po1 表示聚合组1号 并且加入的Fa0/1到Fa0/3处于开启状态
示例2 SW1与SW2创建链路聚合

根据图片搭建拓扑图
SW1配置:
SW1(config)#interface port-channel 1
SW1(config-if)#exit
SW1(config)#interface range fastEthernet 0/1-3
SW1(config-if-range)#channel-group 1 mode on
SW1(config-if-range)#exit
SW1(config)#interface port-channel 1
SW1(config-if)#switchport mode trunk
SW2配置:
SW2(config)#interface port-channel 1
SW2(config-if)#exit
SW2(config)#interface range fastEthernet 0/1-3
SW2(config-if-range)#channel-group 1 mode on
SW2(config-if-range)#exit
SW2(config)#interface port-channel 1
SW2(config-if)#switchport mode trunk
连通性测试:
