STP---链路聚合

链路聚合:
以太网链路聚合是指将多条以太网物理链路捆绑在一起成为一条逻辑链路,从而实现增加链路带宽的目的。链路聚合分为手工模式和LACP模式。
• 当下行多条链路聚合到一台交换机时,可能产生拥塞。
• 一种解决方法是提高上行链路带宽,但是不能无限扩展。
• 另一种解决方法是增加上行链路;环路避免机制将阻塞某些端口。

EtherChannel 的优点
提供更多带宽
将多条相似的链路进行逻辑聚合
视为一条逻辑链路
提供负载分担和冗余
支持交换端口(二层)和路由端口(三层)
PAGP-------思科私有
PAgP协商EtherChannel的创建和维护:
• On:通道成员无需协商
• Desirable:主动向对端发送协商报文
• Auto:被动地响应对端的协商报文
• Off:此接口无法形成EtherChannel

LAGP-------国际标准802.3ad
LACP协商EtherChannel的创建和维护:
• On:通道成员无需协商
• Active:主动向对端发送协商报文
• Passive:被动地响应对端的协商报文
• Off:此接口无法形成EtherChannel

不使用上述协议时,可以静态配置EtherChannel

Port-Channel接口的配置更改影响该EtherChannel中的所有接口。
物理接口的配置更改仅影响本接口。
同一个EtherChannel中的所有接口必须配置相同。
• 相同的速率(Speed)和双工模式(Duplex)
• 相同的模式(Access或Trunk)
• Trunk端口配置相同的native VLAN以及允许的VLAN
• Access端口划分到相同的VLAN
• 建议在port-channel接口配置这些参数

Etherchannel:以太信道
二层etherchannel :提高链路的带宽,减少了阻塞端口的数量,增加网络稳定性
三层etherchannel :提高了链路的带宽,增加网络的稳定性

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的二层配置和三层配置的区别: 三层用no switchport 关闭二层功能,既要在channel下关闭也要在物理端口下使用此命令,并配置channel端口的ip地址–no shutdown

实验:
在这里插入图片描述

1.首先完成三个交换机各个接口的绑定。
SW1(config)#int range e0/0-1
SW1(config-if-range)#channel-group 12 mode on
Creating a port-channel interface Port-channel 12
SW1(config-if-range)#exit
SW1(config)#int port-channel 12
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#exit
SW1(config-if-range)#switchport trunk encapsulation dot1q
SW1(config-if-range)#switchport mode trunk
SW1(config)#int range e0/2-3
SW1(config-if-range)#channel-group 13 mode on
Creating a port-channel interface Port-channel 13
SW1(config-if-range)#exit
SW1(config)#
SW1(config)#int port-channel 13
SW1(config-if)#SWitchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config-if)#exit
SW1(config)#int range e0/2-3
SW1(config-if-range)#switchport trunk encapsulation dot1q
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#shutdown

SW1(config#int range e0/0-3
SW1(config-if-range)#no shut

SW2(config)#int range e0/0-1
SW2(config-if-range)#channel-group 12 mode on
Creating a port-channel interface Port-channel 12
SW2(config)#int port-channel 12
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)#ex
SW2(config)#int range e0/0-1
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#shutdown
SW2(config)#int range e0/2-3
SW2(config-if-range)#channel-group 23 mode on
Creating a port-channel interface Port-channel 23
SW2(config)#int port-channel 23
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config-if)#exit
SW2(config)#int range e0/2-3
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#switchport mode t
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#no shut

SW2(config-if-range)#ex
SW2(config)#int range e0/0-3
SW2(config-if-range)#no shut

SW3(config)#int range e0/0-1
SW3(config-if-range)#channel-group 13 mode on
Creating a port-channel interface Port-channel 13
SW3(config)#int port-channel 13
SW3(config-if)#switchport trunk encapsulation dot1q
SW3(config-if)#switchport mode trunk
SW3(config-if)#exit
SW3(config)#int range e0/0-1
SW3(config-if-range)#switchport mode trunk
SW3(config-if-range)#switchport trunk encapsulation dot1q
SW3(config-if-range)#switchport mode trunk
SW3(config-if-range)#shutdown
SW3(config)#int range e0/2-3
SW3(config-if-range)#channel-group 23 mode on
Creating a port-channel interface Port-channel 23
SW3(config-if-range)#ex
SW3(config)#int port-channel 23
SW3(config-if)#switchport trunk encapsulation dot1q
SW3(config-if)#switchport mode trunk
SW3(config-if)#ex
SW3(config)#int range e0/2-3
SW3(config-if-range)#switchport trunk encapsulation dot1q
SW3(config-if-range)#switchport mode trunk
SW3(config-if-range)#shut
SW3(config-if-range)#ex

