- 组网需求• 网络中所有设备都属于同一个 MST 域。Device A 和Device B 为汇聚层设备,Device C 和Device D 为接入层设备。• 通过配置 MSTP,使不同VLAN 的报文按照不同的MSTI 转发:VLAN 10 的报文沿MSTI 1转发,VLAN 30 沿MSTI 3 转发,VLAN 40 沿MSTI 4 转发,VLAN 20 沿MSTI 0 转发。• 由于 VLAN 10 和VLAN 30 在汇聚层设备终结、VLAN 40 在接入层设备终结,因此配置MSTI1 和MSTI 3 的根桥分别为Device A 和Device B,MSTI 4 的根桥为Device C。2.组网图
3.配置步骤(1)vlan 和 端口请按照上图在Device A和Device B上分别创建VLAN 10、20和30,在Device C上创建VLAN 10、20 和 40,在Device D上创建VLAN 20、30 和 40;将各设备的各端口配置为Trunk端口并允许相应的VLAN通过。Device A ![MSTP典型配置](https://s1.51cto.com/images/blog/201904/08/e22592db435f4343f0010f4316815b2e.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
Device B
![MSTP典型配置](https://s1.51cto.com/images/blog/201904/08/43aadfacfc6414b617cb635d3c2b267a.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
Device C
![MSTP典型配置](https://s1.51cto.com/images/blog/201904/08/7f0808ab11125fb7a7ec663c4539449a.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
Device D
![MSTP典型配置](https://s1.51cto.com/images/blog/201904/08/d5b378dfd4aaf8dc07c20cd81d4df190.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
(2).Device A配置 MST 域的域名为 example,将 VLAN 10、30、40 分别映射到 MSTI 1、3、4 上,并配置MSTP 的修订级别为 0。
<DeviceA> sys
[DeviceA] stp region-configuration
[DeviceA-mst-region] region-name example
[DeviceA-mst-region] instance 1 vlan 10
[DeviceA-mst-region] instance 3 vlan 30
[DeviceA-mst-region] instance 4 vlan 40
[DeviceA-mst-region] revision-level 0
[DeviceA-mst-region] active region-configuration
[DeviceA-mst-region] quit
[DeviceA] stp instance 1 root primary
[DeviceA] stp global enable
(3).Device B配置 MST 域的域名为 example,将 VLAN 10、30、40 分别映射到 MSTI 1、3、4 上,并配置MSTP 的修订级别为 0。
<DeviceB> sys
[DeviceB] stp region-configuration
[DeviceB-mst-region] region-name example
[DeviceB-mst-region] instance 1 vlan 10
[DeviceB-mst-region] instance 3 vlan 30
[DeviceB-mst-region] instance 4 vlan 40
[DeviceB-mst-region] revision-level 0
[DeviceB-mst-region] active region-configuration
[DeviceB-mst-region] quit
[DeviceB] stp instance 3 root primary
[DeviceB] stp global enable
(4).Device C配置 MST 域的域名为 example,将 VLAN 10、30、40 分别映射到 MSTI 1、3、4 上,并配置MSTP 的修订级别为 0。
<DeviceC> sys
[DeviceC] stp region-configuration
[DeviceC-mst-region] region-name example
[DeviceC-mst-region] instance 1 vlan 10
[DeviceC-mst-region] instance 3 vlan 30
[DeviceC-mst-region] instance 4 vlan 40
[DeviceC-mst-region] revision-level 0
[DeviceC-mst-region] active region-configuration
[DeviceC-mst-region] quit
[DeviceC] stp instance 4 root primary
[DeviceC] stp global enable
(5).Device D配置 MST 域的域名为 example,将 VLAN 10、30、40 分别映射到 MSTI 1、3、4 上,并配置MSTP 的修订级别为 0。
<DeviceD> sys
[DeviceD] stp region-configuration
[DeviceD-mst-region] region-name example
[DeviceD-mst-region] instance 1 vlan 10
[DeviceD-mst-region] instance 3 vlan 30
[DeviceD-mst-region] instance 4 vlan 40
[DeviceD-mst-region] revision-level 0
[DeviceD-mst-region] active region-configuration
[DeviceD-mst-region] quit
[DeviceD] stp global enable
4.验证配置
使用 display stp brief 命令可以查看各设备上生成树的简要信息。
下面分别是DeviceA,DeviceB,DeviceC,DeviceD验证结果。
![MSTP典型配置](https://s1.51cto.com/images/blog/201904/08/229e9cece0705c4d04dd1ccceae2897c.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
![MSTP典型配置](https://s1.51cto.com/images/blog/201904/08/92eaa4db9a3e01ad6caaa31df4c4252e.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
![MSTP典型配置](https://s1.51cto.com/images/blog/201904/08/94e7efe0455666e74424935b828995c1.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)