生成树详细配置(STP、RSTP、MSTP)

简介: 生成树详细配置(STP、RSTP、MSTP)


一.实验内容

1)

STP配置实验

2)

RSTP配置实验

3)

MSTP配置实验


二.

1 ) STP配置实验

实验拓扑

实验配置

查看 SW1~3的MAC地址

设备 MAC地址
SW1 4c1f-cc17-48bd
SW2 4c1f-ccda-40e8
SW3 4c1f-cc6c-011c

MAC地址越小越优 SW1<SW3<SW2

设备 IP地址
PC-1 192.168.1.1/24
PC-2 192.168.1.2/24

SW1:

un ter mo

sys

sys SW1

vlan 10

int vlan 10

int g0/0/1

port l t

port trunk all vlan all

int g0/0/2

port l t

port trunk all vlan all

q

stp enable

stp mode stp

SW2:

un ter mo

sys

sys SW2

vlan 10

int vlan 10

int g0/0/01

port l acc

port d vlan 10

int g0/0/2

port l t

port trunk all vlan all

int g0/0/3

port l t

port trunk all vlan all

q

stp enable

stp mode stp

SW3:

un ter mo

sys

sys SW3

vlan 10

int g0/0/2

port l acc

port d vlan 10

int g0/0/1

port l t

port trunk all vlan all

int g0/0/3

port l t

port trunk all vlan all

q

stp enable

stp mode stp

查看端口状态

SW1:

SW2:

SW3:

实验结果

MAC地址越小越优

1 ) 优先级:SW1>SW3>SW2

2 ) SW2的G0/0/3端口是ROOT备选口

3 ) STP的缺点就是状态变化时间太长

2 ) RSTP配置实验

实验拓扑

内容与STP一样,只需要更改stp的类型即可,更改SW2为根交换机,SW1为备交换机

secondary  (优先级为4096)  primary (优先级为0)

实验配置

SW1:

stp mode rstp

stp root secondary

SW2:

stp mode rstp

stp root primary

SW3:

stp mode rstp

再查看端口状态时(可以与上方的自行比较)

SW1:

SW2:

SW3:

实验结果

优先级:

SW2 > SW1 > SW3

1) 根据是否转发用户流量和学习MAC地址进行划分;由原来的5种缩减为3种

2) 新添加端口角色

   

端口类型 备份端口 作用

Aternate prot 替代端口

RP的备份

Alternate端口提供了从指定桥到根的另一条可切换路径,作为根端口的备份端口

Back port 备份端口

DP的备份

Backup端口作为指定端口的备份,提供了另一条从根桥到相应网段的备份通路

3 ) MSTP配置实验

实验拓扑

实验配置

设备 IP地址 子网掩码 网关 所属VLAN
PC-1 192.168.10.10 255.255.255.0 192.168.10.254 VLAN 10
PC-2 192.168.20.20 255.255.255.0 192.168.20.254 VLAN 20

查看 SW 1~4 的MAC地址

设备 MAC地址
SW 1 4c1f-ccca-66f6
SW 2 4c1f-cc8c-68e1
SW 3 4c1f-cc1c-344f
SW 4 4c1f-cc44-413d

SW1:

un ter mo

sys

sys SW1

vlan ba 10 20

port-group 1

group-m g0/0/3

group-m g0/0/5

group-m g0/0/2

port l t

port trunk all vlan all

q

stp enable

stp mode mstp

SW2:

un ter mo

sys

sys SW2

vlan ba 10 20

port-group 2

group-m g0/0/3

group-m g0/0/2

group-m g0/0/6

port l t

port trunk all vlan all

q

stp enable

stp mode mstp

SW3:

un ter mo

sys

sys SW3

vlan ba 10 20

int vlan 10

ip add 192.168.10.254 24

int vlan 20

ip add 192.168.20.254 24

q

port-group 3

group-m g0/0/2

group-m g0/0/4

group-m g0/0/6

port l t

port trunk all vlan all

q

int g0/0/1

port l acc

port d vlan 10

q

stp enable

stp mode mstp

SW4:

un ter mo

sys

sys SW4

vlan ba 10 20

int vlan 10

ip add 192.168.10.254 24

int vlan 20

