分别配置stp的三个增强功能,观察配置前后端口启动时间的变化
interface FastEthernet0/48
switchport mode dynamic desirable
spanning-tree portfast
spanning-tree uplinkfast
spanning-tree backbonefast
S2#sho run
spanning-tree backbonefast
S3#sho run
spanning-tree backbonefast
在配置stp portfast功能之前,开启交换机的端口后,通过debug可看到,端口状态由disable—listening—learning—forwarding
S1#debug spanning-tree events
Spanning Tree event debugging is on
S1#
*Mar 1 00:16:09.091: %LINK-3-UPDOWN: Interface FastEthernet0/48, changed state to up
*Mar 1 00:16:10.091: set portid: VLAN0001 Fa0/48: new port id 8030
*Mar 1 00:16:10.095: STP: VLAN0001 Fa0/48 -> listening
*Mar 1 00:16:10.095: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/48, changed state to up
*Mar 1 00:16:25.095: STP: VLAN0001 Fa0/48 -> learning
*Mar 1 00:16:40.095: STP: VLAN0001 sent Topology Change Notice on Fa0/20
*Mar 1 00:16:40.095: STP: VLAN0001 Fa0/48 -> forwarding
在fa0/29端口开启portfast后,可看到该端口直接进入转发状态
S1(config)#int fa0/48
S1(config-if)#no shut
S1(config-if)#
*Mar 1 00:23:54.167: %LINK-3-UPDOWN: Interface FastEthernet0/48, changed state to up
*Mar 1 00:23:56.715: set portid: VLAN0001 Fa0/48: new port id 8030
*Mar 1 00:23:56.719: STP: VLAN0001 Fa0/48 ->jump to forwarding from blocking
*Mar 1 00:23:57.719: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/48, changed state to up
在接入层交换机上配置uplinkfast之前,shut S1 fa0/20,通过debug观察S1的fa0/24接口
S1#debug spanning-tree events
Spanning Tree event debugging is on
S1#
*Mar 1 00:46:36.939: STP: VLAN0001 new root port Fa0/24, cost 38
*Mar 1 00:46:36.939: STP: VLAN0001 Fa0/24 -> listening
*Mar 1 00:46:37.939: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/20, changed state to down
*Mar 1 00:46:38.939: STP: VLAN0001 sent Topology Change Notice on Fa0/24
*Mar 1 00:46:38.947: %LINK-3-UPDOWN: Interface FastEthernet0/20, changed state to down
*Mar 1 00:46:51.939: STP: VLAN0001 Fa0/24 -> learning
*Mar 1 00:47:06.939: STP: VLAN0001 sent Topology Change Notice on Fa0/24
*Mar 1 00:47:06.939: STP: VLAN0001 Fa0/24 -> forwarding
通过show spanning-tree vlan 1 可发现fa0/24已经成为根端口
S1#sho spanning-tree vlan 1
Fa0/13 Desg FWD 3100 128.13 Shr
Fa0/14 Desg FWD 3100 128.14 Shr
Fa0/24 Root FWD 3019 128.24 P2p
Fa0/48 Desg FWD 3019 128.48 P2p Edge
当故障恢复后,可发现fa0/20又恢复到root port状态,而fa0/24也恢复到Altn状态
S1#sho spanning-tree vlan 1
------------------- ---- --- --------- -------- --------------------------------
Fa0/14 Desg FWD 100 128.14 Shr
Fa0/20 Root FWD 19 128.20 P2p
Fa0/24 Altn BLK 19 128.24 P2p
Fa0/48 Desg FWD 19 128.48 P2p Edge
开启接入层交换机的uplinkfast功能,仍通过debug查看端口状态变化S1(config)#spanning-tree uplinkfast
S1#debug spanning-tree events
Spanning Tree event debugging is on
S1#
*Mar 1 01:04:26.599: STP: VLAN0001 new root port Fa0/24, cost 3038
*Mar 1 01:04:26.599: %SPANTREE_FAST-7-PORT_FWD_UPLINK: VLAN0001 FastEthernet0/24 moved to Forwarding (UplinkFast).
*Mar 1 01:04:27.599: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/20, changed state to down
*Mar 1 01:04:28.599: STP: VLAN0001 sent Topology Change Notice on Fa0/24
*Mar 1 01:04:28.607: %LINK-3-UPDOWN: Interface FastEthernet0/20, changed state to down
此时查看端口角色的变化:
S3#sho spanning-tree
------------------- ---- --- --------- -------- --------------------------------
Fa0/21 Desg FWD 19 128.21 P2p
S1#sho spanning-tree
------------------- ---- --- --------- -------- --------------------------------
Fa0/13 Desg FWD 3100 128.13 Shr
Fa0/14 Desg FWD 3100 128.14 Shr
Fa0/24 Root FWD 3019 128.24 P2p
Fa0/48 Desg FWD 3019 128.48 P2p Edge
恢复故障后,
*Mar 1 01:13:00.875: %LINK-3-UPDOWN: Interface FastEthernet0/20, changed state to up
*Mar 1 01:13:01.875: set portid: VLAN0001 Fa0/20: new port id 8014
*Mar 1 01:13:01.879: STP: VLAN0001 Fa0/20 -> listening
*Mar 1 01:13:01.995: STP: VLAN0001 Fa0/20: root port delay timer active
*Mar 1 01:13:01.995: STP: VLAN0001 Fa0/20 -> blocking
*Mar 1 01:13:02.879: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/20, changed state to up
S1#
*Mar 1 01:13:36.995: STP: VLAN0001 new root port Fa0/20, cost 3019
*Mar 1 01:13:36.995: STP: VLAN0001 Fa0/24 -> blocking (uplinkfast)
*Mar 1 01:13:36.995: %SPANTREE_FAST-7-PORT_FWD_UPLINK: VLAN0001 FastEthernet0/20 moved to Forwarding (UplinkFast).
*Mar 1 01:13:36.995: STP: VLAN0001 sent Topology Change Notice on Fa0/20
所有端口角色都恢复到原状态
开启该功能之前,关闭S3 fa0/21,观察S1 fa0/24状态变化:
S1(config)#
*Mar 1 01:52:35.039: STP: VLAN0001 heard root 32769-000e.d 786.1a 80 on Fa0/24
*Mar 1 01:52:36.867: STP: VLAN0001 heard root 32769-000e.d 786.1a 80 on Fa0/24
*Mar 1 01:52:38.867: STP: VLAN0001 heard root 32769-000e.d 786.1a 80 on Fa0/24
*Mar 1 01:52:40.867: STP: VLAN0001 heard root 32769-000e.d 786.1a 80 on Fa0/24
*Mar 1 01:52:42.867: STP: VLAN0001 heard root 32769-000e.d 786.1a 80 on Fa0/24
*Mar 1 01:52:44.867: STP: VLAN0001 heard root 32769-000e.d 786.1a 80 on Fa0/24
*Mar 1 01:52:46.867: STP: VLAN0001 heard root 32769-000e.d 786.1a 80 on Fa0/24
*Mar 1 01:52:48.867: STP: VLAN0001 heard root 32769-000e.d 786.1a 80 on Fa0/24
*Mar 1 01:52:50.867: STP: VLAN0001 heard root 32769-000e.d 786.1a 80 on Fa0/24
*Mar 1 01:52:52.867: STP: VLAN0001 heard root 32769-000e.d 786.1a 80 on Fa0/24 -----MAX-AGE ???
*Mar 1 01:52:53.043: STP: VLAN0001 Fa0/24 -> listening
*Mar 1 01:52:54.043: STP: VLAN0001 Topology Change rcvd on Fa0/24
*Mar 1 01:52:54.043: STP: VLAN0001 sent Topology Change Notice on Fa0/20
*Mar 1 01:53:08.043: STP: VLAN0001 Fa0/24 -> learning
*Mar 1 01:53:23.043: STP: VLAN0001 sent Topology Change Notice on Fa0/20
*Mar 1 01:53:23.043: STP: VLAN0001 Fa0/24 -> forwarding
开启backbonefast,再次观察:发现直接跳过block状态
S1(config)#spanning-tree backbonefast
S2(config)#spanning-tree backbonefast
S3(config)#spanning-tree backbonefast
S1#
*Mar 1 02:03:55.447: STP: VLAN0001 heard root 32769-000e.d 786.1a 80 on Fa0/24
*Mar 1 02:03:55.503: STP: VLAN0001 Fa0/24 -> listening
*Mar 1 02:03:56.055: STP: VLAN0001 Topology Change rcvd on Fa0/24
*Mar 1 02:03:56.055: STP: VLAN0001 sent Topology Change Notice on Fa0/20
*Mar 1 02:04:10.503: STP: VLAN0001 Fa0/24 -> learning
*Mar 1 02:04:25.503: STP: VLAN0001 sent Topology Change Notice on Fa0/20
*Mar 1 02:04:25.503: STP: VLAN0001 Fa0/24 -> forwarding
本文出自 “思科之家” 博客,转载请与作者联系!