MSTP 实验

实验拓扑


图 1-1

注:如无特别说明,描述中的 R1 或 SW1 对应拓扑中设备名称末尾数字为 1 的设备,R2 或 SW2 对应拓扑中设备名称末尾数字为 2 的设备,以此类推;另外,同一网段中,IP 地址的主机位为其设备编号,如 R3 的 g0/0 接口若在 192.168.1.0/24 网段,则其 IP 地址为 192.168.1.3/24,以此类推


实验需求

  1. 所有交换机上创建 Vlan10,Vlan20,Vlan30 和 Vlan40
  2. 所有交换机之间的端口配置为 Trunk,并放行相关 VLAN
  3. 按照图示分区域配置 MSTP,并配置主备根网桥

实验解法

  1. 创建 VLAN 部分略

  2. 交换机端口配置 Trunk 部分略

  3. 按照图示分区域配置 MSTP,并配置主备根网桥

      分析:根据图示,网络中存在 3 个 MST 区域。交换机属于同一个 MST 区域的必要条件是域名、修订级别、实例和 VLAN 的映射关系一致,所以SW1,SW2,SW3 的配置需要一致,SW4,SW5,SW6 的配置一致,SW7 单独配置
      另外,根据需求,h3c1 区域中的 Instance1 映射 Vlan10 和 Vlan20,Instance2 映射 Vlan30 和 Vlan40;SW1 和 SW2 分别为两个实例的主备根网桥。其他 VLAN 均映射在默认的 Instance0
      h3c2 区域中的 Instance1 映射 Vlan10,Instance2 映射 Vlan20,SW4 和 SW5 分别为两个实例的主备根网桥。其他 VLAN 均映射在默认的 Instance0
      h3c3 区域中的 Instance1 映射 Vlan20,Instance2 映射 Vlan40,SW7 为两个实例的主备根网桥。其他 VLAN 均映射在默认的 Instance0

      
    步骤 1:SW1 上配置 MST 域,域名为 h3c1,修订级别为 1,创建 Instance1 映射 Vlan10 和 Vlan20,创建 Instance2 映射 Vlan30 和 Vlan40

    [SW1]stp region-configuration
    [SW1-mst-region]region-name h3c1
    [SW1-mst-region]revision-level 1
    [SW1-mst-region]instance 1 vlan 10 20
    [SW1-mst-region]instance 2 vlan 30 40
    [SW1-mst-region]active region-configuration
    

    步骤 2:在 SW2,SW3 配置 MST 域,配置方法和命令一致

    步骤 3:在 SW1 上配置为 Instance1 的主根和 Instance2 的备份根

    [SW1]stp instance 1 root primary 
    [SW1]stp instance 2 root secondary
    

    步骤 4:在 SW2 上配置为 Instance1 的备份根和 Instance2 的主根

    [SW2]stp instance 1 root secondary
    [SW2]stp instance 2 root primary 
    

    步骤 5:SW4 上配置 MST 域,域名为 h3c2,修订级别为 1,创建 Instance1 映射 Vlan10,创建 Instance2 映射 Vlan30

    [SW4]stp region-configuration
    [SW4-mst-region]region-name h3c2
    [SW4-mst-region]revision-level 1
    [SW4-mst-region]instance 1 vlan 10
    [SW4-mst-region]instance 2 vlan 30
    [SW4-mst-region]active region-configuration
    

    步骤 6:在 SW5 和 SW6 上配置 MST 域,配置方法和命令与 SW4 一致

    步骤 7:在 SW4 上配置为 Instance1 的主根和 Instance2 的备份根

    [SW4]stp instance 1 root primary 
    [SW4]stp instance 2 root secondary
    

    步骤 8:在 SW6 上配置为 Instance1 的备份根和 Instance2 的主根

    [SW6]stp instance 1 root secondary
    [SW6]stp instance 2 root primary 
    

    步骤 9:SW7 上配置 MST 域,域名为 h3c3,修订级别为 1,创建 Instance1 映射 Vlan20,创建 Instance2 映射 Vlan40,由于区域 h3c3 只有一台交换机,所以无需手动配置主备根网桥

    [SW7]stp region-configuration
    [SW7-mst-region]region-name h3c3
    [SW7-mst-region]revision-level 1
    [SW7-mst-region]instance 1 vlan 20
    [SW7-mst-region]instance 2 vlan 40
    [SW7-mst-region]active region-configuration