Wednesday, March 11, 2015

Portfast

  • Enabled globally or per port
    • Global applies to all operational access ports
      • Cmd: spanning-tree portfast default

  • Per-port applies to a local port, if it's  operational access
    • Cmd: spanning-tree porfast
    • Can be enable for operational trunk port
      • Cmd: spanning-tree portfast trunk
  • By pass the listening and learcing States.  ( Bản chất khi enable portfast -> Switch sẽ k sinh ra bản tin TCN gửi tới root khi port đó thay đổi trạng thái ).
    • Only when transitions from a Disabled state
  • Conditional on incoming BPDUs
    • Incoming BPDU resets the operational portfast state
    • Pertfast state is maintained on a per-Vlan basic
  • Dependent features
    • BPDU guard
    • BPDU Filter

  • Portfast la feature rat manh, giup giam thoi gian runing spanning tree khi port ket noi voi end host.
    • Vi du nhu truong hop host cau hinh nhan dia chi DHCP, neu cho thoi gian hoi tu cua STP thi phai mat it nhat 30s de nhan duoc dia chi IP.
  •  
  • TEST1: config and verify portfast.

+ cho topology: IOU1, IOU2 run spanning tree vlan 10.

Config portfast:
IOU1#
interface Ethernet0/1
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
Shut down

Tien hanh "no shutdown" interface e0/1 IOU1:
IOU1#spa
*Jan 26 12:59:47.446: setting bridge id (which=3) prio 32778 prio cfg 32768 sysid 10 (on) id 800A.aabb.cc00.0100
*Jan 26 12:59:47.446: set portid: VLAN0010 Et0/1: new port id 8002
*Jan 26 12:59:47.446: STP: VLAN0010 Et0/1 ->jump to forwarding from blocking

IOU1#show span int e0/1 portfast
VLAN0010            enabled


  • TEST2: Conditional Portfast incoming BPDU
    • Cau hinh IOU1 root vlan 10
    • Interface e0/0 enable portfast.

IOU1#show span int e0/0 port
VLAN0010            enabled
  • Vi IOU1 la root nen cong e0/0 luon send BPDU
IOU1#show span int e0/0 de
 Port 1 (Ethernet0/0) of VLAN0010 is root forwarding
   Port path cost 100, Port priority 128, Port Identifier 128.1.
   Designated root has priority 20490, address aabb.cc00.0200
   Designated bridge has priority 20490, address aabb.cc00.0200
   Designated port id is 128.1, designated path cost 0
   Timers: message age 2, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   The port is in the portfast mode
   Link type is shared by default
   BPDU: sent 50, received 0

  • Cau hinh IOU2 la root vlan 10
    • IOU2#spanning-tree vlan 10 root primary

  • Interface e0/0 IOU1 se nhan BPDU
IOU1#show span int e0/0 de
 Port 1 (Ethernet0/0) of VLAN0010 is root forwarding
   Port path cost 100, Port priority 128, Port Identifier 128.1.
   Designated root has priority 20490, address aabb.cc00.0200
   Designated bridge has priority 20490, address aabb.cc00.0200
   Designated port id is 128.1, designated path cost 0
   Timers: message age 2, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   The port is in the portfast mode
   Link type is shared by default
   BPDU: sent 50, received 51


  • => Portfast se disable
IOU1#show span int e0/0 port
VLAN0010          disable

  • Shut down port e0/0 IOU1. va no sh thi port se chuyen ngay sang trang thai forwarding. Co nghia la portfast chi bi disable operting  khi nhan duoc goi tin BPDU incoming

  • TEST3:  Only when transitions from a Disabled state


  • Cau hinh nhu sau:
    • IOU2 root vlan 10
    • Interace e0/0 , e0/2 IOU1 enable portfast
    • Tat ca cac port cau hinh mode access vlan 10

