设为首页 收藏本站
查看: 1783|回复: 0

[经验分享] cisco 以太通道(端口聚合)配置样例

[复制链接]

尚未签到

发表于 2018-7-21 06:40:40 | 显示全部楼层 |阅读模式
  3.4.1EtherChannel及其作用
  交换机允许将多个端口聚合成一个逻辑端口或者称为EtherChannel。
  通过端口聚合,可大大提高端口间链路的通信速度。比如,当用2个100Mbit/s的端口进行聚合时,所形成的逻辑端口的通信速度为200Mbit/s;若用4个,则为400Mbit/s。当EtherChannel内的某条链路出现故障时,该链路的流量将自动转移到其余链路上,自动提供冗余和负载均衡。
  PAgP是Cisco专有的端口聚合协议,LACP(Link Aggregation Control Protocol,链路聚合控制协议)则是一种标准的协议。
  3.4.2 EtherChannel配置
  参与聚合的端口必须具备相同的属性,如相同的速度、单双工模式、trunk模式、trunk封装方式和VLAN等。端口配置模式下使用命令:
  channel-group number mode [active|auto|desirable |on|passive]
  进行配置。
  参数说明:
  active     只使用LACP协议(Enable LACP unconditionally)
  auto      使用PAgP仅当对端设备使用PagP时( Enable PAgP only if a PAgP device is detected)
  desirable  只使用PAgP(Enable PAgP unconditionally)
  on       只进行端口聚合,默认使用PAgP(Enable Etherchannel only)
  passive   使用LACP仅当对端设备使用LACP 时(Enable LACP only if a LACP device is detected)
  两端设备对应端口聚合应该使用同样的协议,否则至少有一端的聚合不会成功。
  1.配置实例
  比如在如图所示的网络中,两核心交换机之间的链路采用两个端口的EtherChannel。
  配置步骤:
  Sw0(config)#interface range G0/1-2          //配置G0/1和G0/2口
  Sw0 (config-if)#channel-group 10 mode on   //可理解为把G0/1-2加入10号逻辑端口组(通道组)
  Sw0(config-if)#exit
  Sw1(config)#interface range G0/1-2
  Sw1(config-if)#channel-group 10 mode on
  Sw1(config-if)#exit
  2. 查看配置:
  SW1#show etherchannel summary
  Flags:  D - down        P - in port-channel
  I - stand-alone s - suspended
  H - Hot-standby (LACP only)
  R - Layer3      S - Layer2
  U - in use      f - failed to allocate aggregator
  u - unsuitable for bundling
  w - waiting to be aggregated
  d - default port
  Number of channel-groups in use: 1
  Number of aggregators:         1
  Group  Port-channel  Protocol    Ports
  ------+-------------+-----------+----------------------------------------------
  10     Po10(SU)      PAgP     Gig0/1(P)Gig0/2(P)
  显示这两个接口已经捆绑成为一个通道组接口Port-channel 10,Po10(SU)中的“S”说明这个通道组接口工作在第二层,U表示已在使用,使用的协议为PAgP,通道组聚合了两个接口Gig0/1和Gig0/2。
  Cisco 3560交换机支持48个EtherChannel 配置,每组最多支持8个端口聚合。
  3.负载均衡配置
  EtherChannel可以自动执行负载均衡,当EtherChannel执行负载均衡时,按照默认策略进行。
  可以根据不同条件来决定和配置负载均衡策略。如MAC地址、IP地址等都可以作为负载均衡策略的参数。但是不是每种交换机都能支持所有这些参数,越高端的交换机支持的参数就越多。
  例如,Cisco 3560的负载均衡配置
  Switch(config)#port-channel load-balance ?
  dst-ip       Dst IP Addr
  dst-mac      Dst Mac Addr
  src-dst-ip   Src XOR Dst IP Addr
  src-dst-mac  Src XOR Dst Mac Addr
  src-ip       Src IP Addr
  src-mac      Src Mac Addr
  支持多种策略
  ===============================
  **************** 链路聚合 ****************
  SW1:2960
  interface Port-channel 1
  description Channel group member f0/1-2
  switchport
  switchport trunk encapsulation dot1q
  switchport mode trunk
  int ran f0/1 - 2
  description Connect to SW5 on port f0/1-2
  switchport trunk encapsulation dot1q
  switchport mode trunk
  channel-group 1 mode desirable
  switchport trunk allowed vlan all
  SW2:2960
  interface Port-channel 2
  description Channel group member f0/1-2
  switchport
  switchport trunk encapsulation dot1q
  switchport mode trunk
  int ran f0/1 - 2
  description Connect to SW5 on port f0/3-4
  switchport trunk encapsulation dot1q
  switchport mode trunk
  channel-group 2 mode desirable
  switchport trunk allowed vlan all
  SW3:2960
  interface Port-channel 3
  description Channel group member f0/1-2
  switchport
  switchport trunk encapsulation dot1q
  switchport mode trunk
  int ran f0/1 - 2
  description Connect to SW5 on port f0/5-6
  switchport trunk encapsulation dot1q
  switchport mode trunk
  channel-group 3 mode desirable
  switchport trunk allowed vlan all
  SW4:2960
  interface Port-channel 4
  description Channel group member f0/1-2
  switchport
  switchport trunk encapsulation dot1q
  switchport mode trunk
  int ran f0/1 - 2
  description Connect to SW5 on port f0/7-8
  switchport trunk encapsulation dot1q
  switchport mode trunk
  channel-group 4 mode desirable
  switchport trunk allowed vlan all
  SW5: 3560
  interface Port-channel 1
  description Channel group member SW1 f0/1-2
  switchport
  switchport trunk encapsulation dot1q
  switchport mode trunk
  int ran f0/1 - 2
  description Connect to SW1 on port f0/1-2
  switchport trunk encapsulation dot1q
  switchport mode trunk
  channel-group 1 mode auto
  switchport trunk allowed vlan all
  interface Port-channel 2
  description Channel group member SW2 f0/1-2
  switchport
  switchport trunk encapsulation dot1q
  switchport mode trunk
  int ran f0/3 - 4
  description Connect to SW2 on port f0/1-2
  switchport trunk encapsulation dot1q
  switchport mode trunk
  channel-group 2 mode auto
  switchport trunk allowed vlan all
  interface Port-channel 3
  description Channel group member SW3 f0/1-2
  switchport
  switchport trunk encapsulation dot1q
  switchport mode trunk
  int ran f0/5 - 6
  description Connect to SW3 on port f0/1-2
  switchport trunk encapsulation dot1q
  switchport mode trunk
  channel-group 3 mode auto
  switchport trunk allowed vlan all
  interface Port-channel 4
  description Channel group member SW4 f0/1-2
  switchport
  switchport trunk encapsulation dot1q
  switchport mode trunk
  int ran f0/7 - 8
  description Connect to SW4 on port f0/1-2
  switchport trunk encapsulation dot1q
  switchport mode trunk
  channel-group 4 mode auto
  switchport trunk allowed vlan all
  sh ip int bri

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-539305-1-1.html 上篇帖子: 计算 Cisco 交换机背板带宽 下篇帖子: Cisco ACL访问控制列表实现网络单向访问
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表