博威---云架构决胜云计算

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2040|回复: 1

port channel交换机链路聚合在网络中的作用

[复制链接]
发表于 2011-1-13 14:49:44 | 显示全部楼层 |阅读模式
port channel交换机链路聚合在网络中的作用
链路聚合有成端口聚合,断口捆绑,英文名port trunking.功能是将交换机的多个低带宽端口捆绑成一条高带宽链路,可以实现链路负载平衡。避免链路出现拥塞现象。通过配置,可通过两个三个或是四 个端口进行捆绑,分别负责特定端口的数据转发,防止单条链路转发速率过低而出现丢包的现象。 Trunking的优点: 价格便宜,性能接近千兆以太网;不需要重新布线,也无需考虑千兆网传输距离极限问题;trunking可以捆绑任何相关的端口,也可以随时取消设置,这样提供了很高的灵活性还可以提


 链路聚合有成端口聚合,断口捆绑,英文名port trunking.功能是将交换机的多个低带宽端口捆绑成一条高带宽链路,可以实现链路负载平衡。避免链路出现拥塞现象。通过配置,可通过两个三个或是四 个端口进行捆绑,分别负责特定端口的数据转发,防止单条链路转发速率过低而出现丢包的现象。
  Trunking的优点:价格便宜,性能接近千兆以太网;不需要重新布线,也无需考虑千兆网传输距离极限问题;trunking可以捆绑任何相关的端口,也可以随时取消设置,这样提供了很高的灵活性还可以提供负载均衡能力以及系统容错。
  命令:port-group <port-group-number> mode {active|passive|on}
  no port-group <port-group-number>
  功能:将物理端口加入Port Channel,该命令的no 操作为将端口从Port Channel 中去除
  参数:<port-group-number> 为Port Channel 的组号,范围为1~16;active(0) 启动端口的LACP 协议,并设置为Active 模式;passive(1) 启动端口的LACP 协议,并且设置为Passive 模式;on(2) 强制端口加入Port Channel,不启动LACP 协议。
  举例:在Ethernet0/0/1 端口模式下,将本端口以active 模式加入port-group
  Switch(Config-Ethernet0/0/1)#port-group 1 mode active
  命令:interface port-channel <port-channel-number>
  功能:进入汇聚接口配置模式
  命令模式:全局配置模式
  举例:进入port-channel1 配置模式

Switch(Config)#interface port-channel 1
Switch(Config-If-Port-Channel1)#


  举例1:如果交换机Switch1 上的1,2,3 端口都是access 口,并且都属于vlan 1,将这三个端口以active 方式加入group 1,Switch2 上6,8,9 端口为trunk 口,并且是allow all,将这三个端口以passive 方式加入group 2,将以上对应端口分别用网线相连。
  方法1配置步骤如下:

Switch1#configSwitch1 (Config)#interface eth 0/0/1-3
Switch1 (Config-Port-Range)#port-group 1 mode active
Switch1 (Config-Port-Range)#exit
Switch1 (Config)#interface port-channel 1
Switch1 (Config-If-Port-Channel1)#
Switch2#configSwitch2 (Config)#port-group 2
Switch2 (Config)#interface eth 0/0/6
Switch2 (Config-Ethernet0/0/6)#port-group 2 mode passive
Switch2 (Config-Ethernet0/0/6)#exit
Switch2 (Config)# interface eth 0/0/8-9
Switch2 (Config-Port-Range)#port-group 2 mode passive
Switch2 (Config-Port-Range)#exit
Switch2 (Config)#interface port-channel 2
Switch2 (Config-If-Port-Channel2)#


Switch1#configSwitch1 (Config)#interface eth 0/0/1-3
Switch1 (Config-Port-Range)#port-group 1 mode active
Switch1 (Config-Port-Range)#exit
Switch1 (Config)#interface port-channel 1
Switch1 (Config-If-Port-Channel1)#
Switch2#configSwitch2 (Config)#port-group 2
Switch2 (Config)#interface eth 0/0/6
Switch2 (Config-Ethernet0/0/6)#port-group 2 mode passive
Switch2 (Config-Ethernet0/0/6)#exit
Switch2 (Config)# interface eth 0/0/8-9
Switch2 (Config-Port-Range)#port-group 2 mode passive
Switch2 (Config-Port-Range)#exit
Switch2 (Config)#interface port-channel 2
Switch2 (Config-If-Port-Channel2)#



