H3CNE 12 MSTP配置 sw1 [sw1]vlan 10 //创建vlan10 [sw1-vlan10]name caiwu //配置vlan名称 [sw1-vlan10]description caiwuvlan //配置描述信息 [sw1-vlan10]quit [sw1]vlan 20 [sw1-vlan20]name shichang [sw1-vlan20]description shichangvlan [sw1-vlan20]quit [sw1]interface range gigabitethernet 1/0/1 togigabitethernet 1/0/4 //进入接口范围(与华为port-group group-member一致) [sw1-if-range]port link-type trunk //配置端口链路类型为trunk [sw1-if-range]port trunk permit vlan 10 20 //配置放行vlan [sw1-if-range]undo port trunk permit vlan 1 //拒绝放行vlan [sw1-if-range]port trunk pvid vlan 10 //配置端口默认vlan [sw1-if-range]quit [sw1]display vlan brief [sw1]display port trunk [sw1]stp global enable //全局生成树功能开启(默认已开) [sw1]stp mode mstp //配置生成树模式为MSTP(默认模式) [sw1]stp region-configuration //进入MST域视图 [sw1-mst-region]region-name manage //配置MST域名manage [sw1-mst-region]instance 1 vlan 10 //配置生成树实例与vlan列表的映射 [sw1-mst-region]instance 2 vlan 20 [sw1-mst-region]revision-level 0 //配置MSTP的修订级别(默认0) [sw1-mst-region]active region-configuration //激活MST域配置 [sw1-mst-region]quit [sw1]stp instance 1 root primary //配置交换机是实例1的根桥 [sw1]stp instance 2 root secondary //配置交换机是实例2的备份根 [sw1]display stp region-configuration Oper Configuration Formatselector : 0 Region name : manage Revisionlevel : 0 Configurationdigest : 0x9357ebb7a8d74dd5fef4f2bab50531aa Instance VLANs Mapped 0 1 to 9, 11 to 19, 21 to 4094 1 10 2 20
sw2 [sw2]vlan 10 [sw2-vlan10]name caiwu [sw2-vlan10]description caiwuvlan [sw2-vlan10]vlan 20 [sw2-vlan20]name shichang [sw2-vlan20]description shichangvlan [sw2-vlan20]quit [sw2]interface range gigabitethernet 1/0/1 toGigabitEthernet 1/0/4 [sw2-if-range]port link-type trunk [sw2-if-range]port trunk permit vlan 10 20 [sw2-if-range]undo port trunk permit vlan 1 [sw2-if-range]port trunk pvid vlan 10 [sw2-if-range]quit [sw2]stp global enable [sw2]stp mode mstp [sw2]stp region-configuration [sw2-mst-region]region-name manage [sw2-mst-region]instance 1 vlan 10 [sw2-mst-region]instance 2 vlan 20 [sw2-mst-region]revision-level 0 [sw2-mst-region]active region-configuration [sw2-mst-region]quit [sw2]stp instance 1 root secondary [sw2]stp instance 2 root primary sw3 [sw3]vlan 10 [sw3-vlan10]name caiwu [sw3-vlan10]description caiwuvlan [sw3-vlan10]vlan 20 [sw3-vlan20]name shichang [sw3-vlan20]description shichangvlan [sw3-vlan20]quit [sw3]interface range gigabitethernet 1/0/1 to GigabitEthernet1/0/2 [sw3-if-range]port link-type trunk [sw3-if-range]port trunk permit vlan 10 20 [sw3-if-range]undo port trunk permit vlan 1 [sw3-if-range]port trunk pvid vlan 10 [sw3-if-range]quit [sw3]interface gigabitethernet 1/0/48 [sw3-GigabitEthernet1/0/48]port link-type access [sw3-GigabitEthernet1/0/48]port access vlan 10 [sw3-GigabitEthernet1/0/48]stp edged-port //配置此端口为边缘端口(仅对连接终端设备端口配置) [sw3-GigabitEthernet1/0/48]quit [sw3]interface gigabitethernet 1/0/47 [sw3-GigabitEthernet1/0/47]port link-type access [sw3-GigabitEthernet1/0/47]port access vlan 20 [sw3-GigabitEthernet1/0/47]stp edged-port [sw3-GigabitEthernet1/0/47]quit [sw3]stp global enable [sw3]stp mode mstp [sw3]stp region-configuration [sw3-mst-region]region-name manage [sw3-mst-region]instance 1 vlan 10 [sw3-mst-region]instance 2 vlan 20 [sw3-mst-region]revision-level 0 [sw3-mst-region]active region-configuration [sw3-mst-region]quit sw4 [sw4]vlan 10 [sw4-vlan10]name caiwu [sw4-vlan10]description caiwuvlan [sw4-vlan10]vlan 20 [sw4-vlan20]name shichang [sw4-vlan20]description shichangvlan [sw4-vlan20]quit [sw4]interface range gigabitethernet 1/0/1 togigabitethernet 1/0/2 [sw4-if-range]port link-type trunk [sw4-if-range]port trunk permit vlan 10 20 [sw4-if-range]undo port trunk permit vlan 1 [sw4-if-range]port trunk pvid vlan 10 [sw4-if-range]quit [sw4]interface gigabitethernet 1/0/48 [sw4-GigabitEthernet1/0/48]port link-type access [sw4-GigabitEthernet1/0/48]port access vlan 10 [sw4-GigabitEthernet1/0/48]stp edged-port [sw4-GigabitEthernet1/0/48]quit [sw4]interface gigabitethernet 1/0/47 [sw4-GigabitEthernet1/0/47]port link-type access [sw4-GigabitEthernet1/0/47]port access vlan 20 [sw4-GigabitEthernet1/0/47]stp edged-port [sw4-GigabitEthernet1/0/47]quit [sw4]stp global enable [sw4]stp mode mstp [sw4]stp region-configuration [sw4-mst-region]region-name manage [sw4-mst-region]instance 1 vlan 10 [sw4-mst-region]instance 2 vlan 20 [sw4-mst-region]revision-level 0 [sw4-mst-region]active region-configuration [sw4-mst-region]quit
|