ip add 192.168.20.254 24

q

port-group 4

group-m g0/0/2

group-m g0/0/4

group-m g0/0/5

port l t

port trunk all vlan all

q

int g0/0/1

port l acc

port d vlan 20

q

stp enable

stp mode mstp

查看交换机在生成树中的角色

优先级:(SW3 > SW4 > SW2 > SW1)

配置MSTP

VLAN10的根交换机为 SW1,备交换机为SW3为4096,从交换机为SW4优先级为8192,SW2默认优先级即可

VLAN20的根交换机为 SW2,备交换机为SW4为4096,从交换机为SW3优先级为8192,SW1默认优先级即可

SW1:

stp region-configuration

region-name huawei

revision-level 1

instance 1 vlan 10

instance 2 vlan 20

active region-configuration

q

stp instance 1 priority 0

SW2:

stp region-configuration

in 1 vlan 10

in 2 vlan 20

re huawei

revision-level 1

active region-configuration

q

stp instance 2 priority 0

SW3:

stp region-configuration

in 1 vlan 10

in 2 vlan 20

re huawei

rev 1

active re

q

stp instance 1 priority 4096

stp instance 2 priority 8192

SW4:

stp re

in 1 vlan 10

in 2 vlan 20

re huawei

rev 1

active re

q

stp in 2 p 4096

stp in 1 p 8192

 

实验结果

可以自行对照上面

SW1

SW2

SW3

SW4


三.实验总结

通过上述实验得出的结论

STP不足:状态多,反应时间长,网络出现问题需要等待很长时间

RSTP不足:流量无法负载分担 二层次优路径

MSTP优点:可以快速收敛,提供了数据多个路径,实现了VLAN间数据的负载均衡


相关文章
|
运维 负载均衡 算法
|
11月前
|
存储 运维 安全
|
9月前
|
数据安全/隐私保护
思科模拟器Cisco Packet Tracer 8.2.1注册、下载和安装教程(正确+详细)
本文详细总结了思科模拟器Cisco Packet Tracer 8.2.1注册、下载和安装教程(正确+详细),看这一篇就够啦~
27369 5
思科模拟器Cisco Packet Tracer 8.2.1注册、下载和安装教程(正确+详细)
|
11月前
|
网络协议 网络架构
路由策略原理与配置
路由策略原理与配置
181 0
路由策略原理与配置
|
10月前
|
存储 弹性计算 固态存储
阿里云服务器按量付费是什么?划算吗?
阿里云ECS按量付费模式,先使用后付费,按小时结算,适合临时扩展、测试、电商抢购等短期应用。开通需账户余额不低于100元。实例、镜像、云盘、带宽等支持按量计费,价格根据配置和地区而异。可随时转为包年包月。
1834 1
|
11月前
|
负载均衡 安全 网络安全
策略路由与路由策略的区别
策略路由与路由策略的区别
524 0
策略路由与路由策略的区别
|
网络协议 数据安全/隐私保护 网络架构
网络工程师:RIP常用命令
【7月更文挑战第4天】
542 1
网络工程师:RIP常用命令
|
11月前
|
负载均衡 算法 网络虚拟化
生成树原理详解
生成树原理详解
238 0
|
11月前
|
数据采集 开发者 Python
Python正则表达式之re.compile函数
`re.compile`是Python正则表达式处理中一个强大的工具,它通过预先编译正则表达式,不仅提升了执行效率,还增强了代码的组织性和可读性。掌握其使用,对于涉及文本分析、数据清洗、日志处理等领域的Python开发者来说,是非常必要的技能。正确并高效地应用这一功能,可以显著提升程序的性能和维护性。
732 0
|
机器学习/深度学习 传感器 编解码
【多传感器融合】BEVFusion: 激光雷达和摄像头融合框架 NeurIPS 2022
BEVFusion提出一个融合多摄像头和激光雷达数据的框架,可用于3D检测。在自动驾驶领域,通过独立处理并融合摄像头和激光雷达数据,可以显著提升3D对象检测的准确性和稳健性,尤其是在激光雷达可能出现故障的真实场景中。
3476 57
【多传感器融合】BEVFusion: 激光雷达和摄像头融合框架 NeurIPS 2022