MSTP配置实例
2024版三层交换机配置MSTP协议详解华为eNSP实验[1]
![2024版三层交换机配置MSTP协议详解华为eNSP实验[1]](https://img.taocdn.com/s3/m/30b1977f11661ed9ad51f01dc281e53a580251b9.png)
总结与展望
实验环境搭建
成功搭建华为eNSP实验环境,包括三层交换机、PC等网络设备,并正确连接物理链路。
MSTP协议配置
在三层交换机上完成MSTP协议的配置,实现VLAN的划分和跨交换机的通信。
实验结果验证
通过PC机的互通测试,验证MSTP协议配置的正确性和有效性。
实验总结
03
02
01
MSTP是IEEE 802.1s标准中定义的一种协议,是STP(Spanning Tree Protocol,生成树协议)的扩展,支持多实例生成树,可以实现不同VLAN(Virtual Local Area Network,虚拟局域网)之间的负载均衡和快速收敛。
MSTP协议特点
多实例生成树
兼容性
VLAN感知
为每个VLAN配置一个三层接口,并分配IP地址,以便实现不同VLAN之间的路由。
配置三层接口
01
02
03
配置VLAN和接口
配置MSTP域和实例
在交换机上创建一个MSTP域,并为该域分配一个唯一的域名。
配置MSTP实例
在MSTP域中创建多个MSTP实例,每个实例对应一个生成树拓扑。根据网络需求,为每个实例分配相应的VLAN。
配置MSTP优先级
设置交换机的MSTP优先级,以确定交换机在生成树拓扑中的角色(如根桥、备份根桥等)。
配置MSTP域
配置MSTP端口
将交换机上的端口配置为MSTP端口,并设置端口的路径开销、端口优先级等参数。
配置MSTP链路
在交换机之间建立MSTP链路,实现生成树拓扑的连接。根据网络需求,可以配置链路的带宽、延迟等参数。
快速收敛
MSTP协议工作原理
H3C S9500交换机VRRP+MSTP配置举例

1 特性简介VRRP(Virtual Router Redundancy Protocol,虚拟路由冗余协议)是一种容错协议。
如下图所示,通常一个网络内的所有主机都设置一条缺省路由(图中的缺省路由下一跳地址为10.100.10.1),主机发往外部网络的报文将通过缺省路由发往三层交换机Switch,从而实现了主机与外部网络的通信。
当交换机Switch发生故障时,本网段内所有以Switch为缺省路由下一跳的主机将断掉与外部的通信。
VRRP就是为解决上述问题而提出的,它为具有多播或广播能力的局域网(如以太网)设计。
VRRP将局域网的一组交换机(包括一个Master即主交换机和若干个Backup即备份交换机)组织成一个虚拟路由器,这组交换机被称为一个备份组。
虚拟的交换机拥有自己的IP地址10.100.10.1(这个IP地址可以和备份组内的某个交换机的接口地址相同),备份组内的交换机也有自己的IP地址(如Master的IP地址为10.100.10.2,Backup 的IP地址为10.100.10.3)。
局域网内的主机仅仅知道这个虚拟路由器的IP地址10.100.10.1(通常被称为备份组的虚拟IP地址),而不知道具体的Master交换机的IP地址10.100.10.2以及Backup交换机的IP地址10.100.10.3。
局域网内的主机将自己的缺省路由下一跳设置为该虚拟路由器的IP地址10.100.10.1。
于是,网络内的主机就通过这个虚拟的交换机与其它网络进行通信。
当备份组内的Master 交换机不能正常工作时,备份组内的其它Backup交换机将接替不能正常工作的Master交换机成为新的Master交换机,继续向网络内的主机提供路由服务,从而实现网络内的主机不间断地与外部网络进行通信。
2 适用版本软件版本:S9500-CMW310-R1628版本及以后升级版本(R2126及以上版本不支持)硬件版本:S9500交换机全系列硬件版本3 注意事项同一VRRP备份组多个备份的路由器之间,VRRP组握手时间必须一致,否则VRRP组状态会异常;同一VRRP备份组之间VRRP的工作方式必须相同,都为抢占模式,或者都为非抢占模式;必须在配置VRRP组之前启用vrrp ping-enable功能,否则无法ping通VRRP虚地址;VRRP监控端口只能监控VLAN接口地址,无法监控某个具体的端口;VRRP组的hello时间一般不建议修改;如果VRRP组数较多,可以考虑把各组的hello时间分别设置成2、3、5、7等互质数,减少VRRP hello报文对CPU的冲击。
mstp与vrrp配置举例

Z 端 20.0.1.10/24Z 交换机A 交换机Vlan 2:20.0.1.1/24Vlan 3:30.0.1.1/24Vlan 4:40.0.1.1/24Vlan 5:50.0.1.1/24Vlan 3:30.0.1.3/24Vlan 4:40.0.1.3/24Vlan 5:50.0.1.3/24Mstp 元素:Name:wushan Revision:2Instance 1:vlan3,5Instance 2:vlan2,4Vlan 3,5主用路由Vlan 2,4备用路由Vlan 2:20.0.1.2/24Vlan 3:30.0.1.2/24Vlan 4:40.0.1.2/24Vlan 5:50.0.1.2/24Vlan 2,4主用路由Vlan 3,5备用路由注:mstp 同一区域中,不同交换机mstp 的3大属性(名称、修订号、instance 与vlan 的映射关系)必须完全相同。
Switch A:(config)#int range g0/23-24(config-range-if)#switchport trunk encapusulation dot1q (config-range-if)#switchport allow vlan 1-6 (config-range-if)#switchport mode trunk(config)#int g0/20(config-if)#switchport trunk encapusulation dot1q (config)#switchport allow vlan 1-6 (config-if)#switchport mode trunk(config)#int g0/11(config-if)#switchport mode access (config-if)#switchport access vlan 2(config)#spanning tree mode mst(config-mst)#spanning-tree mst configuration (config-mst)#name wushan (config-mst)#revision 2(config-mst)#instance 1 vlan 3,5(config-mst)#instance 2 vlan 2,4(config)#spanning-tree mst 1 root primary#show spanning-tree mst#show spanning-tree mst 1#show spanning-tree mst 1 detail#show spanning-tree mst int g0/23路由(config)# ip routing(config)# router ospf 1(config-router)#network 10.0.1.0 0.0.0.255 area 0(config-router)# network 20.0.1.0 0.0.0.255 area 0(config-router)#network 30.0.1.0 0.0.0.255 area 0(config-router)#network 40.0.1.0 0.0.0.255 area 0(config-router)#network 50.0.1.0 0.0.0.255 area 0//(config-router)#network 60.0.1.0 0.0.0.255 area 0#show ip ospf interface#show ip ospf database#show ip ospf neighborVrrp配置(config)#int vlan 2(config-if)#vrrp 2 ip 20.0.1.50(config-if)#vrrp 1 priority 90(config-if)#vrrp 1 timer learn(config-if)#end注: 一个vrrp组只有一个主用路由,一个或多个备用路由Vrrp group-number ip x.x.x.x x.x.x.x可以使虚拟的,也可以跟路由器的物理地址。
MSTP配置实验

MSTP配置实验一、实验目的掌握MSTP的原理掌握MSTP中交换机以及端口优先级的配置二、实验设备三层交换机1台,二层交换机E126A 2台PC机3台三、拓扑图及配置说明2台E126A的24号端口互连,E126A-1的16号端口与S3610的23号端口互连,2号端口连接PC1,E126A-2的16号端口与S3610的24号端口互连,2号端口连接PC2。
PC1通过console线连接E126A-1,PC2通过console线连接E126A-2,PC3通过console线连接S3610。
四、相关知识点常用概念1.根桥(Root Bridge)桥ID最小的网桥。
其中桥ID是由网桥的优先级和网桥的MAC组成。
2.根端口(Root Port)这个端口到达根桥的路径是该端口所在网桥到达根桥的最佳路径。
全网中只有根桥是没有根端口的。
3.指定端口(Designated Port)每一个网段选择到根桥最近的网桥作为指定网桥,该网桥到这一网段的端口为指定端口。
4.可选端口(Alternate Port)既不是指定端口,也不是根端口的端口。
通过BPDU配置消息来决定端口的角色:根端口:网桥各个端口中到根桥最近的端口。
指定端口:网桥的端口发送的BPDU配置消息较接收的BPDU配置消息更优,则端口为指定端口。
可选端口:网桥的端口发送的BPDU配置消息较接收的BPDU配置消息更差,则端口为可选端口。
五、实验内容1.MSTP配置E126A-1的配置命令<H3C>system-viewSystem View: return to User View with Ctrl+Z.#开启STP生成树协议[H3C]stp enable[H3C]%Apr 2 00:04:47:485 2000 H3C MSTP/3/STPSTART:- 1 -STP is now enabled on the dev ice.[H3C]E126A-2的配置命令<H3C>system-viewSystem View: return to User View with Ctrl+Z.#开启STP生成树协议[H3C]stp enable[H3C]%Apr 2 00:04:47:485 2000 H3C MSTP/3/STPSTART:- 1 -STP is now enabled on the dev ice.[H3C]S3610的配置命令<H3C>system-viewSystem View: return to User View with Ctrl+Z.#开启STP生成树协议[H3C]stp enable[H3C]%Apr 26 12:14:58:233 2000 H3C MSTP/2/STPSTART:STP is now enabled on the device.%Apr 26 12:14:58:254 2000 H3C MSTP/2/PFWD:Instance 0's Ethernet1/0/24 has been set to forwarding state!%Apr 26 12:14:58:267 2000 H3C MSTP/2/PFWD:Instance 0's Ethernet1/0/23 has been set to forwarding state!#Apr 26 12:14:58:307 2000 H3C MSTP/1/PFWD:hwPortMstiStateForwarding: Instance 0's Port 0.9371671 has been set to forwarding state!#Apr 26 12:14:58:327 2000 H3C MSTP/1/PFWD:hwPortMstiStateForwarding: Instance 0's Port 0.9371670 has been set to forwarding state!在S3610查看STP配置信息#查看根桥配置信息[H3C]display stp rootMSTID Root Bridge ID ExtPathCost IntPathCost Root Port0 32768.000f-e251-8ba0 0 0#只显示端口状态及端口的保护类型,其它信息不显示[H3C]display stp briefMSTID Port Role STP State Protection0 Ethernet1/0/23 DESI FORWARDING NONE0 Ethernet1/0/24 DESI FORWARDING NONE在E126A-1查看STP配置信息#查看根桥信息[H3C]display stp rootMSTID Root Bridge ID ExtPathCost IntPathCost Root Port-------- -------------------- ------------ ------------- -----------0 32768.000f-e251-8ba0 200 0 Ethernet1/0/16#只显示端口状态及端口的保护类型,其它信息不显示[H3C]display stp briefMSTID Port Role STP State Protection0 Ethernet1/0/2 DESI FORWARDING NONE0 Ethernet1/0/16 ROOT FORWARDING NONE0 Ethernet1/0/24 DESI FORWARDING NONE(*) means port in aggregation group在E126A-2查看STP配置信息#查看根桥信息[H3C]display stp rootMSTID Root Bridge ID ExtPathCost IntPathCost Root Port-------- -------------------- ------------ ------------- -----------0 32768.000f-e251-8ba0 200 0 Ethernet1/0/16#只显示端口状态及端口的保护类型,其它信息不显示[H3C]display stp briefMSTID Port Role STP State Protection0 Ethernet1/0/2 DESI FORWARDING NONE0 Ethernet1/0/16 ROOT FORWARDING NONE0 Ethernet1/0/24 ALTE DISCARDING NONE(*) means port in aggregation group2.改变生成树实例0的根桥E126A-2的配置命令#指定当前设备为生成树实例0的备用根桥[H3C]stp instance 0 root secondaryS3610的配置命令#取消当前设备作为生成树实例0的根桥[H3C]undo stp instance 0 root primary#查看STP配置信息[H3C]display stp rootMSTID Root Bridge ID ExtPathCost IntPathCost Root Port0 4096.000f-e2dc-804d 200 0 Ethernet1/0/24[H3C]display stp briefMSTID Port Role STP State Protection0 Ethernet1/0/23 DESI FORWARDING NONE0 Ethernet1/0/24 ROOT FORWARDING NONEE126A-1#在E126A-1查看STP配置信息[H3C]display stp rootMSTID Root Bridge ID ExtPathCost IntPathCost Root Port-------- -------------------- ------------ ------------- -----------0 4096.000f-e2dc-804d 200 0 Ethernet1/0/24[H3C]display stp briefMSTID Port Role STP State Protection0 Ethernet1/0/2 DESI FORWARDING NONE0 Ethernet1/0/16 ALTE DISCARDING NONE0 Ethernet1/0/24 ROOT FORWARDING NONE(*) means port in aggregation groupE126A-2#在E126A-2查看STP配置信息[H3C]display stp rootMSTID Root Bridge ID ExtPathCost IntPathCost Root Port-------- -------------------- ------------ ------------- -----------0 4096.000f-e2dc-804d 0 0[H3C]display stp briefMSTID Port Role STP State Protection0 Ethernet1/0/2 DESI FORWARDING NONE0 Ethernet1/0/16 DESI FORWARDING NONE0 Ethernet1/0/24 DESI FORWARDING NONE(*) means port in aggregation group注释:用户可以将当前交换机指定为生成树实例(由参数instance instance-id确定)的根桥或备份根桥。
双核心(MSTP+VRRP)的拓扑实现和配置实例

双核心(MSTP+VRRP)的拓扑实现和配置实例1 配置VRRP在实验拓扑图中,由于有多条链路产生环路,所以我们在实验初始时一定要将某些端口堵塞(初始化时已将RG-S35B的f0/1-4四个端口堵塞,在配置完毕进行测试时才可以打开).否则产生环路后,会发现设备的cpu利用率会达到100%(使用命令show cpu查看)。
RG-S35A(config)#interface vlan 10RG-S35A(config-if)#ip address 192.168.10.254 255.255.255.0 !配置VLAN10的IP 地址RG-S35A(config-if)#standby 1 ip 192.168.10.250 !配置虚拟IPRG-S35A(config-if)#standby 1 preempt!设为抢占模式RG-S35A(config-if)#standby 1 priority 254 !VLAN10的standby优先级设为254RG-S35A(config-if)#exitRG-S35A(config)#interface vlan 20 !VLAN20的standby不设优先级,默认为100RG-S35A(config-if)#ip address 192.168.20.253 255.255.255.0 !配置VLAN20的IP 地址RG-S35A(config-if)#standby 2 ip 192.168.20.250 !配置虚拟IPRG-S35A(config-if)#standby 2 preempt !设为抢占模式RG-S35A(config-if)#exitRG-S35A(config)#interface vlan 30RG-S35A(config-if)#ip address 192.168.30.254 255.255.255.0 !配置VLAN30的IP 地址RG-S35A(config-if)#standby 3 ip 192.168.30.250 !配置虚拟IPRG-S35A(config-if)#standby 3 preempt !设为抢占模式RG-S35A(config-if)#standby 3 priority 254 !VLAN30的standby优先级设为254RG-S35A(config-if)#exitRG-S35A(config)#interface vlan 40 !VLAN20的standby不设优先级,默认为100RG-S35A(config-if)#ip address 192.168.40.253 255.255.255.0 !配置VLAN40的IP 地址RG-S35A(config-if)#standby 4 ip 192.168.40.250 !配置虚拟IPRG-S35A(config-if)#stand 4 preempt !设为抢占模式RG-S35A(config-if)#exitRG-S35A(config)#exitRG-S35B把vlan20 40 设置为standby 2、4 priority 2542 配置RG-S35A与RG-S35B的端口聚合理论上,35A和35B的f0/3和f0/4端口不需要设置为trunk口,但是我们习惯上都设为trunk(已在前面做好了配置)。
MSTP(配置指导)

(d)使用‘help’命令可以列出命令行支持的系统命令:
CLI控制界面
(e)使用‘exit’命令推出命令行
(f)使用'cd'命令可以改变当前所在的命令树的位置,同dos下的 目录操作类似,注意返回上一级只能用"cd ..
(g)使用‘ls’可以列出某个位置的子节点或者是子属性
(h)命令树可以用绝对路径表示(以$开头),也可以用相对路径 表示,提示符为当前所在的路径
•配置单板管理节点:$.ne.cfg.chss.0.
•业务配置管理节点:$.ne.cfg.service.0 •配置业务管理节点:$.ne.cfg.service.cfging.0 •生效业务管理节点:$.ne.cfg.service.valid.0 •ECC配置管理节点:$.ne.ecc.0 •告警配置管理节点:$.ne.alm.0 •性能配置管理节点:$.ne.per.0
(f)TryCommit.该接口的功能为:如果事务Try成功,则自动提交该事务。注意:如 果Try失败,则当前事务仍然处于锁定状态.
配置事务流程
配置开始
开始事务:从系统获取一个ID号 也可略个此步,在后续配置中使用 缺省事务ID=0.
配置网元:使用从BEGIN 获取的事务ID号,配置对 象包括:扩展网元、单板、 复用段、业务、CFP、告警、 性能等. 预配置事务:使系统尝试配 置,如果成功,则可以提交 配置;否则只能废弃当前配 置。 提交事务:使配置生效。
E G E F Y Y
目录
• 产品回顾 配置事务介绍 • 目录结构 • CLI控制界面 • ECC配置 • 业务开通指导 • 实验
配置事务目的 好处
(1)引入配置事务的目的: 为保证业务的安全性以及配置过程中网元与网管数据的 一致性,该系统在业务配置过程中引入了事务机制,事务为一系 列操作的集合. 通过事务机制,可以保证配置操作的批处理.即一次 事务中的任何一次失败时,都可以将配置退回到本次事务开始前 的状态.
锐捷MSTP+VRRP配置实例

交换机vrrp+mstp配置实例锐捷tac贾文宇一、组网需求1、switch a 、switch b选用两台锐捷的s5750 ;switch c 、shwich d 选用锐捷的s3750和s37602、全网共有两个业务vlan ,为vlan 10 、vlan 203、Switch a 、switch b 都分别对两vlan起用两vrrp组,实现两组的业务的负载分担和备份。
4、Switch a、switch b、switch c、switch d 都起用mstp多生成数协议,并且所有设备都属于同一个mst域,且实例映射一致(vlan 10映射实例1、vlan 20映射实例2 其他vlan映射默认实例0)。
5、Vlan 10业务以switch a为根桥;vlan 20业务以switch b为根桥;实现阻断网络环路,并能实现不同vlan数据流负载分担功能。
二、组网图三、配置步骤Switch a配置:s1#show runBuilding configuration...Current configuration : 1651 bytes!version RGNOS 10.2.00(2), Release(29287)(Tue Dec 25 20:39:14 CST 2007 -ngcf49) hostname s1co-operate enable!!!vlan 1!vlan 10!vlan 20!!no service password-encryption!spanning-tree 开启生成树(默认为mstp)spanning-tree mst configuration 进入mst配置模式revision 1 指定MST revision number 为1name region1 指定mst配置名称instance 0 vlan 1-9, 11-19, 21-4094 缺省情况下vlan都属于实例0instance 1 vlan 10 手工指定vlan10属于实例1instance 2 vlan 20 手工指定vlan20属于实例2spanning-tree mst 1 priority 0 指定实例1的优先级为0(为根桥)spanning-tree mst 2 priority 4096 指定实例2的优先级为4096interface GigabitEthernet 0/1switchport access vlan 10 配置g0/1属于vlan10!interface GigabitEthernet 0/2switchport access vlan 20 配置g0/2属于vlan 20!interface GigabitEthernet 0/3!..interface GigabitEthernet 0/24 设置g0/24为trunk接口且允许vlan10/20通过switchport mode trunkinterface VLAN 10 创建vlan 10 svi接口ip address 192.168.10.1 255.255.255.0 配置ip地址vrrp 1 priority 120 配置vrrp组1 优先级为120vrrp 1 ip 192.168.10.254 配置vrrp组1虚拟ip地址为192.168.10.254!interface VLAN 20 创建vlan 20 svi接口ip address 192.168.20.1 255.255.255.0 配置ip地址vrrp 2 ip 192.168.20.254 配置vrrp组2虚拟ip地址为192.168.20.254默认vrrp组的优先级为100默认不显示!line con 0line vty 0 4logins1#show vlanVLAN Name Status Ports---- -------------------------------- --------- ----------------------------------1 VLAN0001 STATIC Gi0/3, Gi0/4, Gi0/5, Gi0/6Gi0/7, Gi0/8, Gi0/9, Gi0/10Gi0/11, Gi0/12, Gi0/13, Gi0/14Gi0/15, Gi0/16, Gi0/17, Gi0/18Gi0/19, Gi0/20, Gi0/21, Gi0/22Gi0/23, Gi0/2410 VLAN0010 STATIC Gi0/1, Gi0/2420 VLAN0020 STATIC Gi0/2, Gi0/24Switch b配置:s2#show runBuilding configuration...Current configuration : 1607 bytes!version RGNOS 10.2.00(2), Release(27932)(Thu Dec 13 10:32:09 CST 2007 -ngcf31)hostname s2!!!vlan 1!vlan 10!vlan 20!!no service password-encryption!spanning-treespanning-tree mst configurationrevision 1name region1instance 0 vlan 1-9, 11-19, 21-4094instance 1 vlan 10instance 2 vlan 20spanning-tree mst 1 priority 4096spanning-tree mst 2 priority 0interface GigabitEthernet 0/1switchport access vlan 10!interface GigabitEthernet 0/2switchport access vlan 20!..interface GigabitEthernet 0/24switchport mode trunk!interface VLAN 10ip address 192.168.10.2 255.255.255.0vrrp 1 ip 192.168.10.254!interface VLAN 20ip address 192.168.20.2 255.255.255.0vrrp 2 priority 120vrrp 2 ip 192.168.20.254!line con 0line vty 0 4login!!ends2#show vlanVLAN Name Status Ports---- -------------------------------- --------- -----------------------------------1 VLAN0001 STATIC Gi0/3, Gi0/4, Gi0/5, Gi0/6Gi0/7, Gi0/8, Gi0/9, Gi0/10Gi0/11, Gi0/12, Gi0/13, Gi0/14Gi0/15, Gi0/16, Gi0/17, Gi0/18Gi0/19, Gi0/20, Gi0/21, Gi0/22Gi0/23, Gi0/2410 VLAN0010 STATIC Gi0/1, Gi0/2420 VLAN0020 STATIC Gi0/2, Gi0/24Switch c配置:s3#show runBuilding configuration...Current configuration : 1540 bytes!version RGNOS 10.2.00(2), Release(28794)(Fri Dec 21 09:27:15 CST 2007 -ngcf32) hostname s3!vlan 1!vlan 10!!service password-encryption!spanning-treespanning-tree mst configurationrevision 1name region1instance 0 vlan 1-9, 11-19, 21-4094instance 1 vlan 10instance 2 vlan 20spanning-tree mst 1 priority 0spanning-tree mst 2 priority 4096interface FastEthernet 0/1switchport access vlan 10!interface FastEthernet 0/2switchport access vlan 10!..interface GigabitEthernet 0/25!interface GigabitEthernet 0/26!interface GigabitEthernet 0/27!interface GigabitEthernet 0/28!interface VLAN 10ip address 192.168.10.3 255.255.255.0!ip route 0.0.0.0 0.0.0.0 192.168.10.254!!line con 0line vty 0 4loginSwitch d配置:s4#show runBuilding configuration...Current configuration : 1066 bytes!version RGNOS 10.2.00(2), Release(27932)(Thu Dec 13 10:31:41 CST 2007 -ngcf32)hostname s4!vlan 1!vlan 20!!no service password-encryption!spanning-treespanning-tree mst configurationrevision 1name region1instance 0 vlan 1-9, 11-19, 21-4094instance 1 vlan 10instance 2 vlan 20spanning-tree mst 1 priority 4096spanning-tree mst 2 priority 0interface GigabitEthernet 0/1switchport access vlan 20!interface GigabitEthernet 0/2switchport access vlan 20!..interface GigabitEthernet 0/12!interface VLAN 20ip address 192.168.20.3 255.255.255.0!!!!ip route 0.0.0.0 0.0.0.0 192.168.20.254!!line con 0line vty 0 4login!四、查看vrrp、mstp信息Switch a 信息:s1#show vrrp 查看vrrp 信息VLAN 10 - Group 1State is MasterVirtual IP address is 192.168.10.254 configured Virtual MAC address is 0000.5e00.0101 Advertisement interval is 1 secPreemption is enabledmin delay is 0 secPriority is 120Master Router is 192.168.10.1 (local), priority is 120 Master Advertisement interval is 1 secMaster Down interval is 3 secVLAN 20 - Group 2State is BackupVirtual IP address is 192.168.20.254 configured Virtual MAC address is 0000.5e00.0102 Advertisement interval is 1 secPreemption is enabledmin delay is 0 secPriority is 100Master Router is 192.168.20.2 , priority is 120 Master Advertisement interval is 1 secMaster Down interval is 3 secs1#s1#s1#s1#show spanning-tree interface gigabitEthernet 0/1 查看g0/1接口stp状态信息PortAdminPortFast : DisabledPortOperPortFast : DisabledPortAdminAutoEdge : EnabledPortOperAutoEdge : DisabledPortAdminLinkType : autoPortOperLinkType : point-to-pointPortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0PortDesignatedCost : 0PortDesignatedBridge :8000.00d0.f836.ed70PortDesignatedPort : 8001PortForwardTransitions : 6PortAdminPathCost : 200000PortOperPathCost : 200000PortRole : designatedPort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82PortDesignatedCost : 0PortDesignatedBridge :0001.00d0.f823.ef82PortDesignatedPort : 8001PortForwardTransitions : 5PortAdminPathCost : 200000PortOperPathCost : 200000PortRole : rootPort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0PortDesignatedCost : 0PortDesignatedBridge :1002.00d0.f836.ed70PortDesignatedPort : 8001PortForwardTransitions : 4PortAdminPathCost : 200000PortOperPathCost : 200000PortRole : designatedPorts1#s1#s1#show spanning-tree interface gigabitEthernet 0/2 查看g0/2接口stp状态信息PortAdminPortFast : DisabledPortOperPortFast : DisabledPortAdminAutoEdge : EnabledPortOperAutoEdge : DisabledPortAdminLinkType : autoPortOperLinkType : point-to-pointPortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0PortDesignatedCost : 0PortDesignatedBridge :8000.00d0.f836.ed70PortDesignatedPort : 8002PortForwardTransitions : 5PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : designatedPort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82PortDesignatedCost : 0PortDesignatedBridge :0001.00d0.f836.ed70PortDesignatedPort : 8002PortForwardTransitions : 4PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : designatedPort###### MST 2 vlans mapped :20PortState : discardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0PortDesignatedCost : 0PortDesignatedBridge :0002.00d0.f8d7.ae12PortDesignatedPort : 8002PortForwardTransitions : 3PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : alternatePorts1#s1#s1#show spanning-tree interface gigabitEthernet 0/24 g0/24接口stp状态信息PortAdminPortFast : DisabledPortOperPortFast : DisabledPortAdminAutoEdge : EnabledPortOperAutoEdge : DisabledPortAdminLinkType : autoPortOperLinkType : point-to-pointPortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0PortDesignatedCost : 0PortDesignatedBridge :8000.001a.a909.8fe0PortDesignatedPort : 8018PortForwardTransitions : 5PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : rootPort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82PortDesignatedCost : 0PortDesignatedBridge :0001.00d0.f836.ed70PortDesignatedPort : 8018PortForwardTransitions : 5PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : designatedPort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0PortDesignatedBridge :0002.001a.a909.8fe0 PortDesignatedPort : 8018 PortForwardTransitions : 4PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : rootPorts1#Switch b 信息:s2#show vrrpVLAN 10 - Group 1State is BackupVirtual IP address is 192.168.10.254 configured Virtual MAC address is 0000.5e00.0101 Advertisement interval is 1 secPreemption is enabledmin delay is 0 secPriority is 100Master Router is 192.168.10.1 , priority is 120 Master Advertisement interval is 1 secMaster Down interval is 3 secVLAN 20 - Group 2State is MasterVirtual IP address is 192.168.20.254 configured Virtual MAC address is 0000.5e00.0102 Advertisement interval is 1 secPreemption is enabledmin delay is 0 secPriority is 120Master Router is 192.168.20.2 (local), priority is 120 Master Advertisement interval is 1 secMaster Down interval is 3 secs2#s2#s2#s2#s2#s2#s2#show spanning-tree interface gigabitEthernet 0/1 PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : autoPortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :8000.001a.a909.8fe0 PortDesignatedPort : 8001 PortForwardTransitions : 1 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : designatedPort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0 PortDesignatedBridge :0001.00d0.f823.ef82 PortDesignatedPort : 8002 PortForwardTransitions : 2 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : rootPort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0PortDesignatedBridge :0002.001a.a909.8fe0 PortDesignatedPort : 8001 PortForwardTransitions : 1 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : designatedPorts2#s2#s2#s2#show spanning-tree interface gigabitEthernet 0/2 PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : autoPortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :8000.001a.a909.8fe0 PortDesignatedPort : 8002 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : designatedPort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0 PortDesignatedBridge :1001.001a.a909.8fe0 PortDesignatedPort : 8002 PortForwardTransitions : 2 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : designatedPort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0PortDesignatedBridge :0002.001a.a909.8fe0 PortDesignatedPort : 8002 PortForwardTransitions : 1PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : designatedPorts2#s2#s2#s2#s2#show spanning-tree interface gigabitEthernet 0/24 PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : autoPortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0PortDesignatedBridge :8000.001a.a909.8fe0 PortDesignatedPort : 8018 PortForwardTransitions : 1PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : designatedPort###### MST 1 vlans mapped :10PortState : discardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0PortDesignatedBridge :0001.00d0.f836.ed70PortDesignatedPort : 8018 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : alternatePort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :0002.001a.a909.8fe0 PortDesignatedPort : 8018 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : designatedPorts2#Switch c 信息:s3#show spanning-tree interface fastEthernet 0/1 PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : auto PortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : discardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :8000.00d0.f836.ed70 PortDesignatedPort : 8001 PortForwardTransitions : 1 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : alternatePort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0 PortDesignatedBridge :0001.00d0.f823.ef82 PortDesignatedPort : 8001 PortForwardTransitions : 1 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : designatedPort###### MST 2 vlans mapped :20PortState : discardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :1002.00d0.f836.ed70 PortDesignatedPort : 8001 PortForwardTransitions : 0 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : alternatePorts3#s3#s3#s3#s3#show spanning-tree interface fastEthernet 0/2 PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : auto PortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0PortDesignatedBridge :8000.001a.a909.8fe0 PortDesignatedPort : 8001 PortForwardTransitions : 1 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : rootPort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0 PortDesignatedBridge :0001.00d0.f823.ef82 PortDesignatedPort : 8002 PortForwardTransitions : 2 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : designatedPort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :0002.001a.a909.8fe0 PortDesignatedPort : 8001 PortForwardTransitions : 1 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : rootPorts3#Switch d 信息:s4#show spanning-tree interface gigabitEthernet 0/1 PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : autoPortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :8000.001a.a909.8fe0 PortDesignatedPort : 8002 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : rootPort###### MST 1 vlans mapped :10PortState : discardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0 PortDesignatedBridge :1001.001a.a909.8fe0 PortDesignatedPort : 8002 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : alternatePort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :0002.001a.a909.8fe0 PortDesignatedPort : 8002 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : rootPorts4#s4#s4#s4#show spanning-tree interface gigabitEthernet 0/2 PortAdminPortFast : Disabled PortOperPortFast : DisabledPortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : auto PortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : discardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :8000.00d0.f836.ed70 PortDesignatedPort : 8002 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : alternatePort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0 PortDesignatedBridge :0001.00d0.f836.ed70 PortDesignatedPort : 8002 PortForwardTransitions : 2 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : rootPort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :0002.00d0.f8d7.ae12 PortDesignatedPort : 8002 PortForwardTransitions : 2 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : designatedPorts4#FAQ:1.1 RSTP和MSTP配合为什么有问题1.1.1 原因分析由于RSTP/MSTP的指定端口快速迁移机制,即接收到下游的agreement报文才能进行快速迁移。
MSTP多实例的配置

MSTP多实例的配置MSTP多实例的配置这次实验主要是为了加强对stp⽣成树协议中,RP(根端⼝),DP(指定端⼝),AP(阻塞端⼝)的判断⽅法;虽然很多时候不需要我们⼈⼯判断,因为当我们吧所有的配置好之后,然后开启⽣成树协议,电脑会⾃动进⾏判断:⽽我们现在需要对其原理进⾏详细的了解:⼀、我们先对各种端⼝进⾏简介根端⼝(RP):⾮根交换机去往根桥路径最优的端⼝,根端⼝不可能存在在跟桥上;⾮根桥上只能存在⼀个根端⼝;根端⼝选举:按照下⾯的条件进⾏⽐较:设置的优先级(默认优先级都是32768)越⼩越好——>根路径开销RPC:——>路径上所有出端⼝开销的总和;越⼩越好;——>对端BID对端PID(选择⼩的) ;——>本端PID;根端⼝都是接收最优BPDU指定端⼝(DP):交换机向所连⽹段转发BPDU的端⼝每个⽹络有且只有⼀个指定端⼝;但每个交换机上可以有⼏个指定端⼝;指定端⼝选举:设置的优先级——>根路径开销RPC——> 本端的BID ——>本端的PID;指定端⼝是发送最优BPDU;预备端⼝(AP):预备端⼝将被阻塞,虽然不能转发⽤户数据帧,但是可以接收并处理STP协议帧;根桥选举:桥ID=桥优先级+MAC地址(BID)越⼩越优PID=端⼝优先级+端⼝号端⼝开销BPDU:⽹桥协议数据单元:BPDU类型:a.配置BPDU包含了桥ID 路径开销端⼝ID等参数b.TCN BPDU 是指下游交换机感知到拓扑发⽣变化时向上游发送的拓扑的变化通知配置BPDU信息:a.根桥ID:由根桥的优先级和MAC地址组成b.根路径开销:到根桥的最短路径开销c.指定桥ID:指定桥的优先级和MAC地址组成d.指定端⼝ID:由指定端⼝的优先级和端⼝号组成STP定时器:message age:配置BPDU在⽹络中传播的⽣存期max age:配置BPDU在设备中能够保存的最⼤⽣存期(20s)hello time:配置BPDU发送的周期forward delay 端⼝状态迁移的延时实验过程:其实这⼀章并没有那么多问题来探究;所以我也没有发现有什么坑可以去跳。
MSTP配置实验

SW1#show spanning-tree mst
##### MST0 vlans mapped: 1-9,14-4094
Bridge address a0f0.34f4.f180 priority 0 (0 sysid 0)
Root this switch for the CIST
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interface Role Sts Cost Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Root ID Priority 8193
Address a0f0.34f4.f180
This brห้องสมุดไป่ตู้dge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 0 (priority 0 sys-id-ext 0)
Address a0f0.34f4.f180
SW2(config-mst)#name ke
SW2(config-mst)#revision 1
SW2(config-mst)#instance 1 vlan 10,12
SW2(config-mst)#instance 2 vlan 11,13
SW2(config)#spanning-tree mst 0 priority 4096
校园网双核心(MSTP+VRRP)的拓扑实现和配置实例

双核心配置实例(一)cont.
RG-S35A(config)#spanning-tree mst 1 priority 4096
!实例1在35A的优先级为4096
RG-S35A(config)#spanning-tree mst 2 priority 8192
!实例2在35A的优先级为8192
配置较高优先级是为了使35A被选作mst 1的根节点。一 方面是因为它的性能比21强,防止21被选做根节点;更 重要的是,如果默认优先级更高的为35B,则vlan10、 30也会通过35B传输,与我们的期望结果相违背,产生 冲突。
MSTP技术概述(cont.)
交换机A、B 在vlan1 内,交换机C、D 在vlan2 内,连成环路。
A vlan1 C vlan2
vlan1 B D
vlan2
MSTP技术概述(cont.)
若采用STP或RSTP,在某种配置下,会把交换机A和B 间的链路给discarding。
A vlan1 C vlan2
OA服务器 服务器VLAN 服务器 视频会议VLAN 视频会议 交换机管理VLAN 交换机管理 互连网段VLAN 互连网段
双核心配置实例(二)cont.
生成树协议管理
表二、 表二、 设备优先级列表 设备 主核心交换机 备核心交换机 接入交换机 优先级 4096 8192 默认32768 默认
双核心配置实例(二)cont.
接入交换机 RG-S2150G
双核心配置实例(二)cont.
VLAN规划
根据支行的网络应用情况,针对不同的业务系统进行VLAN部 署整理,如下表:
表一
用途 生产用户VLAN 生产用户 OA用户 用户VLAN 用户
MSTP区域与实例

课程议题MSTP区域与实例多生成树协议(MSTP)多生成树协议MSTPVLAN101-200VLAN1-100VLAN1-100VLAN101-200多生成树实例Instance:一台交换机的一个或多个Vlan的集合因为很多Vlan采用一个Vlan实例,可实现预期的负载均衡交换机只运行二个实例,减少交换机系统的资源实例1实例2Instance2Instance1MST region:有着相同instance 配置的交换机组成的域,运行独立的生成树(IST,internal spanning-tree)▪MST region的划分➢MST配置名称(name):最长可用32 个字节长的字符串来标识MSTP region。
➢MST revision number:用一个16bit 长的修正值来标识MSTP region。
➢MST instance—vlan 的对应表:每台交换机都最多可以新增64 个instance,instance 0 是强制存在的,用户还可以按需要分配1-4094 个vlan 属于不同的instance(0-64),未分配的vlan 缺省就属于instance 0➢Instance 0 所对应的生成树称之为CIST(Common Instance Spanning Tree)▪同一个MST区域的交换机的以上配置属性必须相同▪在MSTP网络中,会形成很多的生成树,包括MSTI生成树、IST、CIST、CST。
➢MSTI生成树:每个Instance中的生成树叫做MSTI(Multiple Spanning-Tree Instance)生成树。
➢IST:IST(Internal Spanning Tree)是MST区域内的一个生成树。
IST实例使用编号0。
IST使整个MST区域从外部上看就像一个虚拟的网桥。
➢CST:CST(Common Spanning Tree)是连接交换网络内部的所有MST区域的一个生成树。
思科交换机+vrrp+mstp配置实例

交换机vrrp加mstp配置实例一、组网需求1、switch a 、switch b选用两台锐捷的s5750 ;switch c 、shwich d 选用锐捷的s3750和s37602、全网共有两个业务vlan ,为vlan 10 、vlan 203、Switch a 、switch b 都分别对两vlan起用两vrrp组,实现两组的业务的负载分担和备份。
4、Switch a、switch b、switch c、switch d 都起用mstp多生成数协议,并且所有设备都属于同一个mst域,且实例映射一致(vlan 10映射实例1、vlan 20映射实例2 其他vlan映射默认实例0)。
5、Vlan 10业务以switch a为根桥;vlan 20业务以switch b为根桥;实现阻断网络环路,并能实现不同vlan数据流负载分担功能。
二、组网图三、配置步骤Switch a配置:s1#show runBuilding configuration...Current configuration : 1651 bytes!version RGNOS 10.2.00(2), Release(29287)(Tue Dec 25 20:39:14 CST 2007 -ngcf49) hostname s1co-operate enable!!!vlan 1!vlan 10!vlan 20!!no service password-encryption!spanning-tree 开启生成树(默认为mstp)spanning-tree mst configuration 进入mst配置模式revision 1 指定MST revision number 为1name region1 指定mst配置名称instance 0 vlan 1-9, 11-19, 21-4094 缺省情况下vlan都属于实例0instance 1 vlan 10 手工指定vlan10属于实例1instance 2 vlan 20 手工指定vlan20属于实例2spanning-tree mst 1 priority 0 指定实例1的优先级为0(为根桥)spanning-tree mst 2 priority 4096 指定实例2的优先级为4096interface GigabitEthernet 0/1switchport access vlan 10 配置g0/1属于vlan10!interface GigabitEthernet 0/2switchport access vlan 20 配置g0/2属于vlan 20!interface GigabitEthernet 0/3!..interface GigabitEthernet 0/24 设置g0/24为trunk接口且允许vlan10/20通过switchport mode trunk!interface VLAN 10 创建vlan 10 svi接口ip address 192.168.10.1 255.255.255.0 配置ip地址vrrp 1 priority 120 配置vrrp组1 优先级为120vrrp 1 ip 192.168.10.254 配置vrrp组1虚拟ip地址为192.168.10.254!interface VLAN 20 创建vlan 20 svi接口ip address 192.168.20.1 255.255.255.0 配置ip地址vrrp 2 ip 192.168.20.254 配置vrrp组2虚拟ip地址为192.168.20.254默认vrrp组的优先级为100默认不显示!line con 0line vty 0 4logins1#show vlanVLAN Name Status Ports---- -------------------------------- --------- ----------------------------------1 VLAN0001 STATIC Gi0/3, Gi0/4, Gi0/5, Gi0/6Gi0/7, Gi0/8, Gi0/9, Gi0/10Gi0/11, Gi0/12, Gi0/13, Gi0/14Gi0/15, Gi0/16, Gi0/17, Gi0/18Gi0/19, Gi0/20, Gi0/21, Gi0/22Gi0/23, Gi0/2410 VLAN0010 STATIC Gi0/1, Gi0/2420 VLAN0020 STATIC Gi0/2, Gi0/24Switch b配置:s2#show runBuilding configuration...Current configuration : 1607 bytes!version RGNOS 10.2.00(2), Release(27932)(Thu Dec 13 10:32:09 CST 2007 -ngcf31) hostname s2!!!vlan 1!vlan 10!vlan 20!!no service password-encryption!spanning-treespanning-tree mst configurationrevision 1name region1instance 0 vlan 1-9, 11-19, 21-4094instance 1 vlan 10instance 2 vlan 20spanning-tree mst 1 priority 4096spanning-tree mst 2 priority 0interface GigabitEthernet 0/1switchport access vlan 10!interface GigabitEthernet 0/2switchport access vlan 20!..interface GigabitEthernet 0/24switchport mode trunk!interface VLAN 10ip address 192.168.10.2 255.255.255.0vrrp 1 ip 192.168.10.254!interface VLAN 20ip address 192.168.20.2 255.255.255.0vrrp 2 priority 120vrrp 2 ip 192.168.20.254!line con 0line vty 0 4login!!ends2#show vlanVLAN Name Status Ports---- -------------------------------- --------- -----------------------------------1 VLAN0001 STATIC Gi0/3, Gi0/4, Gi0/5, Gi0/6Gi0/7, Gi0/8, Gi0/9, Gi0/10Gi0/11, Gi0/12, Gi0/13, Gi0/14Gi0/15, Gi0/16, Gi0/17, Gi0/18Gi0/19, Gi0/20, Gi0/21, Gi0/22Gi0/23, Gi0/2410 VLAN0010 STATIC Gi0/1, Gi0/2420 VLAN0020 STATIC Gi0/2, Gi0/24Switch c配置:s3#show runBuilding configuration...Current configuration : 1540 bytes!version RGNOS 10.2.00(2), Release(28794)(Fri Dec 21 09:27:15 CST 2007 -ngcf32) hostname s3!vlan 1!vlan 10!!service password-encryption!spanning-treespanning-tree mst configurationrevision 1name region1instance 0 vlan 1-9, 11-19, 21-4094instance 1 vlan 10instance 2 vlan 20spanning-tree mst 1 priority 0spanning-tree mst 2 priority 4096interface FastEthernet 0/1switchport access vlan 10!interface FastEthernet 0/2switchport access vlan 10!..interface GigabitEthernet 0/25!interface GigabitEthernet 0/26!interface GigabitEthernet 0/27!interface GigabitEthernet 0/28!interface VLAN 10ip address 192.168.10.3 255.255.255.0!ip route 0.0.0.0 0.0.0.0 192.168.10.254!!line con 0line vty 0 4loginSwitch d配置:s4#show runBuilding configuration...Current configuration : 1066 bytes!version RGNOS 10.2.00(2), Release(27932)(Thu Dec 13 10:31:41 CST 2007 -ngcf32) hostname s4!vlan 1!vlan 20!!no service password-encryption!spanning-treespanning-tree mst configurationrevision 1name region1instance 0 vlan 1-9, 11-19, 21-4094instance 1 vlan 10instance 2 vlan 20spanning-tree mst 1 priority 4096spanning-tree mst 2 priority 0interface GigabitEthernet 0/1switchport access vlan 20!interface GigabitEthernet 0/2switchport access vlan 20!..interface GigabitEthernet 0/12!interface VLAN 20ip address 192.168.20.3 255.255.255.0!!!!ip route 0.0.0.0 0.0.0.0 192.168.20.254!!line con 0line vty 0 4login!四、查看vrrp、mstp信息Switch a 信息:s1#show vrrp 查看vrrp 信息VLAN 10 - Group 1State is MasterVirtual IP address is 192.168.10.254 configuredVirtual MAC address is 0000.5e00.0101Advertisement interval is 1 secPreemption is enabledmin delay is 0 secPriority is 120Master Router is 192.168.10.1 (local), priority is 120Master Advertisement interval is 1 secMaster Down interval is 3 secVLAN 20 - Group 2State is BackupVirtual IP address is 192.168.20.254 configuredVirtual MAC address is 0000.5e00.0102Advertisement interval is 1 secPreemption is enabledmin delay is 0 secPriority is 100Master Router is 192.168.20.2 , priority is 120Master Advertisement interval is 1 secMaster Down interval is 3 secs1#s1#s1#s1#show spanning-tree interface gigabitEthernet 0/1 查看g0/1接口stp状态信息PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : auto PortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :8000.00d0.f836.ed70 PortDesignatedPort : 8001 PortForwardTransitions : 6 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : designatedPort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0 PortDesignatedBridge :0001.00d0.f823.ef82 PortDesignatedPort : 8001 PortForwardTransitions : 5 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : rootPort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :1002.00d0.f836.ed70 PortDesignatedPort : 8001 PortForwardTransitions : 4 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : designatedPorts1#s1#s1#show spanning-tree interface gigabitEthernet 0/2 查看g0/2接口stp状态信息PortAdminPortFast : DisabledPortOperPortFast : DisabledPortAdminAutoEdge : EnabledPortOperAutoEdge : DisabledPortAdminLinkType : autoPortOperLinkType : point-to-pointPortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0PortDesignatedCost : 0PortDesignatedBridge :8000.00d0.f836.ed70PortDesignatedPort : 8002PortForwardTransitions : 5PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : designatedPort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82PortDesignatedCost : 0PortDesignatedBridge :0001.00d0.f836.ed70PortDesignatedPort : 8002PortForwardTransitions : 4PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : designatedPort###### MST 2 vlans mapped :20PortState : discardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0PortDesignatedCost : 0PortDesignatedBridge :0002.00d0.f8d7.ae12PortDesignatedPort : 8002PortForwardTransitions : 3PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : alternatePorts1#s1#s1#show spanning-tree interface gigabitEthernet 0/24 g0/24接口stp状态信息PortAdminPortFast : DisabledPortOperPortFast : DisabledPortAdminAutoEdge : EnabledPortOperAutoEdge : DisabledPortAdminLinkType : autoPortOperLinkType : point-to-pointPortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0PortDesignatedCost : 0PortDesignatedBridge :8000.001a.a909.8fe0PortDesignatedPort : 8018PortForwardTransitions : 5PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : rootPort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82PortDesignatedCost : 0PortDesignatedBridge :0001.00d0.f836.ed70PortDesignatedPort : 8018PortForwardTransitions : 5PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : designatedPort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0PortDesignatedBridge :0002.001a.a909.8fe0 PortDesignatedPort : 8018 PortForwardTransitions : 4PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : rootPorts1#Switch b 信息:s2#show vrrpVLAN 10 - Group 1State is BackupVirtual IP address is 192.168.10.254 configured Virtual MAC address is 0000.5e00.0101 Advertisement interval is 1 secPreemption is enabledmin delay is 0 secPriority is 100Master Router is 192.168.10.1 , priority is 120 Master Advertisement interval is 1 secMaster Down interval is 3 secVLAN 20 - Group 2State is MasterVirtual IP address is 192.168.20.254 configured Virtual MAC address is 0000.5e00.0102 Advertisement interval is 1 secPreemption is enabledmin delay is 0 secPriority is 120Master Router is 192.168.20.2 (local), priority is 120 Master Advertisement interval is 1 secMaster Down interval is 3 secs2#s2#s2#s2#s2#s2#s2#show spanning-tree interface gigabitEthernet 0/1PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : auto PortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :8000.001a.a909.8fe0 PortDesignatedPort : 8001 PortForwardTransitions : 1 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : designatedPort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0 PortDesignatedBridge :0001.00d0.f823.ef82 PortDesignatedPort : 8002 PortForwardTransitions : 2 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : rootPort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :0002.001a.a909.8fe0 PortDesignatedPort : 8001 PortForwardTransitions : 1 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : designatedPorts2#s2#s2#s2#show spanning-tree interface gigabitEthernet 0/2 PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : autoPortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :8000.001a.a909.8fe0 PortDesignatedPort : 8002 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : designatedPort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0 PortDesignatedBridge :1001.001a.a909.8fe0 PortDesignatedPort : 8002 PortForwardTransitions : 2 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : designatedPort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0PortDesignatedBridge :0002.001a.a909.8fe0 PortDesignatedPort : 8002 PortForwardTransitions : 1PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : designatedPorts2#s2#s2#s2#s2#show spanning-tree interface gigabitEthernet 0/24 PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : autoPortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0PortDesignatedBridge :8000.001a.a909.8fe0 PortDesignatedPort : 8018 PortForwardTransitions : 1PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : designatedPort###### MST 1 vlans mapped :10PortState : discardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0PortDesignatedBridge :0001.00d0.f836.ed70 PortDesignatedPort : 8018 PortForwardTransitions : 1PortAdminPathCost : 20000PortOperPathCost : 20000PortRole : alternatePort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :0002.001a.a909.8fe0 PortDesignatedPort : 8018 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : designatedPorts2#Switch c 信息:s3#show spanning-tree interface fastEthernet 0/1 PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : auto PortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : discardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :8000.00d0.f836.ed70 PortDesignatedPort : 8001 PortForwardTransitions : 1 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : alternatePort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82PortDesignatedCost : 0 PortDesignatedBridge :0001.00d0.f823.ef82 PortDesignatedPort : 8001 PortForwardTransitions : 1 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : designatedPort###### MST 2 vlans mapped :20PortState : discardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :1002.00d0.f836.ed70 PortDesignatedPort : 8001 PortForwardTransitions : 0 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : alternatePorts3#s3#s3#s3#s3#show spanning-tree interface fastEthernet 0/2 PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : auto PortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :8000.001a.a909.8fe0 PortDesignatedPort : 8001 PortForwardTransitions : 1 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : rootPort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0 PortDesignatedBridge :0001.00d0.f823.ef82 PortDesignatedPort : 8002 PortForwardTransitions : 2 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : designatedPort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :0002.001a.a909.8fe0 PortDesignatedPort : 8001 PortForwardTransitions : 1 PortAdminPathCost : 200000 PortOperPathCost : 200000PortRole : rootPorts3#Switch d 信息:s4#show spanning-tree interface gigabitEthernet 0/1 PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : autoPortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : forwardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :8000.001a.a909.8fe0 PortDesignatedPort : 8002 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : rootPort###### MST 1 vlans mapped :10PortState : discardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0 PortDesignatedBridge :1001.001a.a909.8fe0 PortDesignatedPort : 8002 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : alternatePort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :0002.001a.a909.8fe0 PortDesignatedPort : 8002 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : rootPorts4#s4#s4#s4#show spanning-tree interface gigabitEthernet 0/2 PortAdminPortFast : Disabled PortOperPortFast : Disabled PortAdminAutoEdge : Enabled PortOperAutoEdge : Disabled PortAdminLinkType : autoPortOperLinkType : point-to-point PortBPDUGuard : DisabledPortBPDUFilter : Disabled###### MST 0 vlans mapped :1-9, 11-19, 21-4094 PortState : discardingPortPriority : 128PortDesignatedRoot : 8000.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :8000.00d0.f836.ed70 PortDesignatedPort : 8002 PortForwardTransitions : 1 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : alternatePort###### MST 1 vlans mapped :10PortState : forwardingPortPriority : 128PortDesignatedRoot : 0001.00d0.f823.ef82 PortDesignatedCost : 0 PortDesignatedBridge :0001.00d0.f836.ed70 PortDesignatedPort : 8002 PortForwardTransitions : 2 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : rootPort###### MST 2 vlans mapped :20PortState : forwardingPortPriority : 128PortDesignatedRoot : 0002.001a.a909.8fe0 PortDesignatedCost : 0 PortDesignatedBridge :0002.00d0.f8d7.ae12 PortDesignatedPort : 8002 PortForwardTransitions : 2 PortAdminPathCost : 20000 PortOperPathCost : 20000PortRole : designatedPorts4#FAQ:1.1 RSTP和MSTP配合为什么有问题1.1.1 原因分析由于RSTP/MSTP的指定端口快速迁移机制,即接收到下游的agreement报文才能进行快速迁移。
多生成树mstp负载均衡配置

多生成树mstp负载均衡配置实例实验的要求:默认情况下,vlan 10走f0/20,vlan 20走f0/21,当某一条链路出故障时,mstp生效,通信能够依赖链路状态良好的线路进行。
Sw1:sw1#show running-configBuilding configuration...Current configuration : 1473 bytes!version 12.1no service padservice timestamps debug uptimeservice timestamps log uptimeno service password-encryption!hostname sw1!ip subnet-zero!spanning-tree mode mst//开启多生成树no spanning-tree optimize bpdu transmissionspanning-tree extend system-id!spanning-tree mst configuration//进入多生成树配置界面name ccit//名称为ccit,可以不配revision 1//版次为1,可以不配instance 1 vlan 10//创建实例1对应vlan 10 instance 2 vlan 20//创建实例2对应vlan 20 !interface FastEthernet0/1!interface FastEthernet0/2!interface FastEthernet0/3!interface FastEthernet0/4!interface FastEthernet0/5!interface FastEthernet0/6!interface FastEthernet0/7!interface FastEthernet0/8!interface FastEthernet0/9!interface FastEthernet0/10!interface FastEthernet0/11!interface FastEthernet0/12!interface FastEthernet0/13!interface FastEthernet0/14!interface FastEthernet0/15!interface FastEthernet0/16!interface FastEthernet0/17!interface FastEthernet0/18!interface FastEthernet0/19!interface FastEthernet0/20switchport mode trunk//接口模式为trunk!interface FastEthernet0/21 switchport mode trunk!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24 switchport mode trunk!interface GigabitEthernet0/1!interface GigabitEthernet0/2!interface Vlan1noip addressnoip route-cacheshutdown!ip http server!line con 0speed 115200linevty 5 15!!endsw1#Sw2:sw2--->sw1--->r1sw2#show running-configBuilding configuration...Current configuration : 2296 bytes !version 12.1no service padservice timestamps debug uptime service timestamps log uptimeno service password-encryptionhostname sw2!!ip subnet-zero!!!spanning-tree mode mstno spanning-tree optimize bpdu transmissionspanning-tree extend system-id!spanning-treemst configurationnameccitrevision 1instance 1 vlan 10instance 2 vlan 20!spanning-tree mst 1-2 priority 4096//指定此交换机为vlan 10 和vlan 20的根桥!interface FastEthernet0/1//把接口划分到不同的vlan中,下同switchport access vlan 10switchport mode acce ss!interface FastEthernet0/2switchport access vlan 10switchport mode access!interface FastEthernet0/3switchport access vlan 10switchport mode access!interface FastEthernet0/4switchport access vlan 10switchport mode access!interface FastEthernet0/5switchport access vlan 10switchport mode access!interface FastEthernet0/6switchport access vlan 10switchport mode accessinterface FastEthernet0/7 switchport access vlan 10 switchport mode access!interface FastEthernet0/8 switchport access vlan 10 switchport mode access!interface FastEthernet0/9 switchport access vlan 20 switchport mode access!interface FastEthernet0/10 switchport access vlan 20 switchport mode access!interface FastEthernet0/11 switchport access vlan 20 switchport mode access!interface FastEthernet0/12 switchport access vlan 20 switchport mode access!interface FastEthernet0/13 switchport access vlan 20 switchport mode access!interface FastEthernet0/14 switchport access vlan 20 switchport mode access!interface FastEthernet0/15 switchport access vlan 20 switchport mode access!interface FastEthernet0/16 switchport access vlan 20 switchport mode access!interface FastEthernet0/17 !interface FastEthernet0/18interface FastEthernet0/19!interface FastEthernet0/20//配置多生成树mstp的负载均衡,定义vlan 10 和vlan 20 的优先级,vlan 10优先级高,端口f0/20默认走vlan 10 switchport mode trunkspanning-treemst 1 port-priority 16spanning-treemst 2 port-priority 224!interface FastEthernet0/21//配置多生成树mstp的负载均衡,定义vlan 10 和vlan 20 的优先级,vlan20优先级高,端口f0/21默认走vlan20switchport mode trunkspanning-treemst 1 port-priority 224spanning-treemst 2 port-priority 16!interface FastEthernet0/22!interface FastEthernet0/23!interface FastEthernet0/24!interface GigabitEthernet0/1!interface GigabitEthernet0/2!interface Vlan1noip addressnoip route-cacheshutdown!ip http server!line con 0speed 115200linevty 5 15!!endsw2#R1:Building configuration...Current configuration : 842 bytes!version 12.3service timestamps debug datetimemsecservice timestamps log datetimemsecno service password-encryption!hostname Router!boot-start-markerboot-end-marker!no network-clock-participate slot 1no network-clock-participate wic 0noaaa new-modelip subnet-zeroipcef!no ftp-server write-enable!interface FastEthernet0/0noip addressduplex autospeed auto!interface FastEthernet0/0.10//进入子接口,做VLAN的单臂路由encapsulation dot1Q 10//封装dot1Q 10,也就是vlan 10的意思ip address 192.168.11.1 255.255.255.0添加vlan 10的ip地址!interface FastEthernet0/0.20encapsulation dot1Q 20ip address 192.168.20.1 255.255.255.0!interface Serial0/0noip addressshutdown!interface FastEthernet0/1noip addressshutdownduplex autospeed auto!interface Serial0/1noip addressshutdown!ip classlessnoip http server!!line con 0line aux 0linevty 0 4!endRouter#测试方法:在交换机SW2上的1端口和9端口各接一台PC机,PC1一直ping vlan 10的网关(ping 192.168.11.1–t),PC2一直ping vlan20的网关(ping192.168.20.1–t),断掉两交换机间的连线f0/20或者f0/21,观察两PC机PING连接的返回值。
VRRP+MSTP详解

vrrp+mstp配置实例1.switch a 、switch b选用两台锐捷的s5750 ;switch c 、shwich d 选2.用锐捷的s3750和s37603.全网共有两个业务vlan ,为vlan 10 、vlan 204.Switch a 、switch b 都分别对两vlan起用两vrrp组,实现两组的业务的负载分担和备份。
5.Switch a、switch b、switch c、switch d 都起用mstp多生成数协议,并且所有设备都属于同一个mst域,且实例映射一致(vlan 10映射实例1、vlan 20映射实例2 其他vlan映射默认实例0)。
6.Vlan 10业务以switch a为根桥;vlan 20业务以switch b为根桥;实现阻断网络环路,并能实现不同vlan数据流负载分担功能。
SW A与SW B配置基本相同第一步:开启生成树MSTP协议第二步:进入生成树配置模式,定义实例,修订号(不理解就当学号),名称(相当于学生名字)第三步:指定实例的优先级第四步:为不同的VLAN划分地址,而且对VLAN的优先级进行设置,以及转换虚拟路由地址SW C 与SW D 配置第一步:开启生成树MSTP协议第二步:进入生成树配置模式,定义实例,修订号(不理解就当学号),名称(相当于学生名字)第三步:指定实例的优先级部分命令如下生成树类spanning-tree 开启生成树(默认为mstp)spanning-tree mst configuration 进入mst配置模式revision 1 指定MST revision number 为1name region1 指定mst配置名称instance 0 vlan 1-9, 11-19, 21-4094 缺省情况下vlan都属于实例0instance 1 vlan 10 手工指定vlan10属于实例1instance 2 vlan 20 手工指定vlan20属于实例2spanning-tree mst 1 priority 0 指定实例1的优先级为0(为根桥)spanning-tree mst 2 priority 4096 指定实例2的优先级为4096VLAN优先级类及转换的IP地址interface VLAN 10 创建vlan 10 svi接口ip address 192.168.10.1 255.255.255.0 配置ip地址vrrp 1 priority 120 配置vrrp组1 优先级为120vrrp 1 ip 192.168.10.254 配置vrrp组1虚拟ip地址为192.168.10.254查看信息show vrrp 查看vrrp 信息show spanning-tree interface gigabitEthernet 0/1 查看g0/1接口stp状态信息链路聚合第一步:F0/23 、F0/24 加入Port-group 1inter range fa 0/23 -24port-group 1第二步:将AG1设为Trunkinter aggregateport 1switchport mode trunk。
mstp配置实例

mstp配置实例mstp配置过程配置mstp是为了实现链路冗余和备份并且消除环路mstp配置过程#stp enable 开启stpstp mode mstp 开启mstpSW1stp region-configuration 进入stp域视图region-name KH_2 配置域名revision-level 1 配置域等级instance 1 vlan 30 将vlan加入实例(达到负载分担)instance 2 vlan 40active region-configuration 开启此域视图stp instance 1 root primary 配置实例主根桥和备用根桥(primary主根桥;secondary备用根桥)stp instance 2 root secondarySW2stp region-configuration 进入stp域视图region-name KH_2 配置域名revision-level 1 配置域等级instance 1 vlan 30 将vlan加入实例(达到负载分担)instance 2 vlan 40active region-configuration 开启此域视图stp instance 1 root secondary 配置实例主根桥和备用根桥(primary主根桥;secondary备用根桥)stp instance 2 root primarySW3stp region-configuration 进入stp域视图region-name KH_2 配置域名revision-level 1 配置域等级instance 1 vlan 30 将vlan加入实例(达到负载分担)instance 2 vlan 40active region-configurationSW4stp region-configuration 进入stp域视图region-name KH_2 配置域名revision-level 1 配置域等级instance 1 vlan 30 将vlan加入实例(达到负载分担)instance 2 vlan 40active region-configuration。
MSTP配置实验报告

实验报告班级组号两人一组,找班干部要组号联络人组长同组人组成员课程名称计算机网络实验日期10月21日实验名称实验四 MSTP配置成绩实验目的:1. 通过MSTP的配置了解多实例MSTP的特点:可以通过vlan和instance 之间的绑定,让接入交换机的两条上行链路在正常的情况下同时承载业务,实现负载分担。
、2. 当主用上行链路故障时,stp会进行收敛,把备用链路从阻塞端口变为root端口来转发数据,从而恢复业务。
3. 当规划的主用链路恢复后,会根据cost值重新选路,恢复规划的主用链路进行业务数据转发。
实验条件:计算机、eNSP实验内容:实验拓扑图:配置SwitchA、SwitchB、SwitchC到域名为RG1的域内,创建实例MSTI1和实例MSTI2 以SWA为例(SWB,SWC同SWA)在MST域中将vlan与instance绑定,配置VLAN10映射到实例1,VLAN20映射到实例2,实现流量的负载分担。
在域RG1内,配置MSTI1与MSTI2的根桥与备份根桥以SWA为例(SWB反过来配置)配置SwitchA的端口路径开销计算方法为华为计算方法。
以SWA为例(SWB同SWA)SWC将端口GE0/0/1在实例MSTI2中的路径开销值配置为20000,将端口GE0/0/4在实例MSTI1中的路径开销值配置为20000。
设备全局使能MSTP,将与Router相连的端口设置为边缘端口,配置保护功能,如在各实例的根桥设备的指定端口配置根保护功能。
以SWA为例(SWB同SWA)在SwitchA端口GE1/0/1上启动根保护,配置SwitchA端口GE1/0/3为边缘端口。
SWC的配置:将与Host相连的端口设置为边缘端口测试:SWA,SWC为例。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
多生成树协议(MSTP)配置实例【实验名称】多生成树协议MSTP【实验目的】在接入层和汇聚层交换机上配置MSTP 并进行验证。
【背景描述】某企业网络管理员认识到,传统的生成树协议(STP)是基于整个交换网络产生一个树形拓扑结构,所有的VLANs 都共享一个生成树,这种结构不能进行网络流量的负载均衡,使得有些交换设备比较繁忙,而另一些交换设备又很空闲,为了克服这个问题,他决定采用基于VLAN 的多生成树协议MSTP ,现要在交换机上做适当配置来完成这一任务。
本实验采用4台交换机设备,PC1和PC3在Vlan 10中,IP 地址分别为172.16.1.10/24和172.16.1.30/24,PC2在Vlan 20中,PC4在Vlan 40中。
【实现功能】 在实现网络冗余和可靠性的同时实现负载均衡(分担)。
【实验拓扑】Vlan 10Vlan 20Vlan 10Vlan 40F0/1F0/2F0/23F0/23F0/24F0/24F0/23F0/1F0/2【实验设备】 接入层交换机S2126G (2台)、分布层交换机S3550-24(2台)【实验步骤】第一步:配置接入层交换机S2126-AS2126-A (config)#spanning-tree !开启生成树S2126-A (config)#spanning-tree mode mstp !配置生成树模式为MSTPS2126-A(config)#vlan 10 !创建Vlan 10S2126-A(config)#vlan 20 !创建Vlan 20S2126-A(config)#vlan 40 !创建Vlan 40S2126-A(config)#interface fastethernet 0/1S2126-A(config-if)#switchport access vlan 10 !分配端口F0/1给Vlan 10S2126-A(config)#interface fastethernet 0/2S2126-A(config-if)#switchport access vlan 20 !分配端口F0/2给Vlan 20S2126-A(config)#interface fastethernet 0/23S2126-A(config-if)#switchport mode trunk !定义F0/23为trunk端口S2126-A(config)#interface fastethernet 0/24S2126-A(config-if)#switchport mode trunk !定义F0/24为trunk端口S2126-A(config)#spanning-tree mst configuration ! 进入MSTP配置模式S2126-A(config-mst)#instance 1 vlan 1,10 !配置instance 1(实例1)并关联Vlan 1和10 S2126-A(config-mst)#instance 2 vlan 20,40 !配置实例2并关联Vlan 20和40S2126-A(config-mst)#name region1 !配置域名称S2126-A(config-mst)#revision 1 !配置版本(修订号)验证测试:验证MSTP配置S2126-A#show spanning-tree mst configuration !显示MSTP全局配置Multi spanning tree protocol : EnabledName : region1Revision : 1Instance Vlans Mapped-------- ------------------------------------------------------------0 2-9,11-19,21- 39,41- 40941 1,102 20,40第二步:配置接入层交换机S2126-BS2126-B (config)#spanning-tree !开启生成树S2126-B (config)#spanning-tree mode mstp !采用MSTP生成树模式S2126-B(config)#vlan 10 !创建Vlan 10S2126-B(config)#vlan 20 !创建Vlan 20S2126-B(config)#vlan 40 !创建Vlan 40S2126-B(config)#interface fastethernet 0/1S2126-B(config-if)#switchport access vlan 10 !分配端口F0/1给Vlan 10S2126-B(config)#interface fastethernet 0/2S2126-B(config-if)#switchport access vlan 40 !分配端口F0/2给Vlan 40S2126-B(config)#interface fastethernet 0/23S2126-B(config-if)#switchport mode trunk !定义F0/23为trunk端口S2126-B(config)#interface fastethernet 0/24S2126-B(config-if)#switchport mode trunk !定义F0/24为trunk端口S2126-B(config)#spanning-tree mst configuration ! 进入MSTP配置模式S2126-B(config-mst)#instance 1 vlan 1,10 !配置instance 1(实例1)并关联Vlan 1和10 S2126-B(config-mst)#instance 2 vlan 20,40 !配置实例2并关联Vlan 20和40S2126-B(config-mst)#name region1 !配置域名称S2126-B(config-mst)#revision 1 !配置版本(修订号)验证测试:验证MSTP配置S2126-B#show spanning-tree mst configurationMulti spanning tree protocol : EnabledName : region1Revision : 1Instance Vlans Mapped-------- ------------------------------------------------------------0 2-9,11-19,21-39,41-40941 1,102 20,40第三步:配置分布层交换机S3550-AS3550-A(config)#spanning-tree !开启生成树S3550-A (config)#spanning-tree mode mstp !采用MSTP生成树模式S3550-A(config)#vlan 10S3550-A(config)#vlan 20S3550-A(config)#vlan 40S3550-A(config)#interface fastethernet 0/1S3550-A(config-if)#switchport mode trunk !定义F0/1为trunk端口S3550-A(config)#interface fastethernet 0/23S3550-A(config-if)#switchport mode trunk !定义F0/23为trunk端口S3550-A(config)#interface fastethernet 0/24S3550-A(config-if)#switchport mode trunk !定义F0/24为trunk端口S3550-A (config)#spanning-tree mst 1 priority 4096 !配置交换机S3550-A在instance 1中的优先级为4096 ,缺省是32768,值越小越优先成为该instance中的root switchS3550-A (config)#spanning-tree mst configuration ! 进入MSTP配置模式S3550-A (config-mst)#instance 1 vlan 1,10 ! 配置实例1并关联Vlan 1和10S3550-A (config-mst)#instance 2 vlan 20,40 ! 配置实例2并关联Vlan 20和40S3550-A (config-mst)#name region1 ! 配置域名为region1S3550-A (config-mst)#revision 1 ! 配置版本(修订号)验证测试:验证MSTP配置S3550-A#show spanning-tree mst configurationMulti spanning tree protocol : EnabledName : region1Revision : 1Instance Vlans Mapped-------- ------------------------------------------------------------0 2-9,11-19,21-39,41-40941 1,102 20,40第四步:配置分布层交换机S3550-BS3550-B(config)#spanning-tree !开启生成树S3550-B (config)#spanning-tree mode mstp !采用MSTP生成树模式S3550-B(config)#vlan 10S3550-B(config)#vlan 20S3550-B(config)#vlan 40S3550-B(config)#interface fastethernet 0/1S3550-B(config-if)#switchport mode trunk ! 定义F0/1为trunk端口S3550-B(config)#interface fastethernet 0/23S3550-B(config-if)#switchport mode trunk ! 定义F0/23为trunk端口S3550-B(config)#interface fastethernet 0/24S3550-B(config-if)#switchport mode trunk ! 定义F0/24为trunk端口S3550-B (config)#spanning-tree mst 2 priority 4096 !配置交换机S3550-B在instance 2(实例2)中的优先级为4096 ,缺省是32768,值越小越优先成为该region (域)中的root switchS3550-B (config)#spanning-tree mst configuration ! 进入MSTP配置模式S3550-B (config-mst)#instance 1 vlan 1,10 ! 配置实例1并关联Vlan 1和10S3550-B (config-mst)#instance 2 vlan 20,40 ! 配置实例2并关联Vlan 20和40S3550-B (config-mst)#name region1 ! 配置域名为region1S3550-B (config-mst)#revision 1 ! 配置版本(修订号)验证测试:验证MSTP配置S3550-B#show spanning-tree mst configurationMulti spanning tree protocol : EnabledName : region1Revision : 1Instance Vlans Mapped-------- ------------------------------------------------------------0 2-9,11-19,21-39,41-40941 1,102 20,40第五步:验证交换机配置S3550-A#show spanning-tree mst 1 !显示交换机S3550-A上实例1的特性###### MST 1 vlans mapped : 1,10BridgeAddr : 00d0.f8ff.4e3f !交换机S3550-A的MAC地址Priority : 4096 ! 优先级TimeSinceTopologyChange : 0d:7h:21m:17sTopologyChanges : 0DesignatedRoot : 100100D0F8FF4E3F !后12位是MAC地址,此处显示是S3550-A自身的MAC,这说明S3550-A是实例1 (instance 1)的生成树的根交换机RootCost : 0RootPort : 0S3550-B#show spanning-tree mst 2 !显示交换机S3550-B上实例2的特性###### MST 2 vlans mapped : 20,40BridgeAddr : 00d0.f8ff.4662Priority : 4096TimeSinceTopologyChange : 0d:7h:31m:0sTopologyChanges : 0DesignatedRoot : 100200D0F8FF4662 ! S3550-B是实例2 (instance 2)的生成树的根交换机RootCost : 0RootPort : 0S2126-A#show spanning-tree mst 1 !显示交换机S2126-A上实例1的特性###### MST 1 vlans mapped : 1,10BridgeAddr : 00d0.f8fe.1e49Priority : 32768TimeSinceTopologyChange : 7d:3h:19m:31sTopologyChanges : 0DesignatedRoot : 100100D0F8FF4E3F ! 实例1的生成树的根交换机是S3550-A RootCost : 200000RootPort : Fa0/23 !对实例1而言,S2126-A的根端口是Fa0/23S2126-A#show spanning-tree mst 2 !显示交换机S2126-A上实例2的特性###### MST 2 vlans mapped : 20,40BridgeAddr : 00d0.f8fe.1e49Priority : 32768TimeSinceTopologyChange : 7d:3h:19m:31sTopologyChanges : 0DesignatedRoot : 100200D0F8FF4662 ! 实例2的生成树的根交换机是S3550-B RootCost : 200000RootPort : Fa0/24 !对实例2而言,S2126-A的根端口是Fa0/24类似可以验证其它交换机上的配置。