SW3(config)#int range e0/0-3
SW3(config-if-range)#no shut

SW1#show int trunk 查看命令
Port Mode Encapsulation Status Native vlan
Po12 on 802.1q trunking 1
Po13 on 802.1q trunking 1

SW1#show etherchannel summary 查看命令
------±------------±----------±----------------------------------------------
12 Po12(SU) - Et0/0§ Et0/1§
13 Po13(SU) - Et0/2§ Et0/3§

2.设置PVRST+快速生成树rapid-pvst。
SW1(config)#vlan 10
SW1(config-vlan)#vlan 20
SW1(config)#spanning-tree mode rapid-pvst
SW1(config)#spanning-tree vlan 10 root primary
SW1(config)#spanning-tree vlan 20 root secondary

SW1#show spanning-tree vlan 10

VLAN0010
Spanning tree enabled protocol rstp
Root ID Priority 24586
Address aabb.cc00.1000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 24586 (priority 24576 sys-id-ext 10)
Address aabb.cc00.1000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec

Interface Role Sts Cost Prio.Nbr Type


Po12 Desg FWD 56 128.65 Shr
Po23 Desg FWD 56 128.66 Shr

SW1#show spanning-tree vlan 20

VLAN0020
Spanning tree enabled protocol rstp
Root ID Priority 24596
Address aabb.cc00.2000
Cost 56
Port 65 (Port-channel12)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 28692 (priority 28672 sys-id-ext 20)
Address aabb.cc00.1000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec

Interface Role Sts Cost Prio.Nbr Type


Po12 Root FWD 56 128.65 Shr
Po23 Desg FWD 56 128.66 Shr

SW2(config)#vlan 10
SW2(config-vlan)#vlan 20
SW2(config-vlan)#ex
SW2(config)#spanning-tree mode rapid-pvst
SW2(config)#spanning-tree vlan 20 root primary
SW2(config)#spanning-tree vlan 10 root secondary

SW2#show spanning-tree vlan 10

VLAN0010
Spanning tree enabled protocol rstp
Root ID Priority 24586
Address aabb.cc00.1000
Cost 56
Port 65 (Port-channel12)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 28682 (priority 28672 sys-id-ext 10)
Address aabb.cc00.2000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec

Interface Role Sts Cost Prio.Nbr Type


Po12 Root FWD 56 128.65 Shr
Po23 Desg FWD 56 128.66 Shr

SW2#show spanning-tree vlan 20

VLAN0020
Spanning tree enabled protocol rstp
Root ID Priority 24596
Address aabb.cc00.2000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 24596 (priority 24576 sys-id-ext 20)
Address aabb.cc00.2000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec

Interface Role Sts Cost Prio.Nbr Type


Po12 Desg FWD 56 128.65 Shr
Po23 Desg FWD 56 128.66 Shr

SW3(config)#vlan 10
SW3(config-vlan)#vlan 20
SW3(config-vlan)#ex
SW3(config)#spanning-tree mode rapid-pvst

SW3#show spanning-tree vlan 10

VLAN0010
Spanning tree enabled protocol rstp
Root ID Priority 24586
Address aabb.cc00.1000
Cost 56
Port 65 (Port-channel13)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32778 (priority 32768 sys-id-ext 10)
Address aabb.cc00.3000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec

Interface Role Sts Cost Prio.Nbr Type


Po13 Root FWD 56 128.65 Shr
Po23 Altn BLK 56 128.66 Shr

SW3#show spanning-tree vlan 20

VLAN0020
Spanning tree enabled protocol rstp
Root ID Priority 24596
Address aabb.cc00.2000
Cost 56
Port 66 (Port-channel23)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32788 (priority 32768 sys-id-ext 20)
Address aabb.cc00.3000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec

Interface Role Sts Cost Prio.Nbr Type


Po13 Altn BLK 56 128.65 Shr
Po23 Root FWD 56 128.66 Shr

3.用快速生成树mst模式。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值