Switch1#configSwitch1 (Config)#interface eth 0/0/1-3
Switch1 (Config-Port-Range)#port-group 1 mode active
Switch1 (Config-Port-Range)#exit
Switch1 (Config)#interface port-channel 1
Switch1 (Config-If-Port-Channel1)#
Switch2#config
Switch2 (Config)#port-group 2
Switch2 (Config)#interface eth 0/0/6
Switch2 (Config-Ethernet0/0/6)#port-group 2 mode passive
Switch2 (Config-Ethernet0/0/6)#exit
Switch2 (Config)# interface eth 0/0/8-9
Switch2 (Config-Port-Range)#port-group 2 mode passive
Switch2 (Config-Port-Range)#exit
Switch2 (Config)#interface port-channel 2
Switch2 (Config-If-Port-Channel2)#



Switch1#config
Switch1 (Config)#interface eth 0/0/1-3
Switch1 (Config-Port-Range)#port-group 1 mode active
Switch1 (Config-Port-Range)#exit
Switch1 (Config)#interface port-channel 1
Switch1 (Config-If-Port-Channel1)#Switch2#config
Switch2 (Config)#port-group 2
Switch2 (Config)#interface eth 0/0/6
Switch2 (Config-Ethernet0/0/6)#port-group 2 mode passive
Switch2 (Config-Ethernet0/0/6)#exit
Switch2 (Config)# interface eth 0/0/8-9
Switch2 (Config-Port-Range)#port-group 2 mode passive
Switch2 (Config-Port-Range)#exit
Switch2 (Config)#interface port-channel 2
Switch2 (Config-If-Port-Channel2)#



Switch1#configSwitch1 (Config)#interface eth 0/0/1-3
Switch1 (Config-Port-Range)#port-group 1 mode active
Switch1 (Config-Port-Range)#exit
Switch1 (Config)#interface port-channel 1
Switch1 (Config-If-Port-Channel1)#Switch2#config
Switch2 (Config)#port-group 2
Switch2 (Config)#interface eth 0/0/6
Switch2 (Config-Ethernet0/0/6)#port-group 2 mode passive
Switch2 (Config-Ethernet0/0/6)#exit
Switch2 (Config)# interface eth 0/0/8-9
Switch2 (Config-Port-Range)#port-group 2 mode passive
Switch2 (Config-Port-Range)#exit
Switch2 (Config)#interface port-channel 2
Switch2 (Config-If-Port-Channel2)#


  配置结果:
  过一段时间后,shell 提示端口汇聚成功,此时Switch1 的端口1,2,3 汇聚成一个汇聚端口,汇聚端口名为Port-Channel1,Switch2 的端口6,8,9 汇聚成一个汇聚端口,汇聚端口名为Port-Channel2,并且都可以进入汇聚接口配置模式进行配置。

方法2:以ON 方式配置Port Channel.
  配置步骤如下:

Switch1#configSwitch1 (Config)#interface eth 0/0/1
Switch1 (Config-Ethernet0/0/1)# port-group 1 mode on
Switch1 (Config-Ethernet0/0/1)#exit
Switch1 (Config)#interface eth 0/0/2
Switch1 (Config-Ethernet0/0/2)# port-group 1 mode on
Switch1 (Config-Ethernet0/0/2)#exit
Switch1 (Config)#interface eth 0/0/3
Switch1 (Config-Ethernet0/0/3)# port-group 1 mode on
Switch1 (Config-Ethernet0/0/3)#exit
Switch2#configSwitch2 (Config)#port-group 2
Switch2 (Config)#interface eth 0/0/6
Switch2 (Config-Ethernet0/0/6)#port-group 2 mode on
Switch2 (Config-Ethernet0/0/6)#exit
Switch2 (Config)# interface eth 0/0/8-9
Switch2 (Config-Port-Range)#port-group 2 mode on
Switch2 (Config-Port-Range)#exit


  配置结果:
  将交换机Switch1 上的1,2,3 三个端口依次加入port-group1 后我们可以看到,以on 方式加入一个组完全是强制性的,两端的交换机并不会通过交换LACP PDU 来完成汇聚,汇聚也是触发式的,当敲入将2 号端口加入port-group1 的命令时,1 和2 马上汇聚在一起形成port-channel1,当将3 号端口加入port-group1 时,1 和2 汇聚成的port-channel1 被拆散,马上1,2,3 三个端口又重新汇聚成port-channel1(需要说明的是,当有一个新的端口要加入已经汇聚成功的组时,必须先拆散原先的组,然后再能汇聚成一个新 的组)。结果是Switch1 和Switch2 上的三个端口都以ON 模式汇聚起来,各自形成一个汇聚端口。
  总结 :
  1;生成树,STP,主要作用是避免环路,网络中有冗余,经常使用多条链路就会产生环路,广播风暴,网络瘫痪,注意的是涉及网络时候千万不要忘 记生成树的启动。如图3,比如说一般大企业中核心交换机于其他交换机都是两条网线连接,这样其中一条出现错误另一条可以工作,但是如果PC2和PC1通信 这样就容易出现环路,产生广播风暴,,生成树可以解决这个问题。
  2:链路聚合:它的主要作用就是增加网络带宽,一种是交换机之间,如图二比如说两台交换机设备,用一根百兆网线级联,由于访问两台太大就会产生 屏蔽,速度变慢,这个时间就可以使用链路聚合,使用port-group命令,建立链路聚合,多用两条网线连接交换机,并把两台交换机连接的端口各自聚合 在一起,能增加网络带宽。还有一种情况就是,如图一,交换机于服务器之间的链接,比如说一台服务器连接交换机上,如果访问量很大,那么服务器就会承受不 了,就可以考虑多按两块网卡,使用链路聚合使两块网卡连接的端口聚合在一起,减轻服务器的负担。

 楼主| 发表于 2011-1-13 14:58:13 | 显示全部楼层
