MSTP基础实验

一、实验拓扑

MSTP基础实验_第1张图片

 二、实验需求

1、所有交换机上创建Vlan10,Vlan20,Vlan30和Vlan40

2、所有交换机之间的端口配置为Trunk,并放行相关VLAN

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

三、实验步骤

1、创建 VLAN

[SW1]vlan batch 10 20 30 40
[SW2]vlan batch 10 20 30 40
[SW3vlan batch 10 20 30 40
[SW4]vlan batch 10 20 30 40
[SW5]vlan batch 10 20 30 40
[SW6]vlan batch 10 20 30 40
[SW7]vlan batch 10 20 30 40

2、交换机端口配置 Trunk,并放行vlan

SW1
[SW1]port-group group-member GigabitEthernet 0/0/1 to g0/0/2	
[SW1-port-group]port link-type trunk 
[SW1-GigabitEthernet0/0/1]port link-type trunk 
[SW1-GigabitEthernet0/0/2]port link-type trunk 
[SW1-port-group]port trunk allow-pass vlan 10 20 30 40
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40
[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40

SW2
[SW2]port-group group-member GigabitEthernet 0/0/1 to g 0/0/2	
[SW2-port-group]port link-type trunk 
[SW2-GigabitEthernet0/0/1]port link-type trunk 
[SW2-GigabitEthernet0/0/2]port link-type trunk 
[SW2-port-group]port trunk allow-pass vlan 10 20 30 40
[SW2-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40
[SW2-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40

SW3
[SW3]port-group group-member GigabitEthernet 0/0/1 to g 0/0/4
[SW3-port-group]port link-type trunk 
[SW3-GigabitEthernet0/0/1]port link-type trunk 
[SW3-GigabitEthernet0/0/2]port link-type trunk 
[SW3-GigabitEthernet0/0/3]port link-type trunk 
[SW3-GigabitEthernet0/0/4]port link-type trunk 
[SW3-port-group]port trunk allow-pass vlan 10 20 30 40
[SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40
[SW3-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40
[SW3-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20 30 40
[SW3-GigabitEthernet0/0/4]port trunk allow-pass vlan 10 20 30 40

SW4
[SW4]port-group group-member GigabitEthernet 0/0/1 to g 0/0/3
[SW4-port-group]port link-type trunk
[SW4-GigabitEthernet0/0/1]port link-type trunk
[SW4-GigabitEthernet0/0/2]port link-type trunk
[SW4-GigabitEthernet0/0/3]port link-type trunk
[SW4-port-group]port trunk allow-pass vlan 10 20 30 40
[SW4-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40
[SW4-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40
[SW4-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20 30 40

SW5
[SW5]port-group group-member g0/0/1 to g0/0/2
[SW5-port-group]port link-type trunk 
[SW5-GigabitEthernet0/0/1]port link-type trunk 
[SW5-GigabitEthernet0/0/2]port link-type trunk 
[SW5-port-group]port trunk allow-pass vlan 10 20 30 40
[SW5-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40
[SW5-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40

SW6
[SW6]port-group group-member g0/0/1 to g0/0/3
[SW6-port-group]port link-type trunk 
[SW6-GigabitEthernet0/0/1]port link-type trunk 
[SW6-GigabitEthernet0/0/2]port link-type trunk 
[SW6-GigabitEthernet0/0/3]port link-type trunk 
[SW6-port-group]port trunk allow-pass vlan 10 20 30 40
[SW6-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40
[SW6-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40
[SW6-GigabitEthernet0/0/3]port trunk allow-pass vlan 10 20 30 40

SW7
[SW7]port-group group-member g0/0/1 to g0/0/2
[SW7-port-group]port link-type trunk 
[SW7-GigabitEthernet0/0/1]port link-type trunk 
[SW7-GigabitEthernet0/0/2]port link-type trunk 
[SW7-port-group]port trunk allow-pass vlan 10 20 30 40
[SW7-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40
[SW7-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20 30 40
 

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

分析:根据图示,网络中存在 3 个 MST 区域。交换机属于同一个 MST 区域的必要条件是域名、修订级别、实例和 VLAN 的映射关系一致,所以SW1,SW2,SW3的配置需要一致,SW4,SW5,SW6 的配置一致,SW7 单独配置

另外,根据需求,hw1 区域中的 Instance1 映射 Vlan10 和 Vlan20,Instance2 映射 Vlan30 和 Vlan40;SW1 和 SW2 分别为两个实例的主备根网桥。其他 VLAN 均映射在默认的 Instance0

hw2 区域中的 Instance1 映射Vlan10,Instance2 映射 Vlan20,SW4 和 SW5 分别为两个实例的主备根网桥。其他 VLAN 均映射在默认的 Instance0

hw3 区域中的 Instance1 映射 Vlan20,Instance2 映射 Vlan40,SW7 为两个实例的主备根网桥。其他 VLAN 均映射在默认的 Instance0

   (1)SW1 上配置 MST 域,域名为 hw1,修订级别为 1,创建 Instance1 映射 Vlan10和Vlan20,创建 Instance2 映射Vlan30 和 Vlan40,SW2和SW3相同的配置。

[SW1]stp enable 
[SW1]stp mode mstp	
[SW1]stp region-configuration    //进入MST域,进行域配置
[SW1-mst-region]region-name hw1
[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  //激活MST域的配置

[SW2]stp enable
[SW2]stp mode mstp
[SW2]stp region-configuration 	
[SW2-mst-region]region-name hw1
[SW2-mst-region]revision-level 1
[SW2-mst-region]instance 1 vlan 10 20
[SW2-mst-region]instance 2 vlan 30 40
[SW2-mst-region]active region-configuration 

[SW3]stp enable 
[SW3]stp mode mstp
[SW3]stp region-configuration 
[SW3-mst-region]region-name hw1
[SW3-mst-region]revision-level 1
[SW3-mst-region]instance 1 vlan 10 20
[SW3-mst-region]instance 2 vlan 30 40
[SW3-mst-region]active region-configuration

在 SW1 上配置为 Instance1 的主根和 Instance2 的备份根
[SW1]stp instance 1 root primary 
[SW1]stp instance 2 root secondary 

在 SW2 上配置为 Instance1 的备份根和 Instance2 的主根
[SW2]stp instance 1 root secondary 	
[SW2]stp instance 2 root primary 

(2)SW4 上配置 MST 域,域名为 hw2,修订级别为 2,创建 Instance1 映射 Vlan10,创建 Instance2 映射 Vlan30,SW5和SW6相同的配置。

[SW4]stp enable 
[SW4]stp mode mstp
[SW4]stp region-configuration 
[SW4-mst-region]region-name hw2
[SW4-mst-region]revision-level 2
[SW4-mst-region]instance 1 vlan 10 
[SW4-mst-region]instance 2 vlan 30
[SW4-mst-region]active region-configuration 

[SW5]stp enable 
[SW5]stp mode mstp
[SW5]stp region-configuration 
[SW5-mst-region]region-name hw2
[SW5-mst-region]instance 1 vlan 10
[SW5-mst-region]instance 2 vlan 30
[SW5-mst-region]active region-configuration 

[SW6]stp enable 	
[SW6]stp mode mstp 
[SW6]stp region-configuration 
[SW6-mst-region]region-name hw2
[SW6-mst-region]revision-level 2
[SW6-mst-region]instance 1 vlan 10
[SW6-mst-region]instance 2 vlan 30 
[SW6-mst-region]active region-configuration 

在 SW4 上配置为 Instance1 的主根和 Instance2 的备份根
[SW4]stp instance 1 root primary 
[SW4]stp instance 2 root secondary

在 SW6 上配置为 Instance1 的备份根和 Instance2 的主根
[SW6]stp instance 1 root secondary
[SW6]stp instance 2 root primary

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

[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

你可能感兴趣的:(网络)