您的位置:首页 > 其它

EtherChannel(PAgP、LACP)基本配置

2016-04-20 17:23 459 查看
EtherChannel
EtherChannel(以太通道)是由Cisco研发的,应用于交换机之间的多链路捆绑技术。它的基本原理是:将两个设备间多条相同特性的快速以太或千兆位以太物理链路捆绑在一起组成一条逻辑链路,从而达到带宽倍增的目的。除了增加带宽外,EtherChannel还可以在多条链路上均衡分配流量,起到负载分担的作用;当一条或多条链路故障时,只要还有链路正常,流量将转移到其它的链路上,整个过程在几毫秒内完成,从而起到冗余的作用,增强了网络的稳定性和安全性。在EtherChannel中,负载在各个链路上的分布可以根据源IP地址、目的IP地址、源MAC地址、目的MAC地址、源IP地址和目的IP地址组合,以及源MAC地址和目的MAC地址组合等来进行分布。两台交换机之间是否形成EtherChannel也可以用协议自动协商。目前有两个协商协议:PAgP和LACP,PAgP(端口汇聚协议 Port Aggregation Protocol)是Cisco私有的协议,而LACP(链路汇聚控制协议 Link Aggregation Control Protocol)是基于IEEE 802.3ad的国际标准。
能形成EtherChannel的模式总结:



EtherChannel命令组合:
如果想把端口配置为on:
sw1(config-if-range)#channel-group 1 mode on
如果想把端口配置为PAgP的desirable:
sw1(config-if-range)#channel-protocol pagp
sw1(config-if-range)#channel-group 1 mode desirable
如果想把端口配置为PAgP的auto:
sw1(config-if-range)#channel-protocol pagp
sw1(config-if-range)#channel-group 1 mode auto
如果想把端口配置为LACP的active:
sw1(config-if-range)#channel-protocol lacp
sw1(config-if-range)#channel-group 1 mode active
如果想把端口配置为LACP的passive:
sw1(config-if-range)#channel-protocol lacp
sw1(config-if-range)#channel-group 1 mode passive
EtherChannel说明:
①Cisco最多允许EtherChannel绑定8个端口;
1>如果是快速以太网,总带宽可达1600Mbit/s;
2>如果是Gbit以太网,总带宽可达16Gbit/s。
②EtherChannel不支持10M端口;
③EtherChannel编号只在本地有效,链路两端的编号可以不一样;
④EtherChannel默认使用PAgP协议;
⑤EtherChannel默认情况下是基于源MAC地址的负载平衡;
⑥一个EtherChannel内所有的端口都必须具有相同的端口速率和双工模式,LACP只能是全双工模式;
⑦channel-group接口会自动继承最小物理接口,或最先配置的接口模式;
⑧cisco的交换机不仅可以支持第二层EtherChannel,还可以支持第三层EtherChannel。

实验
命令:
sw1(config)#int port-channel 1 //创建以太通道,编号为1
sw1(config-if-range)#channel-group 1 mode on //将物理接口指定到已创建的通道中,模式为on
sw1(config)#port-channel load-balance dst-ip //配置以太通道的负载平衡方式,基于目的IP
说明:
①创建以太通道时要指定一个唯一的通道编号,编号范围是1-6的整数,这个编号只有本地有效,因此链路两端
的编号可以不一样;
②以太通道的负载平衡方式有:dst-ip、dst-mac、src-dst-ip、src-dst-mac、src-ip、src-mac,默认情况下
是基于源MAC地址的负载平衡。



sw1(config)#int port-channel 1
sw1(config)#int range f0/13 - 14
sw1(config-if-range)#switchport trunk encapsulation dot1q
sw1(config-if-range)#switchport mode trunk
sw1(config-if-range)#speed 100
sw1(config-if-range)#duplex full
sw1(config-if-range)#channel-group 1 mode on
sw1(config)#port-channel load-balance dst-ip
sw2(config)#int port-channel 1
sw2(config)#int range f0/13 - 14
sw2(config-if-range)#switchport trunk encapsulation dot1q
sw2(config-if-range)#switchport mode trunk
sw2(config-if-range)#speed 100
sw2(config-if-range)#duplex full
sw2(config-if-range)#channel-group 1 mode on
sw2(config)#port-channel load-balance dst-ip
特别说明:如果本试验中交换机sw2上接的是服务器,客户计算机接在sw1上,这时在交换机sw1上应该配置为基于src-ip的负载平衡方式,而在sw2上应该配置为基于dst-ip的负载平衡方式。
实验调试
sw1#show etherchannel summary //查看EtherChannel信息



sw1#show etherchannel load-balance //查看EtherChannel负载平衡方式



sw1#show etherchannel port-channel //查看指定的EtherChannel包含的接口



sw1#show etherchannel protocol //显示各个Channel-group使用的协商协议
接口如果进入err-disable状态有两种方法恢复:
①手动恢复:先shutdown,再no shutdown;
②自动恢复:errdisable recovery cause {all|arp-inspection|bpduguard|link-flap} 指定原因
errdisable recovery interval 30 指定自动恢复时间间隔
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  EtherChannel(PAgP LA