MSTP和Eth-trunk

单生成树的缺陷
链路被阻塞后将不承载任何流量,无法在VLAN间实现数据流量的负载均衡,从而造成带宽浪费;导致部分VLAN路径不通;造成次优路径。

MSTP(多生成树)

为了弥补STP和RSTP的缺陷,IEEE于2002年发布的802.1s标准定义了MSTP。MSTP兼容STP和RSTP,既可以快速收敛,又提供了数据转发的多个冗余路径,在数据转发过程中实现VLAN数据的负载均衡。

实例的概念
根据vlan个数为 1-4094
实例也为 1-4094,目的是为了让实例之间不会跨区
优先级+实例号的方式使不同实例之间选择
优先级是4096的倍数,因为是使实例+优先级到达不了下一个优先级

具体配置
首先规划vlan
其次配置配置链路类型,access/trunk
配置STP(华为设备默认MSTP)
stp enable //开启STP,默认开启
stp mode mstp //选择mstp
stp region-configuration //进入mst域配置
region-name aaa //设置域名
instance 1 vlan 1 to 10 //将vlan1-10划入实例1
active region-configuration //激活配置域
stp instance 1 priority 0 // 设置实例1优先级为0

Eth-trunk

随着网络中部署的业务量不断增长,对于全双工点对点链路,单条物理链路的带宽已不能满足正常的业务流量需求。如果将当前接口板替换为具备更高带宽的接口板,则会浪费现有的设备资源,而且升级代价较大。如果增加设备间的链路数量,则在作为三层口使用时需要在每个接口上配置IP地址,从而导致浪费IP地址资源。

Eth-Trunk( 链路聚合技术 )作为一种捆绑技术,可以把多个独立的物理接口绑定在一起作为一个大带宽的逻辑接口使用,这样既不用替换接口板也不会浪费IP地址资源。

Eth-Trunk链路聚合模式:手工负载分担模式和LACP模式

LACP模式
使用地方:核心层和汇聚层

LACP模式也称为M:N模式,其中M条链路处于活动状态转发数据,N条链路处于非活动状态作为备份链路。
只有当活跃的链路出现故障时,备份链路才进行转发。

负载分担
在这里插入图片描述
创建Eth-trunk流程
在这里插入图片描述
具体配置
lacp priority 0 //配置系统优先级
int Eth-Trunk1
description to-SW1-Eth-Trunk0 //添加端口信息描述
mode lacp-static //选择lacp静态绑定
load-balance src-dst-mac //选择负载均衡的方式,默认是源IP
lacp priority 0 //配置接口优先级

int g0/0/0
description xxxx
eth-trunk 1 //划入物理接口
lacp priority 0 //配置接口优先级

dis int eth-trunk 0 //查看接口状态

int eth-trunk0
port link-type trunk
port trunk allow pass vlan 10

二层交换网络配置顺序
eth-trunk
vlan
link-type
stp
vlanif

实验

在这里插入图片描述
要求
本实验模拟内网冗余网络环境,完成以下需求:
1.如图所示,配置设备名称和IP地址。
2.在SW1与SW2之间配置链路聚合协议LACP,完成以下需求:
2.1 SW1作为主动端,设置系统优先级为最高。
2.2 eth-trunk链路的编号为0
2.3 采用静态lacp的方式聚合链路。
2.4 根据源/目MAC地址进行负载均衡。
2.5 将对应端口划入eth-turnk。
3. 在SW1/2/3/4上创建vlan10和vlan20,并完成以下需求:
3.1 四台交换机之间的链路使用trunk模式,并仅允许vlan10和20
3.2 连接PC的链路使用access模式,PC1属于vlan10,PC2属于vlan20.
3.3 SW1上创建vlan10的网关,SW2上创建vlan20的网关,IP地址如图所示。
4. 在SW1/2/3/4之间运行MSTP,完成以下需求:
4.1 配置mstp域名为spoto
4.2 vlan10属于实例1,vlan20属于实例2.
4.3 设置sw1为实例1的根桥,优先级为0;设置sw2为实例1的次根桥,优先级为4096.
4.4 设置sw2为实例2的根桥,优先级为0;设置sw1为实例2的次根桥,优先级为4096.
4.5 SW3/4上与PC互联端口配置为边缘端口。
4.6 使用display stp brief命令,观察各交换机的接口角色与状态,分析vlan10与vlan20的流量走向。
(注:该实验并不要求vlan间可以通信,若想完成vlan间通信可以自行配置。)

