MSTP指南.docx
《MSTP指南.docx》由会员分享,可在线阅读,更多相关《MSTP指南.docx(14页珍藏版)》请在冰豆网上搜索。

MSTP指南
MSTP配置指南
只有开启设备MSTP特性后其他配置才能生效。
在启动MSTP之前,可以配置设备或以太网端口的相关参数;启动MSTP后,这些参数将生效;MSTP关闭后,这些配置参数仍被保留;当MSTP重新启动后,这些参数仍将生效。
2.1配置指南
2.1.1MSTP单实例组网的推荐配置
MSTP单实例组网的推荐配置包括:
✍开启设备MSTP特性
✍开启端口MSTP特性
✍指定交换机为根交换机或备份根交换机
✍配置端口的PathCost
✍配置交换机的保护功能
2.1.2MSTP多实例组网的推荐配置
MSTP多实例组网的推荐配置包括:
✍开启设备MSTP特性
✍开启端口MSTP特性
✍配置交换机的MST域
✍指定交换机为根交换机或备份根交换机
✍配置端口的PathCost
✍配置交换机的保护功能
&说明:
未生效的域参数可以使用checkregion-configuration命令显示;在MSTP未启动前配置的其他参数可以使用displaycurrent-configurationconfigurationmst-region命令来显示;启动后的MSTP参数可以使用相关的display命令显示。
3MSTP配置举例
3.1MSTP组网需求
下图中,LSWA和LSWB是汇聚层的三层设备(记作L3),LSWC和LSWD是接入用的二层设备(记作L2)。
MSTP单实例组网需求。
●两台L3一个配置为根桥(rootprimary),另一个配置为备份根桥(rootsecondary),并且通过调整端口的stpcost,保证Discarding的端口均在L2上。
●每个L2都使用双归属的方式连接到两台L3上。
之所以没有使用更大的环,是因为最小的环可以保证最快的收敛速度和最大的可靠性(环小自然环上可能的故障点就少了)。
●使用链路聚合,这样不仅可以通过负载分担增加带宽,而且大大增加了可靠性。
两台L3之间建议使用更多的物理链路聚合,因为所有的双归属环都通过了这条路,它要求的带宽自然更大,要求的可靠性自然也更高。
●在L3与L2相连的端口上避免使用trunkpermitvlanall,应只允许各双归属环内使用的vlan通过。
这样可以防止一个环上的广播风暴传染到另一个环上。
因此规划网络时就应考虑将各个双归属环用vlan隔开。
●必须将交换机连接终端设备(客户端或者服务器)或者连接其他不会发出BPDU报文的网络设备的端口,配置成为边缘端口,同时开启交换机的BPDU保护功能;或者直接关闭该端口的生成树协议。
●为了避免端口由于各种收发协议报文错误而发生端口角色和状态改变,导致网络中产生环路,必须在交换机上多个通往根桥的端口上增加环路保护功能。
●为了避免交换机由于收到频繁的TC报文,而按照协议规定对MAC地址表项及ARP地址表项进行频繁删除操作,继而出现设备CPU占用率增高、业务中断的故障,建议在交换机上增加TC报文保护功能的配置。
●为了及时检测整网收到抢根报文(比根桥发送BPDU报文优先级更高的报文),造成网络拓扑震荡,可以在根桥设备连接其他网桥的端口上增加Root保护功能。
MSTP多实例组网需求。
●通过MSTP多实例的配置使不同VLAN的数据报文按照不同的生成树转发,实现流量的负载分担。
具体配置为:
网络中所有交换机属于同一个MST域,VLAN10的报文沿着实例1转发,VLAN30沿着实例3转发,VLAN20沿着实例0转发。
●进行此项配置应该注意的是,所有设备的MSTP域名要相同,修订级别要相同,所有实例与VLAN的映射关系应完全相同,即使某些设备根本没有用到某些VLAN,但仍要求配置这些VLAN到实例的映射。
●组网图中,LSWA和LSWB为汇聚层设备,LSWC和LSWD为接入层设备。
VLAN10、VLAN30在汇聚层设备终结,配置实例0的主树根和备份树根分别为LSWA和LSWB。
配置实例1的主树根和备份树根分别为LSWA和LSWB。
配置实例3的主树根和备份树根分别为LSWB和LSWA。
●方法是在每个双归属环上均使用两个实例,映射到两组VLAN上,通过使环路Discarding在不同位置,使两组VLAN中的流量从不同的方向上行,实现流量的负载分担。
例如:
在L2_1上,vlan2映射到实例2上,port0/6以access的方式属于vlan2,vlan3和vlan4映射到实例3上,port0/7和port0/8分别以access的方式属于vlan3和vlan4,接着通过调整端口stpcost的方法使实例2的Discarding端口为L2_1的port0/3,而实例3的Discarding端口为port0/1。
这样SERVER1的流量便从左侧上行到L3上,而SERVER2和SERVER3上的流量会从右侧上行到L3上,这样不仅实现了负载分担,而且还可以实现一定的QOS控制,例如,可以让比较重要的流量走一个方向,而其他众多的不太重要的流量走另一个方向,通过VLAN规划保证前者的带宽,而后者则不予保证。
在此基础上调整各SERVER的网关位置还可大大减小两台L3之间的流量。
3.2MSTP组网图
MSTP单实例推荐组网:
图1MSTP单实例推荐组网
MSTP多实例推荐组网:
图2MSTP多实例推荐组网
3.3配置步骤
3.3.1单实例推荐配置(按端口实现负载分担)
1.使用的版本(标题4样式,快捷键F4)
给出Release版本信息和VRBD信息。
应该是正式发布的版本,而不是临时版本,测试版本,受限版本。
2.配置交换机LSWA
#开启设备MSTP特性
[Quidway]stpenable
#定义LSWA为实例0的主根
[Quidway]stpinstance0rootprimary
#配置管理VLAN
[Quidway]management-vlan100
#配置集群
[Quidway]cluster
[Quidway-cluster]ip-pool192.168.1.124
[Quidway-cluster]buildcluster1
#配置VRRP
[Quidway]vrrpping-enable
[Quidway]interfacevlan10
[Quidway-vlan-interface10]ipaddress10.0.0.224
[Quidway-vlan-interface10]vrrpvrid1virtual-ip10.0.0.1
[Quidway-vlan-interface10]vrrpvrid1priority110
[Quidway]interfacevlan20
[Quidway-vlan-interface20]ipaddress20.0.0.224
[Quidway-vlan-interface20]vrrpvrid1virtual-ip20.0.0.1
3.配置交换机LSWB
#开启设备MSTP特性
[Quidway]stpenable
#定义LSWB为实例0的备根
[Quidway]stpinstance0rootsecondary
#配置端口的PathCost
[Quidway]interfaceGigabitEthernet1/0/1
[Quidway-GigabitEthernet1/0/1]stpinstance0cost20
[Quidway]interfaceGigabitEthernet1/0/2
[Quidway-GigabitEthernet1/0/2]stpinstance0cost20
[Quidway]interfaceGigabitEthernet1/0/3
[Quidway-GigabitEthernet1/0/3]stpinstance0cost20
#配置VRRP
[Quidway]vrrpping-enable
[Quidway]interfacevlan10
[Quidway-vlan-interface10]ipaddress10.0.0.324
[Quidway-vlan-interface10]vrrpvrid1virtual-ip10.0.0.1
[Quidway]interfacevlan20
[Quidway-vlan-interface20]ipaddress20.0.0.324
[Quidway-vlan-interface20]vrrpvrid1virtual-ip20.0.0.1
[Quidway-vlan-interface20]vrrpvrid1priority110
4.配置交换机LSWC
#开启设备MSTP特性
[Quidway]stpenable
#配置端口的PathCost
[Quidway]interfaceGigabitEthernet1/0/2
[Quidway-GigabitEthernet1/0/2]stpinstance0cost200000
[Quidway]interfaceGigabitEthernet1/0/3
[Quidway-GigabitEthernet1/0/3]stpinstance0cost200
5.配置交换机LSWD
#开启设备MSTP特性
[Quidway]stpenable
#配置端口的PathCost
[Quidway]interfaceGigabitEthernet1/0/2
[Quidway-GigabitEthernet1/0/2]stpinstance0cost200000
[Quidway]interfaceGigabitEthernet1/0/3
[Quidway-GigabitEthernet1/0/3]stpinstance0cost20
6.验证结果
描述本例运行或测试的正常情况下的结果(或预期效果)。
验证结果要可视。
另外,不应该通过debug来验证结果。
标题5(标题5样式,快捷键F5)
3.3.2多实例推荐配置(按实例实现负载分担)
1.使用的版本(标题4样式,快捷键F4)
给出Release版本信息和VRBD信息。
应该是正式发布的版本,而不是临时版本,测试版本,受限版本。
2.配置交换机LSWA
#开启设备MSTP特性
[Quidway]stpenable
#MST域
[Quidway]stpregion-configuration
[Quidway-mst-region]region-nameregion1
[Quidway-mst-region]instance1vlan1030
[Quidway-mst-region]instance3vlan2040
#手工激活MST域的配置
[Quidway-mst-region]activeregion-configuration
#定义LSWA为实例0的主根
[Quidway]stpinstance0rootprimary
#定义LSWA为实例1的主根
[Quidway]stpinstance1rootprimary
#定义LSWA为实例3的备根
[Quidway]stpinstance3rootsecondary
#配置端口的PathCost
[Quidway]interfaceGigabitEthernet1/0/1
[Quidway-GigabitEthernet1/0/1]stpinstance3cost20
[Quidway]interfaceGigabitEthernet1/0/2
[Quidway-GigabitEthernet1/0/2]stpinstance3cost20
[Quidway]interfaceGigabitEthernet1/0/3
[Quidway-GigabitEthernet1/0/3]stpinstance3cost20
#配置管理VLAN
[Quidway]management-vlan100
#配置集群
[Quidway]cluster
[Quidway-cluster]ip-pool192.168.1.124
[Quidway-cluster]buildcluster1
#配置VRRP
[Quidway]vrrpping-enable
[Quidway]interfacevlan10
[Quidway-vlan-interface10]ipaddress10.0.0.224
[Quidway-vlan-interface10]vrrpvrid1virtual-ip10.0.0.1
[Quidway-vlan-interface10]vrrpvrid1priority110
[Quidway]interfacevlan20
[Quidway-vlan-interface20]ipaddress20.0.0.224
[Quidway-vlan-interface20]vrrpvrid1virtual-ip20.0.0.1
[Quidway]interfacevlan30
[Quidway-vlan-interface30]ipaddress30.0.0.224
[Quidway-vlan-interface30]vrrpvrid1virtual-ip30.0.0.1
[Quidway-vlan-interface30]vrrpvrid1priority110
[Quidway]interfacevlan40
[Quidway-vlan-interface40]ipaddress40.0.0.224
[Quidway-vlan-interface40]vrrpvrid1virtual-ip40.0.0.1
3.配置交换机LSWB
#开启设备MSTP特性
[Quidway]stpenable
#MST域
[Quidway]stpregion-configuration
[Quidway-mst-region]region-nameregion1
[Quidway-mst-region]instance1vlan1030
[Quidway-mst-region]instance3vlan2040
#手工激活MST域的配置
[Quidway-mst-region]activeregion-configuration
#定义LSWA为实例0的备根
[Quidway]stpinstance0rootsecondary
#定义LSWA为实例1的备根
[Quidway]stpinstance1rootsecondary
#定义LSWA为实例3的主根
[Quidway]stpinstance3rootprimary
#配置端口的PathCost
[Quidway]interfaceGigabitEthernet1/0/1
[Quidway-GigabitEthernet1/0/1]stpinstance0cost20
[Quidway-GigabitEthernet1/0/1]stpinstance1cost20
[Quidway]interfaceGigabitEthernet1/0/2
[Quidway-GigabitEthernet1/0/2]stpinstance0cost20
[Quidway-GigabitEthernet1/0/1]stpinstance1cost20
[Quidway]interfaceGigabitEthernet1/0/3
[Quidway-GigabitEthernet1/0/3]stpinstance0cost20
[Quidway-GigabitEthernet1/0/1]stpinstance1cost20
#配置VRRP
[Quidway]vrrpping-enable
[Quidway]interfacevlan10
[Quidway-vlan-interface10]ipaddress10.0.0.324
[Quidway-vlan-interface10]vrrpvrid1virtual-ip10.0.0.1
[Quidway]interfacevlan20
[Quidway-vlan-interface20]ipaddress20.0.0.324
[Quidway-vlan-interface20]vrrpvrid1virtual-ip20.0.0.1
[Quidway-vlan-interface20]vrrpvrid1priority110
[Quidway]interfacevlan30
[Quidway-vlan-interface30]ipaddress30.0.0.324
[Quidway-vlan-interface30]vrrpvrid1virtual-ip30.0.0.1
[Quidway]interfacevlan40
[Quidway-vlan-interface40]ipaddress40.0.0.324
[Quidway-vlan-interface40]vrrpvrid1virtual-ip40.0.0.1
[Quidway-vlan-interface40]vrrpvrid1priority110
4.配置交换机LSWC
#开启设备MSTP特性
[Quidway]stpenable
#MST域
[Quidway]stpregion-configuration
[Quidway-mst-region]region-nameregion1
[Quidway-mst-region]instance1vlan1030
[Quidway-mst-region]instance3vlan2040
#手工激活MST域的配置
[Quidway-mst-region]activeregion-configuration
#配置端口的PathCost
[Quidway]interfaceGigabitEthernet1/0/2
[Quidway-GigabitEthernet1/0/2]stpinstance0cost200000
[Quidway-GigabitEthernet1/0/2]stpinstance1cost200000
[Quidway-GigabitEthernet1/0/2]stpinstance3cost200
[Quidway]interfaceGigabitEthernet1/0/3
[Quidway-GigabitEthernet1/0/3]stpinstance0cost200
[Quidway-GigabitEthernet1/0/3]stpinstance1cost200
[Quidway-GigabitEthernet1/0/3]stpinstance3cost200000
5.配置交换机LSWD
#开启设备MSTP特性
[Quidway]stpenable
#MST域
[Quidway]stpregion-configuration
[Quidway-mst-region]region-nameregion1
[Quidway-mst-region]instance1vlan1030
[Quidway-mst-region]instance3vlan2040
#手工激活MST域的配置
[Quidway-mst-region]activeregion-configuration
#配置端口的PathCost
[Quidway]interfaceGigabitEthernet1/0/2
[Quidway-GigabitEthernet1/0/2]stpinstance0cost200000
[Quidway-GigabitEthernet1/0/2]stpinstance1cost200
[Quidway-GigabitEthernet1/0/2]stpinstance3cost200000
[Quidway]interfaceGigabitEthernet1/0/3
[Quidway-GigabitEthernet1/0/3]stpinstance0cost20
[Quidway-GigabitEthernet1/0/3]stpinstance1cost200000
[Quidway-GigabitEthernet1/0/3]stpinstance3cost200
6.验证结果
描述本例运行或测试的正常情况下的结果(或预期效果)。
验证结果要可视。
另外,不应该通过debug来验证结果。
标题5(标题5样式,快捷键F5)
3.4故障排除(可选)
在配置本例时比较容易忽视配置之后或相关条件不符合要求时出现的结果。
并根据此结果描述推断问题的过程,并给出相应解决方法。
debuggingsshservervty0
4关键命令(可选)
配置MSTP特性的关键命令有:
●stp{enable|disable}
●stpregion-configuration
●region-namename
●instanceinstance-idvlanvlan-list
●activeregion-configuration
4.1stp
【命令】
stp{enable|disable}
undostp
【视图】
系统视图、以太网端口视图
【参数】
enable:
用来开启全局或端口的MSTP特性。
disable:
用来关闭全局或端口的MSTP特性。
【描述】
stp命令用来启动或关闭交换机全局或端口的MSTP特性。
undostp命令用来恢复交换机全局或端口的MSTP特性为缺省状态。
缺省情况下,交换机上的MSTP特性处于关闭状态。
要在端口使能MSTP,必须先在全局使能MSTP。
【举例】
#启动全局MSTP特性。
[Quidway]stpenable
#关闭以太网端口Ethernet2/1/1上的MSTP特性。
[Quidway-Eth