mstp配置示例

mstp配置⽰例
肯定句
⽰例拓扑结构如下图,SwitchA、SwitchB、SwitchC、SwitchD都运⾏MSTP。它们彼此相连形成了⼀个环⽹,因为在SwitchA与SwitchB之间,以及SwitchC与SwitchD之间都存在冗余链路(本来这些链路都是可以不要的)。为实现VLAN2~VLAN10和
VLAN11~VLAN20的流量负载分担,采⽤MSTP协议配置了两个MSTI,即MSTI1和MSTi2。
(1) 在4台交换机分别创建⼀个相同的MST域(域名假设为RG1)、两个多⽣成树实例MSTI1和MSTI2,然后创建ID为2~10r VLAN映射到MSTI1的映射,创建ID为11~20的VLAN映射到MSTI2的映射。并激活MST域配置。
SwithcA上的MST域配置
[SwitchA] stp region-configuration
[SwitchA-mst-region] region-name RG1
[SwitchA-mst-region] instance 1 vlan 2 to 10
[SwitchA-mst-region]instance 2 vlan 11 to 20
[SwitchA-mst-region] active region-configuration
[SwitchA-mst-region]quit
SwithcB上的MST域配置
[SwitchB] stp region-configuration
[SwitchB-mst-region] region-name RG1
[SwitchB-mst-region] instance 1 vlan 2 to 10
[SwitchB-mst-region]instance 2 vlan 11 to 20
[SwitchB-mst-region] active region-configuration
[SwitchB-mst-region]quit
SwitchC上的配置
[SwitchC] stp region-configuration
[SwitchC-mst-region] region-name RG1
[SwitchC-mst-region] instance 1 vlan 2 to 10
[SwitchC-mst-region]instance 2 vlan 11 to 20
[SwitchC-mst-region] active region-configuration
[SwitchC-mst-region]quit
SwitchD上的配置
stp region-configuration
region-name RG1
instance 1 vlan 2 to 10
instance 2 vlan 11 to 20
异化翻译active region-configuration
(2)配置MSTI1与MSTI2的根桥和备份根桥。
[SwitchA]stp instance 1 root primary  #___配置SwitchA为MSTI1的根桥
[SwitchB]stp instance 1 root secondary #___配置SwitchB为MSTI1的备份根桥
[SwitchA]stp instance 2 root secondary #___配置SwitchA为MSTI2的备份根桥
[SwitchB]stp instance 2 root primary  #___配置SwitchB为MSTI2的根桥
(3)配置MSTI1和MSTI2中要被阻塞的端⼝,以便消除⼆层环路。
因为本⽰例中其他端⼝都是采⽤对应类型端⼝的缺省路径开销值,所以要阻塞某端⼝时只需要把它们的路径开销值配置为⼤于缺省即可。路径开销值越⼤,成为根端⼝的可能性越⼩。
[SwitchA]stp pathcost-standard legacy  #___配置采⽤华为私有端⼝路径开销计算⽅法
[SwitchB]stp pathcost-standard legacy
[SwitchC]stp pathcost-standard legacy
[SwitchC]int g0/0/2
[SwitchC-GigabitEthernet0/0/2]stp instance 2 cost 20000 #__将端⼝G0/0/2在实例MSTI2中的路径开销值配置为20000
[SwitchD]stp pathcost-standard legacy
[SwitchD]int g0/0/2
[SwitchD-GigabitEthernet0/0/2]stp instance 1 cost 20000
(4)在4台交换机上全局全能MSTP,使以上MSTP配置⽣效,消除⼆层环路。
[SwitchA]stp enable
[SwitchB]stp enable
[SwitchC]stp enable
[SwitchD]stp enable
(5)将与终端PC相连的端⼝去全能MSTP
[SwitchC]int g0/0/1
[SwitchC-GigabitEthernet0/0/1]stp disable
[SwitchC-GigabitEthernet0/0/1]quit
[SwitchD]int g0/0/1
奇案秘录
[SwitchD-GigabitEthernet0/0/1]stp disable
[SwitchD-GigabitEthernet0/0/1]quit滤水管
(6) 在两实例的根桥设备的指定端⼝上配置根保护功能
[SwitchA]int g0/0/1
[SwitchA-GigabitEthernet0/0/1]stp root-protection
[SwitchB]int g0/0/1
[SwitchB-GigabitEthernet0/0/1]stp root-protection
(7)最后在各交换机创建ID呈为2~20r aw 19个VLAN,然后把4台交换机间的直连链路的端⼝配置为Trunk类型,并允许这19个VLAN 通过。把连接PC的链路端⼝设置为Access 类型,加⼊对应的VLAN。
SwitchA上的配置
[SwitchA]vlan batch 2 to 20
[SwitchA]int g0/0/1
[SwitchA-GigabitEthernet0/0/1]port link-type trunk
[SwitchA-GigabitEthernet0/0/1]port trunk allow-pass vlan 2 to 20
[SwitchA-GigabitEthernet0/0/1]quit
[SwitchA]int g0/0/2
[SwitchA-GigabitEthernet0/0/2]port link-type trunk
[SwitchA-GigabitEthernet0/0/2]port trunk allow-pass vlan 2 to 20
[SwitchA-GigabitEthernet0/0/2]quit
SwitchB上的配置
vlan batch 2 to 20
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp root-protection
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
SwitchC上的配置
vlan batch 2 to 20
interface GigabitEthernet0/0/1
port link-type access
port default vlan 2
stp disable
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 20
stp instance 2 cost 20000
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 20
#
SwitchD上的配置
vlan batch 2 to 20
interface GigabitEthernet0/0/1
port link-type access
动量矩port default vlan 11
stp disable
#
interface GigabitEthernet0/0/2
port link-type trunk
中国铝业中州分公司port trunk allow-pass vlan 2 to 20
stp instance 1 cost 20000
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 20
经过以上配置,在⽹络计算稳定后可使⽤以下display命令验证配置结果。如在SwitchA 执⾏display stp brief命令可以查看端⼝状态和端⼝的保护类型,结果如下。从中可以看到,由于AwitchA是根桥,其G0/0/1 和G0/0/2端⼝成为指定端⼝(其中在G0/0/1端⼝上配置了根保护);在MSTI2中,SwitchA⾮根桥,其G0/0/1端⼝成为指定端⼝端⼝G0/0/2端⼝成为根端⼝。符合本⽰例中两MSTI⽣成树拓扑要求。
<SwitchA>display stp bri
MSTID  Port                        Role  STP State    Protection
0    GigabitEthernet0/0/1        DESI  FORWARDING      ROOT
0    GigabitEthernet0/0/2        ROOT  FORWARDING      NONE
0    GigabitEthernet0/0/3        ALTE  DISCARDING      NONE
1    GigabitEthernet0/0/1        DESI  FORWARDING      ROOT
1    GigabitEthernet0/0/
2        DESI  FORWARDING      NONE
2    GigabitEthernet0/0/1        DESI  FORWARDING      ROOT
2    GigabitEthernet0/0/2        ROOT  FORWARDING      NONE
在SwitchB上执⾏display stp brief命令,结果如下。从中可以看出,在MSTI2中,由于SwitchB是根桥,其g0/0/1和g0/0/2端⼝为指定端⼝(其中,在g0/0/1端⼝上配置了根保护);在MSTI1中,SwitchB 为⾮根桥,其g0/0/1端⼝成为指定端⼝,g0/0/2端⼝成为根端⼝,符合本⽰例中两MSTI⽣成树拓扑要求。
<SwitchB>dis stp bri
MSTID  Port                        Role  STP State    Protection
0    GigabitEthernet0/0/1        DESI  FORWARDING      ROOT
0    GigabitEthernet0/0/2        DESI  FORWARDING      NONE
0    GigabitEthernet0/0/3        ROOT  FORWARDING      NONE
1    GigabitEthernet0/0/1        DESI  FORWARDING      ROOT
1    GigabitEthernet0/0/
2        ROOT  FORWARDING      NONE
2    GigabitEthernet0/0/1        DESI  FORWARDING      ROOT
2    GigabitEthernet0/0/2        DESI  FORWARDING      NONE
在SwitchC上执⾏display stp interface brief命令,结果如下。从中可以看出,SwitchC的g0/0/3端⼝在MSTI1和MSTI2中均为根端⼝,g0/0/2在MSTI2中被阻塞,在MSTI1中被计算为指定端⼝,也符合本⽰例中两MSTI⽣成树拓扑要求。
<SwitchC>dis stp interface g0/0/3 brief
MSTID  Port                        Role  STP State    Protection
0    GigabitEthernet0/0/3        ALTE  DISCARDING      NONE
1    GigabitEthernet0/0/3        ROOT  FORWARDING      NONE
2    GigabitEthernet0/0/
3        ROOT  FORWARDING      NONE
<SwitchC>dis stp interface g0/0/2 brief
MSTID  Port                        Role  STP State    Protection
0    GigabitEthernet0/0/2        ROOT  FORWARDING      NONE
1    GigabitEthernet0/0/
2        DESI  FORWARDING      NONE
2    GigabitEthernet0/0/2        ALTE  DISCARDING      NONE
在SwitchD上执⾏display stp interface brief命令,结果如下 。从中可以看出,SwitchD的g0/0/3端⼝在MSTI1和MSTI2中均为根端⼝,g0/0/2端⼝在MSTI1中被阻塞,在MSTI2中被计算为指定端⼝。
<SwitchD>dis stp interface g0/0/3 brief
MSTID  Port                        Role  STP State    Protection
0    GigabitEthernet0/0/3        ROOT  FORWARDING      NONE
1    GigabitEthernet0/0/3        ROOT  FORWARDING      NONE
2    GigabitEthernet0/0/
3        ROOT  FORWARDING      NONE
<SwitchD>dis stp interface g0/0/2 brief
MSTID  Port                        Role  STP State    Protection
0    GigabitEthernet0/0/2        DESI  FORWARDING      NONE
1    GigabitEthernet0/0/
2        ALTE  DISCARDING      NONE
2    GigabitEthernet0/0/2        DESI  FORWARDING      NONE

本文发布于:2024-09-21 18:57:45,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/359624.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:配置   链路   路径   交换机   类型   开销   成为
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议