Port Channel举例
案例1:以lacp方式配置port channel。




   




    在下面说明中都用switch来表示dcrs-5512gc。




    如图所示,交换机switch1上的1,2,3端口都是access口,并且都属于vlan 1,将这三个端口以active方式加入group 1,switch2上6,8,9端口为trunk口,并且是allow all,将这三个端口以passive方式加入group 2,将以上对应端口分别用网线相连。




    配置步骤如下:




    switch1#config




    switch1 (config)#interface eth 0/0/1-3




    switch1 (config-port-range)#port-group 1 mode active




    switch1 (config-port-range)#exit




    switch1 (config)#interface port-channel 1




    switch1 (config-if-port-channel1)#




    switch2#config




    switch2 (config)#port-group 2




    switch2 (config)#interface eth 0/0/6




    switch2 (config-ethernet0/0/6)#port-group 2 mode passive




    switch2 (config-ethernet0/0/6)#exit




    switch2 (config)# interface eth 0/0/8-9




    switch2 (config-port-range)#port-group 2 mode passive




    switch2 (config-port-range)#exit




    switch2 (config)#interface port-channel 2




    switch2 (config-if-port-channel2)#




    配置结果:




    过一段时间后,shell提示端口汇聚成功,此时switch1的端口1,2,3汇聚成一个汇聚端口,汇聚端口名为port- channel1,switch2的端口6,8,9汇聚成一个汇聚端口,汇聚端口名为port-channel2,并且都可以进入汇聚接口配置模式进行配 置。




    案例2:以on方式配置port channel。




   




    如图所示,交换机switch1上的1,2,3端口都是access口,并且都属于vlan 1,将这三个端口以on方式加入group 1,在switch2上6,8,9端口为trunk口,并且是allow all,将这三个端口以on方式加入group 2。




    配置步骤如下:




    switch1#config




    switch1 (config)#interface eth 0/0/1




    switch1 (config-ethernet0/0/1)# port-group 1 mode on




    switch1 (config-ethernet0/0/1)#exit




    switch1 (config)#interface eth 0/0/2




    switch1 (config-ethernet0/0/2)# port-group 1 mode on




    switch1 (config-ethernet0/0/2)#exit




    switch1 (config)#interface eth 0/0/3




    switch1 (config-ethernet0/0/3)# port-group 1 mode on




    switch1 (config-ethernet0/0/3)#exit




    switch2#config




    switch2 (config)#port-group 2




    switch2 (config)#interface eth 0/0/6




    switch2 (config-ethernet0/0/6)#port-group 2 mode on




    switch2 (config-ethernet0/0/6)#exit




    switch2 (config)# interface eth 0/0/8-9




    switch2 (config-port-range)#port-group 2 mode on




    switch2 (config-port-range)#exit




    配置结果:




    将交换机switch1上的1,2,3三个端口依次加入port-group1后我们可以看到,以on方式加入一个组完全是强制性的,两端的交换机并不会 通过交换lacp pdu来完成汇聚,汇聚也是触发式的,当敲入将2号端口加入port-group1的命令时,1和2马上汇聚在一起形成port-channel1,当将 3号端口加入port-group1时,1和2汇聚成的port-channel1被拆散,马上1,2,3三个端口又重新汇聚成port- channel1(需要说明的是,当有一个新的端口要加入已经汇聚成功的组时,必须先拆散原先的组,然后再能汇聚成一个新的组)。结果是switch1和 switch2上的三个端口都以on模式汇聚起来,各自形成一个汇聚端口。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|boway Inc. ( 冀ICP备10011147号 )

GMT+8, 2024-5-6 09:21 , Processed in 0.091722 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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