参考答案

1.如图所示,配置设备名称和 IP 地址。

2.在 SW1 与 SW2 之间配置链路聚合协议 LACP,完成以下需求:
2.1 SW1 作为主动端,设置系统优先级为最高。
[SW1]lacp priority 0
2.2 eth-trunk 链路的编号为 0
2.3 采用静态 lacp 的方式聚合链路。
2.4 根据源/目 MAC 地址进行负载均衡。
2.5 将对应端口划入 eth-turnk。
[SW1]int Eth-Trunk 0
[SW1-Eth-Trunk0]mode lacp-static
[SW1-Eth-Trunk0]load-balance src-dst-mac
[SW1-Eth-Trunk0]int g0/0/2
[SW1-GigabitEthernet0/0/2]eth-trunk 0
[SW1-GigabitEthernet0/0/2]int g0/0/3
[SW1-GigabitEthernet0/0/3]eth-trunk 0

[SW2]int Eth-Trunk 0
[SW2-Eth-Trunk0]mode lacp-static
[SW2-Eth-Trunk0]load-balance src-dst-mac
[SW2-Eth-Trunk0]int g0/0/2
[SW2-GigabitEthernet0/0/2]eth-trunk 0
[SW2-GigabitEthernet0/0/2]int g0/0/3
[SW2-GigabitEthernet0/0/3]eth-trunk 0

