switch上的etherchannel特性介绍


etherchannel特性在switch到switch、switch到router之间提供冗余的、高速的连接方式 , 简单说就是将两个设备间多条FE或GE物理链路捆在一起组成一条设备间逻辑链路 , 从而达到增加带宽 , 提供冗余的目的 。下面具体结合配置了解它的特点:
构成etherchannel的端口必须配置成相同的特性 , 如双工模式、速度、同为FE或GE端口、native VLAN,、VLAN range,、and trunking status and type.等
当etherchannel中某一条link failed时 , etherchannel中其它link照常工作 。
当配置layer 2端口作etherchannel时只要在成员端口配置模式下用channel-group n命令指定该端口要加入的channel-group组 , 这时switch会自动创建port-channel接口 , 而当配置layer 3端口作etherchannel时 , 还需现在全局配置模式下用 interface port-channel n 命令手工创建port-channel接口 。
具体配置:
Switch# configure terminal
Switch(config)# interface range fastethernet0/4 -5
Switch(config-if-range)# switchport mode Access
Switch(config-if-range)# switchport access vlan 10
Switch(config-if-range)# channel-group 5 mode desirableautoon
Switch(config-if-range)# end
以上配置将F0/4、F0/5端口加入channel-group 5 , 作etherchannel的端口可为access端口也可为trunk端口 。在将两个swith间的link作etherchannel与两个swith间的link作trunk有一点相似的地方就是:配置trunk时两端的端口有几种模式:trunk、auto、desirable等 , 配置etherchannel时两端的端口有desirableautoon(使用PAGP)或activepassive(使用LACP)几种模式 , 所不同的是trunk端口间协商是使用DTP(dynamic trunking protocol);而etherchannel端口间协商是使用PAGP(Port Aggregation Protocol , cisco专有)或LACP (Link Aggregation Control Protocol , 802.3AD )
对于使用PAGP的三种模式 ,
desirable 表示该端口会主动发PAGP数据包与对端进行协商
auto 表示该端口不会主动发PAGP数据包与对端进行协商
on 表示强制将该端口加入etherchannel , 不需用PAGP协议与对端进行协商
对于使用LACP的两种模式 ,
active 表示该端口会主动发LACP数据包与对端进行协商
passive 表示该端口不会主动发LACP数据包与对端进行协商
了解了这几种模式的意义后 , 只要两端port的配置匹配即可 。
除了以上作etherchannel的基本配置外 , 还有一些扩展特性 。
etherchannel在作数据转发时 , 我们可以通过接口配置命令 pagp port-priority 改变优先级设定哪条物理link主用 , 哪条备用 , 一旦主用物理link上产生阻塞 , 备用link立即启用 。
etherchannel在作数据转发时 , 是基于数据包的源或目的MAC地址随机选择etherchannel中的一条物理link进行数据转发的 。我们可以通过全局配置命令port-channel load-balance选择是根据源MAC地址还是根据目的MAC地址进行数据转发来实现负载平衡 。
例如:当有两台switch , 它们之间有几条link 互联作etherchannel , switchA一端连接一台server , switchB一端连接多台clientPC , 这时swithA一端的数据流是同一源MAC地址的数据包通过etherchannel转发向不同目的MAC地址 。这时 , 为了充分利用etherchannel中的所有的物理link , 在swithA一端就应该配置为基于数据包的目的MAC地址方式 , 而switchB一端的数据流是不同源MAC地址的数据包通过etherchannel转发向同目的MAC地址 。在swithB一端就应该配置为基于数据包的源MAC地址方式 。

    推荐阅读