STP Portfast

Spanning-tree Portfast ist auch eins der Features das sicherlich jeder kennt. Im wesentlichen überspringt es beim hochnehmen eines Ports die Listening (15s) und Learning (15s) Phase und geht direkt in den Forward (oder blocking!) mode.

Ohne Portfast:

CAT2(config)#int fa0/12
CAT2(config-if)#no spanning-tree portfast 

CAT2(config-if)#shut
CAT2(config-if)#
*Apr 20 22:56:43.690: %LINK-5-CHANGED: Interface FastEthernet0/12, changed state to administratively down
*Apr 20 22:56:44.697: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/12, changed state to down

CAT2(config-if)#do sh span int fa0/12
no spanning tree info available for FastEthernet0/12 

CAT2(config-if)#no shut

CAT2(config-if)#UPDOWN: Interface FastEthernet0/12, changed state to up
*Apr 20 22:57:27.303: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/12, changed state to up
CAT2(config-if)#do sh span int fa0/12     

Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0005            Desg LIS 19        128.14   P2p 
CAT2(config-if)#


CAT2(config-if)#do sh span int fa0/12

Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0005            Desg LRN 19        128.14   P2p 


CAT2(config-if)#do sh span int fa0/12

Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0005            Desg FWD 19        128.14   P2p 

Mit Portfast:

CAT2(config-if)#spanning-tree portfast 

CAT2(config-if)#shut
CAT2(config-if)#no shut

*Apr 20 23:01:39.196: %LINK-3-UPDOWN: Interface FastEthernet0/20 23:01:40.202: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/12, changed state to down
CAT2(config-if)#do sh span int fa0/12  
*Apr 20 23:01:43.021: %LINK-3-UPDOWN: Interface FastEthernet0/12, changed state to up
*Apr 20 23:01:44.028: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/12, changed state to up
CAT2(config-if)#do sh span int fa0/12

Vlan                Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
VLAN0005            Desg FWD 19        128.14   P2p Edge 

 

 

Global aktivieren:

CAT2(config)#spanning-tree portfast default ?
  <cr>

CAT2(config)#spanning-tree portfast default 
%Warning: this command enables portfast by default on all interfaces. You
 should now disable portfast explicitly on switched ports leading to hubs,
 switches and bridges as they may create temporary bridging loops.

Pro Port aktivieren:

CAT2(config)#int fa0/9
CAT2(config-if)#spanning-tree portfast 
%Warning: portfast should only be enabled on ports connected to a single
 host. Connecting hubs, concentrators, switches, bridges, etc... to this
 interface  when portfast is enabled, can cause temporary bridging loops.
 Use with CAUTION

%Portfast has been configured on FastEtherne when the interface is in a non-trunking mode.
CAT2(config-if)#


Was ist zu beachten:

  • Sollte nur auf Accessports aktiviert werden
  • Kann temporär Loops verursachen
  • Sollte im Zusammenhang mit BPDU Guard auf Accessports konfiguriert werden

 

Beispiel eines temporären Loops:

 

CAT2(config-if)#no shut

*Apr 20 23:07:05.806: %LINK-3-UPDOWN: Interface FastEthernet0/23
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to up

*Apr 20 23:07:08.675: %SPANTREE-2-BLOCK_BPDUGUAR
CAT2#D: Received BPDU on port Fa0/23 with BPDU Guard enabled. Disabling port.
*Apr 20 23:07:08.675: %PM-4-ERR_DISABLE: bpduguard error detected on Fa0/23, putting Fa0/23 in err-disable state
CAT2#
*Apr 20 23:07:09.707: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23, changed state to down

Obwohl der Port sofort auf err-disabled geht. Gibt es aus der Sicht von CAT3 kurzzeitig einen Loop:

CAT3(config-if)#
*Apr 20 22:43:01.967: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.0c9f.f001 in vlan 11 is flapping between port Fa0/22 and port Fa0/20
*Apr 20 22:43:02.337: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.0c9f.f001 in vlan 15 is flapping between port Fa0/22 and port Fa0/20
*Apr 20 22:43:02.337: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.0c9f.f002 in vlan 12 is flapping between port Fa0/22 and port Fa0/20
*Apr 20 22:43:02.404: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.0c9f.f001 in vlan 13 is flapping between port Fa0/22 and port Fa0/2
CAT3(config-if)#0
*Apr 20 22:43:02.471: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.0c9f.f002 in vlan 14 is flapping between port Fa0/22 and port Fa0/20
*Apr 20 22:43:02.538: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.0c9f.f002 in vlan 16 is flapping between port Fa0/22 and port Fa0/20
CAT3(config-if)#
*Apr 20 22:43:07.068: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.0c9f.f002 in vlan 16 is flapping between port Fa0/22 and port Fa0/20
*Apr 20 22:43:07.068: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.0c9f.f001 in vlan 15 is flapping between port Fa0/20 and port Fa0/22
*Apr 20 22:43:07.101: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.0c9f.f001 in vlan 13 is flapping between port Fa0/22 and port Fa0/20
*Apr 20 22:43:07.168: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.0c9f.f001 in vlan 11 is flapping between port Fa0/22 and port Fa0/2
CAT3(config-if)#0
*Apr 20 22:43:07.168: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.0c9f.f002 in vlan 14 is flapping between port Fa0/20 and port Fa0/22
*Apr 20 22:43:07.269: %SW_MATM-4-MACFLAP_NOTIF: Host 0000.0c9f.f002 in vlan 12 is flapping between port Fa0/22 and port Fa0/20
CAT3(config-if)#

 

Samuel Heinrich
Senior Network Engineer at Selution AG (Switzerland)
Arbeitet in Raum Basel (Switzerland) als Senior Network Engineer mit über 15 Jahren Erfahrung im Bereich Netzwerk

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.