IOU1(config-if-range)#shut
*Jan 26 13:47:18.922: %LINK-5-CHANGED: Interface Ethernet0/0, changed state to administratively down
*Jan 26 13:47:18.931: %LINK-5-CHANGED: Interface Ethernet0/2, changed state to administratively down
*Jan 26 13:47:19.929: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to down
*Jan 26 13:47:19.938: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed state to down
IOU1(config-if-range)#no sh
*Jan 26 13:47:24.015: setting bridge id (which=3) prio 24586 prio cfg 24576 sysid 10 (on) id 600A.aabb.cc00.0100
*Jan 26 13:47:24.015: set portid: VLAN0010 Et0/0: new port id 8001
*Jan 26 13:47:24.015: STP: VLAN0010 Et0/0 ->jump to forwarding from blocking
*Jan 26 13:47:24.015: set portid: VLAN0010 Et0/2: new port id 8003
*Jan 26 13:47:24.015: STP: VLAN0010 Et0/2 ->jump to forwarding from blocking
IOU1(config-if-range)#do show span vlan 10

VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    20490
             Address     aabb.cc00.0200
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    24586  (priority 24576 sys-id-ext 10)
             Address     aabb.cc00.0100
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  15  sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/2               Root FWD 100       128.3    Shr

  • STEP1: khi "no shut" port e0/0 và e0/2 enable portfast sẽ chuyển sang trạng thai forwarding vai trò ROOT ngay lập tức.

IOU1(config-if-range)#
*Jan 26 13:47:25.561: STP: VLAN0010 heard root 20490-aabb.cc00.0200 on Et0/0
*Jan 26 13:47:25.561:     supersedes 24586-aabb.cc00.0100
*Jan 26 13:47:25.561: STP: VLAN0010 new root is 20490, aabb.cc00.0200 on port Et0/0, cost 100
*Jan 26 13:47:25.567: STP: VLAN0010 sent Topology Change Notice on Et0/0
*Jan 26 13:47:25.567: STP[10]: Generating TC trap for port Ethernet0/2
*Jan 26 13:47:25.567: STP: VLAN0010 Et0/2 -> blocking
*Jan 26 13:47:26.017: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
*Jan 26 13:47:26.017: %LINK-3-UPDOWN: Interface Ethernet0/2, changed state to up
*Jan 26 13:47:27.023: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
*Jan 26 13:47:27.023: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/2, changed state to up

IOU1(config-if-range)#do show span vlan 10

VLAN0010
  Spanning tree enabled protocol ieee
  Root ID    Priority    20490
             Address     aabb.cc00.0200
             Cost        100
             Port        1 (Ethernet0/0)
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    24586  (priority 24576 sys-id-ext 10)
             Address     aabb.cc00.0100
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  15  sec

Interface           Role Sts Cost      Prio.Nbr Type
------------------- ---- --- --------- -------- --------------------------------
Et0/0               Root FWD 100       128.1    Shr
Et0/2               Altn BLK 100       128.3    Shr

  • STEP2: Vì IOU2 là root nên IOU1 sẽ nhận được gói tin BPDU từ 2 e0/0 và e0/2.--> IOU1 biết loop xảy ra chuyển ngay trạng thái port e0/2 sang block
  • Đồng thời disable operating portfast ở port e0/0 và e0/2.

  • Tiến hành "shut down" interface e0/0 IOU1.

IOU1(config)#int e0/0
IOU1(config-if)#shut
*Jan 26 13:54:47.146: STP: VLAN0010 new root port Et0/2, cost 100
*Jan 26 13:54:47.146: STP: VLAN0010 Et0/2 -> listening
*Jan 26 13:54:47.146: STP[10]: Generating TC trap for port Ethernet0/0
*Jan 26 13:54:49.145: %LINK-5-CHANGED: Interface Ethernet0/0, changed state to administratively down
*Jan 26 13:54:49.155: STP: VLAN0010 sent Topology Change Notice on Et0/2
*Jan 26 13:54:50.146: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to down
*Jan 26 13:55:02.152: STP: VLAN0010 Et0/2 -> learning
*Jan 26 13:55:17.152: STP[10]: Generating TC trap for port Ethernet0/2
*Jan 26 13:55:17.152: STP: VLAN0010 Et0/2 -> forwarding


=> Port e0/2 tiến hành chạy STP normal (vì portfast đã bị disable khi nhận BPDU incoming ở trên) trải qua các quá trình STP -> forwarding. Vậy portfast operating khi và chỉ khi ở trạng thái disable

No comments:

Post a Comment