3.在 SW1/2/3/4 上创建 vlan10 和 vlan20,并完成以下需求:
[SW1]vlan batch 10 20
[SW2]vlan batch 10 20
[SW3]vlan batch 10 20
[SW4]vlan batch 10 20
3.1 四台交换机之间的链路使用 trunk 模式,并仅允许 vlan10 和 20
[SW1]int Eth-Trunk 0
[SW1-Eth-Trunk0]port link-type trunk
[SW1-Eth-Trunk0]port trunk allow-pass vlan 10 20
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1] port link-type trunk
[SW1-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 20

[SW2]int Eth-Trunk 0
[SW2-Eth-Trunk0]port link-type trunk
[SW2-Eth-Trunk0]port trunk allow-pass vlan 10 20
[SW2]int g0/0/1
[SW2-GigabitEthernet0/0/1] port link-type trunk
[SW2-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 20

[SW3]int g0/0/1
[SW3-GigabitEthernet0/0/1] port link-type trunk
[SW3-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 20
[SW3-GigabitEthernet0/0/1]int g0/0/2
[SW3-GigabitEthernet0/0/2] port link-type trunk
[SW3-GigabitEthernet0/0/2] port trunk allow-pass vlan 10 20

[SW4]int g0/0/1
[SW4-GigabitEthernet0/0/1] port link-type trunk
[SW4-GigabitEthernet0/0/1] port trunk allow-pass vlan 10 20
[SW4-GigabitEthernet0/0/1]int g0/0/2
[SW4-GigabitEthernet0/0/2] port link-type trunk
[SW4-GigabitEthernet0/0/2] port trunk allow-pass vlan 10 20
3.2 连接 PC 的链路使用 access 模式,PC1 属于 vlan10,PC2 属于 vlan20.
[SW3]int g0/0/3
[SW3-GigabitEthernet0/0/3]port link-type access
[SW3-GigabitEthernet0/0/3]port default vlan 10

[SW4]int g0/0/3
[SW4-GigabitEthernet0/0/3]port link-type access
[SW4-GigabitEthernet0/0/3]port default vlan 20
3.3 SW1 上创建 vlan10 的网关,SW2 上创建 vlan20 的网关,IP 地址如图所示。
[SW1]int vlanif 10
[SW1-Vlanif10]ip add 192.168.1.254 24

[SW2]int vlanif 20
[SW2-Vlanif20]ip add 192.168.2.254 24

4.在 SW1/2/3/4 之间运行 MSTP,完成以下需求:
[SW1]stp mode mstp
[SW2]stp mode mstp
[SW3]stp mode mstp
[SW4]stp mode mstp
4.1 配置 mstp 域名为 spoto
4.2 vlan10 属于实例 1,vlan20 属于实例 2.
SW1/2/3/4:
stp region-configuration
region-name spoto
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
4.3 设置 sw1 为实例 1 的根桥,优先级为 0;设置 sw2 为实例 1 的次根桥,优先级为 4096.
[SW1]stp instance 1 priority 0
[SW2]stp instance 1 priority 4096
4.4 设置 sw2 为实例 2 的根桥,优先级为 0;设置 sw1 为实例 2 的次根桥,优先级为 4096.
[SW1]stp instance 2 priority 4096
[SW2]stp instance 2 priority 0
4.5 SW3/4 上与 PC 互联端口配置为边缘端口。
[SW3]int g0/0/3
[SW3-GigabitEthernet0/0/3]stp edged-port enable

[SW4]int g0/0/3
[SW4-GigabitEthernet0/0/3]stp edged-port enable
4.6 使用 display stp brief 命令,观察各交换机的接口角色与状态,分析 vlan10 与 vlan20 的
流量走向。
(注:该实验并不要求 vlan 间可以通信,若想完成 vlan 间通信可以自行配置。)

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MSTP(Multiple Spanning Tree Protocol)是基于STP协议的一种多实例协议,它可以将一个网络划分为多个区域,每个区域可以独立地计算出最优的转发路径,从而提高网络的可靠性和可扩展性。而Eth-Trunk(以太网聚合)则是一种将多个物理链路组合成一个逻辑链路的技术,可以提高链路的带宽和可靠性,同时还能实现负载均衡等功能。 在实际网络中,MSTPEth-Trunk经常被同时使用,以提高网络的整体性能和可靠性。下面是MSTPEth-Trunk的简单配置示例: 1. 配置MSTP 首先需要在交换机上启用MSTP协议,并将交换机划分为不同的区域(Instance)。 ``` Switch(config)# spanning-tree mode mst Switch(config)# spanning-tree mst configuration Switch(config-mst)# instance 1 vlan 10,20 Switch(config-mst)# instance 2 vlan 30,40 ``` 这里将交换机划分为两个区域,Instance 1包含VLAN10和VLAN20,Instance 2包含VLAN30和VLAN40。 2. 配置Eth-Trunk 接下来需要配置Eth-Trunk,将多个物理链路组合成一个逻辑链路。假设有两个交换机需要使用Eth-Trunk连接,那么配置如下: ``` Switch1(config)# interface Eth-Trunk1 Switch1(config-if)# port link-type trunk Switch1(config-if)# port trunk permit vlan 10 20 30 40 Switch2(config)# interface Eth-Trunk1 Switch2(config-if)# port link-type trunk Switch2(config-if)# port trunk permit vlan 10 20 30 40 ``` 这里将两个交换机的Eth-Trunk端口配置为trunk模式,并允许通过的VLAN为10、20、30和40。 3. 配置端口优先级 最后需要配置端口优先级,以确保数据流量能够平衡地分布到多个物理链路上。假设交换机1和交换机2之间有两个物理链路,那么配置如下: ``` Switch1(config)# interface GigabitEthernet0/0/1 Switch1(config-if)# port-group 1 Switch1(config-if)# stp edged-port enable Switch1(config-if)# stp port-priority 16 Switch1(config)# interface GigabitEthernet0/0/2 Switch1(config-if)# port-group 1 Switch1(config-if)# stp edged-port enable Switch1(config-if)# stp port-priority 32 Switch2(config)# interface GigabitEthernet0/0/1 Switch2(config-if)# port-group 1 Switch2(config-if)# stp edged-port enable Switch2(config-if)# stp port-priority 16 Switch2(config)# interface GigabitEthernet0/0/2 Switch2(config-if)# port-group 1 Switch2(config-if)# stp edged-port enable Switch2(config-if)# stp port-priority 32 ``` 这里将两个物理链路分别配置为同一个端口组(Port-Group),并设置不同的端口优先级,以实现流量负载均衡。 通过以上配置,可以实现将MSTPEth-Trunk结合使用的功能,从而提高网络的整体性能和可靠性。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值