链路汇聚--以太网通道(上)

当两台交换机之间连接多条线路来增加带宽时,由于STP的原因,最终会阻断其他多余的线路而只留下一条活动的链路来转发数据,因此在两台交换机之间连接多条线路,并不能起到增加带宽的作用,为了能够让两台交换机之间连接的多条线路可以同时提供数据转发以达到增加带宽的效果,那么我们就要使用以太网通道来解决这个问题

以太网通道将交换机上的多条线路捆绑成一个组,相当于逻辑链路,组中活动的物理链路同时提供数据的转发,可以提高链路带宽。当组中有物理链路断掉之后,那么流量将被转移到剩下的活动链路中去,只要组中还有活动链路,用户的流量就不会中断。

 

实验内容 :搭建一个二层以太网通道

实验拓扑:

 

 

从图上我们看到,两台交换机用同处于相同VLAN两条线路相连,由于STP的原因,其中一个端口会被阻塞掉以防止环路的产生。但是我们通过以太网通道可以吧两条链路合并为一条,这样就不会因为STP二将端口阻塞,从而增加带宽

 

为了让两边交换机接口都工作在以太网通道中,可以手工强制指定接口工作在组中,也可以通过协议自动协商,如果手工强制指定则不需要协商,协商成为 channel 的协议有两种

 

PAGP

是思科私有的协议,有auto  desirable 状态

auto 不主动发送PAGP帧但是会主动回应

desirable 主动发送PAGP帧 使得链路两端会协商成为 channel

 

LACP

是IEEE的标准协议 端口状态有 active 和 passive

active 相当于 PAGP的 desirable

passive 相当于 PAGP 的 auto

 

独立于两个协议之外的还有一个模式

on: 强制链路成为 channel

 

下面我们进行试验的配置过程

Switch(config)#hostname sw1

sw1(config)#int range f0/1- 2

sw1(config-if-range)#channel-group ?

  <1-6>  Channel group number

sw1(config-if-range)#channel-group 1 ?  为以太网通道配置一个编号

  mode  Etherchannel Mode of the interface

sw1(config-if-range)#channel-group 1 mode ?   配置通道模式

  active     Enable LACP unconditionally      LACP协议的状态

  auto       Enable PAgP only if a PAgP device is detected

  desirable  Enable PAgP unconditionally      PAGP协议的状态

  on         Enable Etherchannel only         强制成为 channel

  passive    Enable LACP only if a LACP device is detected    LACP协议状态

sw1(config-if-range)#channel-group 1 mode desirable  配置channel状态为 desirable

sw1(config-if-range)#channel-protocol pagp      配置以太网通道协议

 

注:使用desirable 这个是PAGP协议的一个状态,如果我再使用 desirable状态时,将以太网通道协议改为LACP则会发生错误

sw1(config-if-range)#channel-protocol lacp

Command rejected (the interface Fa0/1 is ): is already part of a channel with a different type of protocol enabled

Command rejected (the interface Fa0/2 is ): is already part of a channel with a different type of protocol enabled

 

所以我们选择的 channel 协议一定要和状态相匹配

 

两台形成channel 的交换机端口要配置相同,我们继续在对端交换机进行配置

Switch(config)#hostname sw2

sw2(config)#int range f0/1 - 2

sw2(config-if-range)#channel-group 1 mode desirable 

sw2(config-if-range)#channel-protocol pagp

 

在交换机 sw2 上配置成功,此时以太网通道建立

 

 

 

下面我们进行以太网通道的验证

sw2#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

------+-------------+-----------+----------------------------------------------

 

1      Po1(SU)           PAgP   Fa0/1(P) Fa0/2(P) 

 

提示为 SU 代表通道建立成功

为什么?  S:代表layer2  U:代表正在使用

所以 SU 代表当前的以太网通道时二层以太网通道

 

sw2#show etherchannel  port-channel 

                Channel-group listing:

                ----------------------

 

Group: 1                 标识当前以太网通道的编号

----------

                Port-channels in the group:

                ---------------------------

 

Port-channel: Po1

------------

 

Age of the Port-channel   = 00d:00h:05m:13s

Logical slot/port   = 2/1       Number of ports = 2    该通道总共有两个端口组成

GC                  = 0x00000000      HotStandBy port = null

Port state          = Port-channel 

Protocol            =   PAGP                     以太网通道所用的协商协议

Port Security       = Disabled            

 

Ports in the Port-channel:

 

Index   Load   Port     EC state        No of bits

------+------+------+------------------+-----------

  0     00     Fa0/1    Desirable-Sl       0            组成通道的两个端口 协议状态为

  0     00     Fa0/2    Desirable-Sl       0            desirable

Time since last port bundled:    00d:00h:05m:13s    Fa0/2   

 

 

以太网通道也可以像普通端口一样被划进相应的 vlan之中

sw2(config)#int port-channel 1

sw2(config-if)#switchport mode access 

sw2(config-if)#switchport access vlan 2

% Access VLAN does not exist. Creating vlan 2

 

二层的以太网通道就介绍到这里。

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值