当前位置: 首页 > news >正文

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

目录

一.

实验内容

STP配置实验

RSTP配置实验

MSTP配置实验

二.

1 ) STP配置实验

实验拓扑

​编辑

实验配置

实验结果

2 ) RSTP配置实验

实验拓扑

实验配置

实验结果

3 ) MSTP配置实验

实验拓扑

实验配置

​编辑

实验结果

实验总结


一.

实验内容

1)

STP配置实验

2)

RSTP配置实验

3)

MSTP配置实验

二.

1 ) STP配置实验

实验拓扑

a09ccf14d628410b90f1ca1c7df56781.png

实验配置

查看 SW1~3的MAC地址

设备MAC地址
SW14c1f-cc17-48bd
SW24c1f-ccda-40e8
SW34c1f-cc6c-011c

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

设备IP地址
PC-1192.168.1.1/24
PC-2192.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:

daeb14d4958749238509ae6e976bb5cb.png

SW2:

5dd04ea433a34723922211721dbb55cb.png

SW3:

7fe302417db84dfab98c6ddbc7cf66ee.png

实验结果

MAC地址越小越优

1 ) 优先级:SW1>SW3>SW2 

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

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

2 ) RSTP配置实验

实验拓扑

40d007c49c39457cb326059a1fd83086.png

内容与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:

44651fbb06bb4a3ba2d60d64ffec8bee.png

SW2:

ede5d93c9acd42a78b4038d3ad9ad5b0.png

SW3:

acb7e62cadd9403a8ef26ad4938a2bdf.png

实验结果

优先级:

SW2 > SW1 > SW3

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

2) 新添加端口角色

    

端口类型备份端口作用
Aternate prot 替代端口
RP的备份
Alternate端口提供了从指定桥到根的另一条可切换路径,作为根端口的备份端口
Back port 备份端口
DP的备份
Backup端口作为指定端口的备份,提供了另一条从根桥到相应网段的备份通路

3 ) MSTP配置实验

实验拓扑

4a9bd3990f444e009afce4dad614571c.png

实验配置

设备IP地址子网掩码网关所属VLAN
PC-1192.168.10.10255.255.255.0192.168.10.254VLAN 10
PC-2192.168.20.20255.255.255.0192.168.20.254VLAN 20

查看 SW 1~4 的MAC地址

设备MAC地址
SW 14c1f-ccca-66f6
SW 24c1f-cc8c-68e1
SW 34c1f-cc1c-344f
SW 44c1f-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

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

1c962d05d71846229ca6b1f443702270.png

69b697fd27c14036b7a35dc382cf0d01.png

2721381197ca468fbc2aea555a7fa9a1.png

bafa6100cbed4120bd34175d0284e3f1.png

优先级:(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

3b294bc6a70b4b6a83aa979c5df6b536.png

SW2

bf94e57e0d2f43bc82079bb1628dbd12.png

SW3

230b67c919824aaaa5b963a85a4fa588.png

SW4

c820538b7d494a2b93a84adf97f6a307.png

实验总结

通过上述实验得出的结论

STP不足:状态多,反应时间长,网络出现问题需要等待很长时间
RSTP不足:流量无法负载分担 二层次优路径
MSTP优点:可以快速收敛,提供了数据多个路径,实现了VLAN间数据的负载均衡

http://www.lryc.cn/news/437497.html

相关文章:

  • 服务器环境搭建-5 Nexus搭建与使用介绍
  • 将 Parallels Desktop(PD虚拟机)安装在移动硬盘上,有影响吗?
  • PHP智能化云端培训考试系统小程序源码
  • 内幕!smardaten无代码平台全方位测评,这些细节你绝对想不到!
  • 计算机专业的真正的就业情况
  • Java对象列表属性映射工具类
  • .net core 通过Sqlsugar生成实体
  • ORCA-3D避障算法解析
  • CentOS 7停更官方yum源无法使用,更换阿里源
  • Introduction结构
  • 基于SpringBoot实现SpringMvc上传下载功能实现
  • vue 控制组件是否显示
  • 生产部门不给力?精益化生产管理咨询公司为您出谋划策
  • HTML+CSS - 网页布局之网格布局
  • 基于51单片机的16X16点阵显示屏proteus仿真
  • 【目标检测数据集】厨房常见的水果蔬菜调味料数据集4910张39类VOC+YOLO格式
  • 在Python中统计字符串中每个字符出现的次数
  • 关于 vue/cli 脚手架实现项目编译运行的源码解析
  • C++笔记---继承(上)
  • 气膜体育馆:为学校打造智能化运动空间—轻空间
  • JVM 调优篇5 jvm性能监控
  • 一. Unity实现虚拟摇杆及屏幕自适应功能
  • 【达梦数据库】mysql 和达梦 tinyint 与 bit 返回值类型差异
  • VUE工程中axios基本使用
  • 跨服务器执行PowerShell脚本
  • linux_L2_linux删除文件
  • 系统架构设计师 - 项目管理
  • Spring Boot基础
  • C语言 | Leetcode C语言题解之第402题移掉K位数字
  • 使用Visual Studio Code配置C/C++开发环境的全面指南