|
交换机BID
|
BID值
|
SW-1 BID
|
32768-cc01.0458.0000
|
SW-2 BID
|
32768-cc02.0628.0000
|
SW-3 BID
|
32768-cc03.07f4.0000
|
交 换 机
|
端
口
|
到根桥的开销
|
根端口结果
|
指定端口结果
|
SW-1
|
FastEthernet 0/0
|
0
|
|
指定端口
|
FastEthernet 0/1
|
0
|
|
指定端口
|
|
SW-2
|
FastEthernet 0/0
|
19+0
|
根端口
|
|
FastEthernet 0/1
|
19+19
|
|
指定端口
|
|
SW-3
|
FastEthernet 0/0
|
19+0
|
根端口
|
|
FastEthernet 0/1
|
19+19
|
|
阻断端口
|
|
特
性
|
默 认 值
|
STP开启状态
|
所有VLAN均开启,最大可开启128个生成树实例
|
STP模式
|
PVST(PSTST和MSTP关闭)
|
优先级
|
32768
|
STP端口优先级
|
128
|
STP端口开销
|
1Gbps:=4,100Mbps=19,10Mbps=100
|
生成树VLAN端口优先级
|
124
|
生成树VLAN端口开销
|
1Gbps:=4,100Mbps=19,10Mbps=100
|
Hello time
|
2秒
|
Forward-delay
|
15秒
|
Maximum-aging
|
20秒
|
Cisco 的交换机默认是开启PVST的,也就是开启每VLAN的生成树协议,每VLAN快速生成树协议(PVRST),多VLAN生成树协议(MSTP)则需要另 外打开。Cisco 交换机的STP 最多支持128个实例,如果超过128个实例(也就是超过128VLAN),需要使用RSTP和MSTP协议。
|
步
骤
|
命
令
|
解
释
|
1
|
Switch# configure terminal
|
进入全局配置模式
|
2
|
Switch(config)# no spanning-tree vlan vlan-id
|
关闭某一或某些VLAN的STP(Cisco的交换机默认是基于每VLAN的
vlan-id 指定关闭的VLAN ID,可以用连接号或逗号隔开多个,VLAN ID范围1~4094
|
3
|
Switch(config)# end
|
返回特权配置模式
|
4
|
Switch#show spanning-tree valn-id
|
验证
|
5
|
Switch# copy running-config startup-config
|
保存当前配置
|
步
骤
|
命
令
|
解
释
|
1
|
Switch#configure terminal
|
进入全局配置模式
|
2
|
Switch(config)#spanning-tree vlan vlan-id root primary [diameter net-diameter [hello-time seconds]]
|
配置一台交换机成为特定VLAN的根vlan-id 指定的VLAN ID,可以用连接号或逗号隔开多个,VLAN ID范围1~4094
(可选)网络直径,定义两台工作站之间交换机的数量,范围为2~7(可选)Hello-time,配置有根桥产生的BPDU消息通知的间隔,范围2~10秒,默认为2秒
|
3
|
Switch(config)#end
|
返回特权配置模式
|
4
|
Switch#show spanning-tree detail
|
验证
|
5
|
Switch#copy running-config startup-config
|
保存当前配置
|
步
骤
|
命
令
|
解
释
|
1
|
Switch#configure terminal
|
进入全局配置模式
|
2
|
Switch(config)#spanning-tree vlan vlan-id root secondary [diameter net-diameter [hello-time seconds]]
|
配 置一台交换机成为特定VLAN的根vlan-id指定的VLAN ID,可以用连接号或逗号隔开多个,VLAN ID范围1~4094(可选)网络直径,定义两台工作站之间交换机的数量,范围为2~7(可选)Hello-time,配置有根桥产生的BPDU消息通知 的间隔,范围2~10秒,默认为2秒
|
3
|
Switch(config)#end
|
返回特权配置模式
|
4
|
Switch#show spanning-tree detail
|
验证
|
5
|
Switch#copy running-config startup-config
|
保存当前配置
|
步
骤
|
命
令
|
解
释
|
1
|
Switch#configure terminal
|
进入全局配置模式
|
2
|
interface interface-id
|
进入端口配置模式
|
3
|
Switch(config)#spanning-tree port-priority priority
|
配置一个端口的优先级
Priority 范围为0~240,步长为16(非16的步长值,不接受),默认为128,数据越大优先级越大
|
4
|
Switch(config)#spanning-tree vlan vlan-id port-priority priority
|
配置一个VLAN端口的优先级vlan-id指定的VLAN ID,可以用连接号或逗号隔开多个,VLAN ID范围1~4094
Priority 范围为0~240,步长为16(非16的步长值,不接受),默认为128,数据越大优先级越大
|
5
|
Switch(config)#end
|
返回特权配置模式
|
6
|
Switch#show spanning-tree interface interface-id
Switch#show spanning-tree vlan vlan-id
|
验证
|
7
|
Switch#copy running-config startup-config
|
保存当前配置
|
步
骤
|
命
令
|
解
释
|
1
|
Switch#configure terminal
|
进入全局配置模式
|
2
|
Switch(config)#interface interface-id
|
进入端口配置模式
|
3
|
Switch(config-if)# spanning-tree cost cost
|
Cost的范围为1~200 000 000,默认值参看表8-1,越小越优先
|
4
|
Switch(config-if)# spanning-tree vlan vlan-id cost cost
|
配置VLAN端口的的开销vlan-id指定的VLAN ID,可以用连接号或逗号隔开多个,VLAN ID范围1~4094,Cost的范围为1~200 000 000,默认值参看表8-1,越小越优先
|
5
|
Switch(config)#end
|
返回特权配置模式
|
6
|
Switch# show spanning-tree interface {interface-id} |{port-channel port_channel_number}
Switch# show spanning-tree vlan vlan_ID
|
验证
|
7
|
copy running-config startup-config
|
保存当前配置
|
步
骤
|
命
令
|
解
释
|
1
|
Switch#configure terminal
|
进入全局配置模式
|
2
|
Switch(config)#spanning-tree vlan vlan-id priority priority
|
vlan-id 指定的VLAN ID,可以用连接号或逗号隔开多个,VLAN ID范围1~4 094。
Priority 范围为0~61 440,步长为4096(非4 096的步长值,不接受),默认为32 768,数据越小将被选为根桥
|
3
|
Switch(config)#end
|
返回特权配置模式
|
4
|
Switch#show spanning-tree vlan vlan-id
|
验证
|
5
|
Switch#copy running-config startup-config
|
保存当前配置
|
步
骤
|
命
令
|
解
释
|
1
|
Switch#configure terminal
|
进入全局配置模式
|
2
|
Switch(config)#spanning-tree vlan vlan-id hello-time seconds
|
vlan-id 指定的VLAN ID,可以用连接号或逗号隔开多个,VLAN ID范围1~4 094
Seconds,范围为1~10,默认为2
|
3
|
Switch(config)#end
|
返回特权配置模式
|
4
|
Switch#show spanning-tree vlan vlan-id
|
验证
|
5
|
Switch#copy running-config startup-config
|
保存当前配置
|
步
骤
|
命
令
|
解
释
|
1
|
Switch#configure terminal
|
进入全局配置模式
|
2
|
Switch(config)#spanning-tree vlan vlan-id
forward-time
seconds
|
vlan-id 指定的VLAN ID,可以用连接号或逗号隔开多个,VLAN ID范围1~4 094
Seconds,范围为4~30,默认为15
|
3
|
Switch(config)#end
|
返回特权配置模式
|
4
|
Switch#show spanning-tree vlan vlan-id
|
验证
|
5
|
Switch#copy running-config startup-config
|
保存当前配置
|
步
骤
|
命
令
|
解
释
|
1
|
Switch#configure terminal
|
进入全局配置模式
|
2
|
Switch(config)#spanning-tree vlan vlan-id max-age seconds
|
vlan-id 指定的VLAN ID,可以用连接号或逗号隔开多个,VLAN ID范围1~4 094
Seconds,范围为6~40,默认为20
|
3
|
Switch(config)#end
|
返回特权配置模式
|
4
|
Switch#show spanning-tree vlan vlan-id
|
验证
|
5
|
Switch#copy running-config startup-config
|
保存当前配置
|
|
提 示:以上3种特性在多协议生成树中,只有Port Fast支持,Uplink Fast和Backbone Fast被多生成树基本功能替代,而Backbone Fast只有在CatOS中支持,所以本书中没有提供针对这两个特性的配置补助,如果需要这两种特性,请用多生成树协议规划网络。
|