H3CNE 11 RSTP配置 SW1 [sw1]vlan 10 //创建vlan10 [sw1-vlan10]name caiwu //配置vlan名称 [sw1-vlan10]description caiwuvlan //配置vlan描述信息 [sw1-vlan10]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]port trunk pvid vlan 10 //拒绝放行vlan [sw1]stp mode rstp //配置生成树模式为rstp [sw1]stp priority 0 //配置交换机stp优先级为0(0=primary) [sw1]stp global enable //开局开启stp功能(默认开启) SW2 [sw2]vlan 10 [sw2-vlan10]name caiwu [sw2-vlan10]description caiwuvlan [sw2-vlan10]quit [sw2]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]display port trunk [sw2]stp mode rstp [sw2]stp priority 4096 //配置交换机stp优先级为4096(4096=secondary) [sw2]stp global enable 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/1gigabitethernet 1/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]interface gigabitethernet1/0/47 [sw3-GigabitEthernet1/0/47]port link-type access [sw3-GigabitEthernet1/0/47]port access vlan 20 [sw3-GigabitEthernet1/0/47]quit [sw3]display port trunk [sw3]stp mode rstp [sw3]stp global enable [sw3]interface range gigabitethernet 1/0/47 togigabitethernet 1/0/48 [sw3-if-range]stp edged-port //配置当前端口为边缘端口(下接终端设备建议配置边缘端口) [sw3-if-range]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]interface gigabitethernet1/0/47 [sw4-GigabitEthernet1/0/47]port link-type access [sw4-GigabitEthernet1/0/47]port access vlan 20 [sw4-GigabitEthernet1/0/47]quit [sw4]display vlan brief [sw4]display port trunk [sw4]display vlan 10 [sw4]display vlan 20 [sw4[sw4]stp mode rstp [sw4]stp global enable]interface range gigabitethernet1/0/47 to GigabitEthernet 1/0/48 [sw4-if-range]stp edged-port [sw4-if-range]quit [sw4]display stp
|