路由与交换——MSTP配置

MSTP多实例生成树配置

STP 生成树协议

规定在只有一个VLAN的前提下

作用:

消除环路:STP可以通过阻塞冗余端口,保证交换网络无环且连通;
链路备份:检测到正在转发数据的链路故障,自动开启某些处于阻塞状态的冗余端口,以迅速 恢复交换网络的连通性。

工作流程

①选举根网桥Root Bridge(根交换机):每个STP网络中只有一台根交换机,称该交换机为STP所构建的生成树的根;
②选举根端口Root Port:非根交换机会在自己的所有端口之间,选择出距离根网桥最近的端口,即是根端口;
③选举指定端口Designated Port:在处于同一网段的所有端口之间,选择出距离根网桥最近的端口;
④阻塞剩余端口:将既不是根端口也不是指定端口的其他所有端口置于阻塞状态,如预备端口Alternate Port。

MSTP 多生成树协议

创建实例,实现对不同VLAN的处理,本次实验将VLAN 10 划分到实例一,VLAN 20划分到实例二,然后将LSW1设置为实例一的根网桥,实例二的备份网桥,LSW2设置为实例二的根网桥,实例一的备份网桥。
已达到优化转发路径和链路利用率的效果。

实验环境:华为ENSP
实验拓扑:

在这里插入图片描述

详细配置:
LSW1
[LSW1]int e0/0/10
[LSW1-Ethernet0/0/10]port link-type trunk
[LSW1-Ethernet0/0/10]port trunk allow-pass vlan all
[LSW1-Ethernet0/0/10]q
[LSW1]int e0/0/20
[LSW1-Ethernet0/0/20]port link-type trunk
[LSW1-Ethernet0/0/20]port trunk allow-pass vlan all
[LSW1-Ethernet0/0/20]q
[LSW1]stp mode mstp	
//设置生成树模式为MSTP
[LSW1]stp region-configuration
//进入生成树配置模式
[LSW1-mst-region]region-name Huawei
//设置MST域名为Huawei
[LSW1-mst-region]instance 1 vlan 10
[LSW1-mst-region]instance 2 vlan 20
//将VLAN 10划分到实例一、VLAN 20划分到实例二
[LSW1-mst-region]active region-configuration 
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW1-mst-region]q
[LSW1]stp instance 1 root primary
[LSW1]stp instance 2 root secondary
[LSW1]stp enable 
[LSW1]int e0/0/1
[LSW1-Ethernet0/0/1]port link-type access 
[LSW1-Ethernet0/0/1]port default vlan 10
[LSW1-Ethernet0/0/1]stp disable 
[LSW1-Ethernet0/0/1]stp edged-port enable 
[LSW1-Ethernet0/0/1]stp bpdu-filter enable 
[LSW1-Ethernet0/0/1]q
[LSW1]int e0/0/2
[LSW1-Ethernet0/0/2]port link-type access
[LSW1-Ethernet0/0/2]port default vlan 20
[LSW1-Ethernet0/0/2]stp disable
[LSW1-Ethernet0/0/2]stp edged-port enable
[LSW1-Ethernet0/0/2]stp bpdu-filter enable
[LSW1-Ethernet0/0/2]q
LSW2
[LSW2]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW2]int e0/0/10
[LSW2-Ethernet0/0/10]port link-ty trunk 
[LSW2-Ethernet0/0/10]port trunk allow-pass vlan all
[LSW2-Ethernet0/0/10]q
[LSW2]int e0/0/20
[LSW2-Ethernet0/0/20]port link-ty trunk
[LSW2-Ethernet0/0/20]port trunk allow-pass vlan all
[LSW2-Ethernet0/0/20]q
[LSW2]stp mode mstp
[LSW2]stp region-configuration
[LSW2-mst-region]region-name Huawei
[LSW2-mst-region]instance 1 vlan 10
[LSW2-mst-region]instance 2 vlan 20
[LSW2-mst-region]active region-configuration 
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW2-mst-region]q
[LSW2]stp instance 2 root primary 
[LSW2]stp instance 1 root secondary 
[LSW2]stp en
[LSW2]int e0/0/11
[LSW2-Ethernet0/0/11]port link-type access 
[LSW2-Ethernet0/0/11]port default vlan 10
[LSW2-Ethernet0/0/11]stp disable
[LSW2-Ethernet0/0/11]stp edged-port enable 
[LSW2-Ethernet0/0/11]stp bpdu-filter enable 
[LSW2-Ethernet0/0/11]q
[LSW2]int e0/0/22
[LSW2-Ethernet0/0/22]port link-type access
[LSW2-Ethernet0/0/22]port default vlan 20
[LSW2-Ethernet0/0/22]stp disable 
[LSW2-Ethernet0/0/22]stp edged-port enable
[LSW2-Ethernet0/0/22]stp bpdu-filter enable
[LSW2-Ethernet0/0/22]q

分别查看LSW1与LSW2的STP配置
在这里插入图片描述
在这里插入图片描述
关闭E0/0/10口之后,相同VLAN的PC主机仍然可以互相连通。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值