1.建立vlan10 20 30 40 pc相連端口設置access 加入vlan10 20 不參與生成樹選舉 禁用stp生成樹
把3 ,4端口加入trunk 贊成經過全部vlan
SW1 stp enable
sw1 stp mode mstpide
[sw2]stp instance 1 priority 8192
[sw2]stp instance 2 priority 4096blog
display stp brief接口
[S1]vlan batch 10 20 30 40 /建立vlan
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1]int e0/0/1 /與PC接口設置acc模式而且禁用stp 由於這裏不須要參與
[S1-Ethernet0/0/1]port link-type acces
[S1-Ethernet0/0/1]port default vlan 10
[S1-Ethernet0/0/1]stp disable
[S1-Ethernet0/0/1]int e0/0/2
[S1-Ethernet0/0/2]port link-type acces
[S1-Ethernet0/0/2]port default vlan 20
[S1-Ethernet0/0/2]stp disable
[S1-Ethernet0/0/2]q
[S1]port-group 1 /建立組 1
[S1-port-group-1]group-member e0/0/3 e0/0/4 //組加入接口
[S1-port-group-1]port link-type trunk //交換機之間設置TRUNK模式
[S1-Ethernet0/0/3]port link-type trunk
[S1-Ethernet0/0/4]port link-type trunk
[S1-port-group-1]port trunk allow-pass vlan all //容許全部VLAN經過
[S1-Ethernet0/0/3]port trunk allow-pass vlan all
[S1-Ethernet0/0/4]port trunk allow-pass vlan all
[S1]stp enable /交換機開啓stp功能
[S1]stp mode mstp /設置STP模式爲MSTP 默認就是可是最好從新設置一下
[S1]stp region-configuration /設置STP區域
[S1-mst-region]region-name abc /設置區域名稱ABC
[S1-mst-region]instance 1 vlan 10 20 /區域1 容許經過vlan 10 20
[S1-mst-region]instance 2 vlan 30 40 /區域2 容許經過vlan 30 40
[S1-mst-region]active region-configuration /啓用激活區域設置
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1-mst-region]q
[S1]stp instance 1 priority 4096 //設置stp區域1優先級4096
[S1]stp instance 2 priority 8192 //設置stp區域2優先級 8192
[S1]dis stp brief /顯示STP表ip
[S2]vlan batch 10 20 30 40
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2]int e0/0/1
[S2-Ethernet0/0/1]port link-type acces
[S2-Ethernet0/0/1]port default vlan 30
[S2-Ethernet0/0/1]stp disable
[S2-Ethernet0/0/1]int e0/0/2
[S2-Ethernet0/0/2]port link-type access
[S2-Ethernet0/0/2]port default vlan 40
[S2-Ethernet0/0/2]stp disable
[S2-Ethernet0/0/2]q
[S2]port-group 1
[S2-port-group-1]group-member e0/0/3 e0/0/4
[S2-port-group-1]port link-type trunk
[S2-Ethernet0/0/3]port link-type trunk
[S2-Ethernet0/0/4]port link-type trunk
[S2-port-group-1]port trunk allow-pass vlan all
[S2-Ethernet0/0/3]port trunk allow-pass vlan all
[S2-Ethernet0/0/4]port trunk allow-pass vlan all
[S2-port-group-1]q
[S2]stp enable
[S2]stp mode mstp
[S2]stp region-configuration
[S2-mst-region]region-name abc
[S2-mst-region]instance 1 vlan 10 20
[S2-mst-region]instance 2 vlan 30 40
[S2-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2-mst-region]q
[S2]stp instance 1 priority 8192
[S2]stp instance 2 priority 4096
[S2]dis stp brief 路由
[S3]vlan batch 10 20 30 40
Info: This operation may take a few seconds. Please wait for a moment...done.
[S3]port-group 1
[S3-port-group-1]group-member e0/0/1 e0/0/2
[S3-port-group-1]port link-type trunk
[S3-Ethernet0/0/1]port link-type trunk
[S3-Ethernet0/0/2]port link-type trunk
[S3-port-group-1]port trunk allow-pass vlan all
[S3-Ethernet0/0/1]port trunk allow-pass vlan all
[S3-Ethernet0/0/2]port trunk allow-pass vlan all
[S3-port-group-1]q
[S3]int e0/0/3
[S3-Ethernet0/0/3]port link-type trunk
[S3-Ethernet0/0/3]port trunk allow-pass vlan all
[S3-Ethernet0/0/3]stp disable
[S3]stp enable
[S3]stp mode mstp
[S3]stp region-configuration
[S3-mst-region]region-name abc
[S3-mst-region]instance 1 vlan 10 20
[S3-mst-region]instance 2 vlan 30 40
[S3-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S3]dis stp brief 域名
[R1]int g0/0/0.1
[R1-GigabitEthernet0/0/0.1]dot1q termination vid 10
[R1-GigabitEthernet0/0/0.1]ip add 192.168.10.1 24
[R1-GigabitEthernet0/0/0.1]arp broadcast enable
[R1-GigabitEthernet0/0/0.1]int g0/0/0.2
[R1-GigabitEthernet0/0/0.2]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.2]ip add 192.168.20.1 24
[R1-GigabitEthernet0/0/0.2]arp broadcast enable
[R1-GigabitEthernet0/0/0.2]int g0/0/0.3
[R1-GigabitEthernet0/0/0.3]dot1q termination vid 30
[R1-GigabitEthernet0/0/0.3]ip add 192.168.30.1 24
[R1-GigabitEthernet0/0/0.3]arp broadcast enable
[R1-GigabitEthernet0/0/0.3]int g0/0/0.4
[R1-GigabitEthernet0/0/0.4]dot1q termination vid 40
[R1-GigabitEthernet0/0/0.4]ip add 192.168.40.1 24
[R1-GigabitEthernet0/0/0.4]arp broadcast enable
[R1-GigabitEthernet0/0/0.4]q
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 100.1.1.1 24
[R1-GigabitEthernet0/0/1]qit