• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Xin chào ! Nếu đây là lần đầu tiên bạn đến với diễn đàn, xin vui lòng danh ra một phút bấm vào đây để đăng kí và tham gia thảo luận cùng VnPro.

Announcement

Collapse
No announcement yet.

CCNP Switching Lab: Rapid Spanning Tree (rất dài)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CCNP Switching Lab: Rapid Spanning Tree (rất dài)

    Mô tả:

    Bài thực hành sử dụng 3 switch Catalyst 3550, thực hành về những ích lợi của RSTP so với STP thông thường. Bài lab sẽ xem xét những vấn đề như các state của RSTP, cách cấu hình, thời gian hội tụ, cách chuyển đổi giữa các trạng thái.


    Cấu hình:

    RootSwitch
    version 12.1
    !
    hostname Root
    !
    enable password cisco
    !
    !
    spanning-tree mode mst <- Bật tính năng RSTP trên switch này
    spanning-tree extend system-id
    !
    interface FastEthernet0/1
    switchport mode access
    spanning-tree link-type point-to-point <- bật kiểu liên kết trên interface này là P2P
    !
    interface FastEthernet0/2
    switchport mode access
    no ip address
    spanning-tree link-type point-to-point
    !
    interface FastEthernet0/3
    switchport mode access
    no ip address
    spanning-tree link-type point-to-point
    !
    interface Vlan1
    ip address 192.168.1.1 255.255.255.0
    !
    end

    SwitchA
    !
    version 12.1
    !
    hostname SwitchA
    ip subnet-zero
    !
    spanning-tree mode mst
    spanning-tree extend system-id
    spanning-tree vlan 1 priority 61440 <-- bảo đảm Root Switch là switch
    spanning-tree mst 0 priority 61440
    !
    !
    !
    interface FastEthernet0/1
    switchport mode access
    no ip address
    spanning-tree link-type point-to-point
    !
    interface FastEthernet0/2
    switchport mode access
    no ip address
    spanning-tree link-type point-to-point
    spanning-tree cost 18
    !
    interface FastEthernet0/4
    switchport mode access
    no ip address
    spanning-tree link-type point-to-point
    !
    interface FastEthernet0/6
    switchport mode access
    no ip address
    spanning-tree portfast
    !
    interface FastEthernet0/7
    switchport mode access
    no ip address
    spanning-tree portfast
    !
    interface FastEthernet0/8
    switchport mode access
    no ip address
    spanning-tree portfast
    !
    interface FastEthernet0/9
    switchport mode access
    no ip address
    spanning-tree portfast
    !
    interface FastEthernet0/10
    switchport mode access
    no ip address
    spanning-tree portfast
    !
    interface FastEthernet0/11
    switchport mode access
    no ip address
    !
    interface FastEthernet0/12
    switchport mode access
    no ip address
    !
    !
    interface Vlan1
    ip address 192.168.1.2 255.255.255.0
    !
    ip classless
    ip http server
    end

    SwitchB
    !
    hostname SwitchB
    !
    ip subnet-zero
    !
    spanning-tree mode mst
    spanning-tree extend system-id
    spanning-tree vlan 1 priority 61440 <-- bảo đảm Root Switch là switch
    spanning-tree mst 0 priority 61440
    !
    interface FastEthernet0/1
    switchport mode access
    !
    interface FastEthernet0/2
    switchport mode access
    spanning-tree link-type point-to-point
    !
    interface FastEthernet0/3
    switchport mode access
    spanning-tree link-type point-to-point
    !
    interface FastEthernet0/4
    switchport mode access
    !
    interface FastEthernet0/5
    switchport mode access
    !
    interface FastEthernet0/6
    switchport mode access
    !
    interface FastEthernet0/7
    switchport mode access
    !
    interface FastEthernet0/8
    switchport mode access
    !
    interface GigabitEthernet0/1
    switchport mode dynamic desirable
    !
    interface GigabitEthernet0/2
    switchport mode dynamic desirable
    !
    interface Vlan1
    ip address 192.168.1.3 255.255.255.0
    !
    !
    end

    Thực hiện:

    1. Cấu hình switch root, bật tính năng RSTP trên switch này, mặc định switch sẽ chạy PVST, do đó để thay đổi và cho phép chạy RSTP, ta phải bật MST lên, vì khi bật MST thì sẽ kích hoạt luôn cả RSTP.

    Root(config)#spanning-tree mode mst

    Sau đó, cấu hình trên các liên kết của switch ở dạng liên kết P2P.

    Root(config)#int fa0/1
    Root(config-if)#spanning-tree link-type point-to-point
    Root(config-if)#int fa0/2
    Root(config-if)#spanning-tree link-type point-to-point
    Root(config-if)#int fa0/3
    Root(config-if)#spanning-tree link-type point-to-point

    Chú ý: Một trong những chi tiết giúp tăng tốc độ hội tụ của RSTP là nó đặt ra 2 thông sồ: edge port và link-type.

    Edge port: là các port được kết nối với end user, và do đó sẽ không nhận các BPDU trên các kết nối này, ở RSTP thì edge port được xem là các port có bât tính năng portfast, tuy nhiên có 1 điểm cải tiến là, không giống như portfast bình thường, edge port khi nhận được BPDU sẽ tự động chuyển sang trạng thái port bình thường chứ không bị shutdown như portfast của STP.Khi có sự thay đổi topo thì các portfast sẽ không bị tác động, và switch chỉ block những non-edgeport khi có ự thay đổi diễn ra.

    · Link-Type: thông số thứ 2 là link type, khi có sự thay đổi diễn ra thì các port được cấu hình ở liên kết p2p sẽ nhanh chóng chuyển dịch trạng thái(sẽ được khảo sát sau), mà không mất thời gian listenning, learning. Mặc định các liện kết full-duplex sẽ là P2P, còn half-duplex sẽ là sharelink.Khi có sự thay đổi xảy ra, sẽ có các gói tin proposal và agreement được trao đổi trên liên kết p2p, và nhanh chóng sẽ biết được trạng thái port của nó mà không cần tính toán lại STP.

    2. Cấu hình tương tự trên 2 switch A,B, chỉ khác là ta phải xác định lại bridgeID để đảm bảo root luôn là root:

    SwitchA(config)#spanning-tree mode mst
    SwitchA(config)#spanning-tree vlan 1 priority 61440
    SwitchA(config)#spanning-tree mst 0 priority 61440
    Sau đó cấu hình link type P2P trên các port 1,2,4 của switch A, và các port 2,3 của switchB.

    Kiểm tra:

    Để tiến hành kiểm tra, ta bật service timestamp trên các switch để xem các thông số thời gian khi debug.Bật debug spanning-tree mst roles trên các switch.

    Các cách thử:
    Trên switchA:
    · Switch A có 2 liên kết đến root, ta thử dựt 1 trong 2 liên kết đến root, dựt cả 2 liên kết, rồi xem sự chuyển dịch trạng thái trên switch.Cắm 1 pc vào các edge port.
    SwitchA(config)#service timestamps
    SwitchA#debug spannin mst role
    SwitchA#sh spa

    MST00
    Spanning tree enabled protocol mstp
    Root ID Priority 32768
    Address 000d.bc33.2b00
    Cost 0
    Port 1 (FastEthernet0/1)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 61440 (priority 61440 sys-id-ext 0)
    Address 000d.bd29.d080
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Interface Role Sts Cost Prio.Nbr Type
    ---------------- ---- --- --------- -------- --------------------------------
    Fa0/1 Root FWD 200000 128.1 P2p
    Fa0/2 Altn BLK 18 128.2 P2p
    Fa0/4 Altn BLK 200000 128.4 P2p
    Ta thấy hiện tại các port 2,4 trên switchA đang ở chức năng Alternate và trạng thái là block, nguyên nhân là do nó đã có 1 đường đến root là qua port 1.
    Sau đó, ta dựt port 1 ra, xem debug:
    01:16:24: MSTP(0): updt roles
    01:16:24: MSTP(0): Fa0/4 is now root port<--port 4 lập tức chuyển lên trạng thái forwarding
    01:16:24: MSTP(0): Fa0/1 is now alternate
    01:16:25: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
    01:16:26: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down
    Sau đó cắm lại port 1, xem debug:
    01:16:35: MSTP(0): Fa0/1 is now designated
    01:16:35: MSTP(0): updt roles
    01:16:35: MSTP(0): Fa0/1 is now root port<--lập tức port 1 chuyển thành root
    01:16:35: MSTP(0): Fa0/4 is now alternate<-- và port 4 chuyển về trạng thái block
    01:16:37: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
    01:16:38: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
    Sau đó, tương tự dựt, và cắm lại port 4
    01:17:47: MSTP(0): Fa0/4 is now designated
    01:17:47: MSTP(0): updt roles
    01:17:47: MSTP(0): Fa0/4 is now alternate<--port 4 vẫn ở alternate, port 1 vẫn là root
    01:17:48: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down
    01:17:49: %LINK-3-UPDOWN: Interface FastEthernet0/4, changed state to down

    Sau đó cắm 1 pc vào port 9, sau đó dựt port 1:

    SwitchA#
    01:18:16: MSTP(0): updt roles
    01:18:16: MSTP(0): Fa0/4 is now root port
    01:18:16: MSTP(0): Fa0/1 is now alternate
    01:18:17: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
    01:18:18: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down
    SwitchA#sh spa

    MST00
    Spanning tree enabled protocol mstp
    Root ID Priority 32768
    Address 000d.bc33.2b00
    Cost 0
    Port 4 (FastEthernet0/4)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 61440 (priority 61440 sys-id-ext 0)
    Address 000d.bd29.d080
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Interface Role Sts Cost Prio.Nbr Type
    ---------------- ---- --- --------- -------- --------------------------------
    Fa0/2 Altn BLK 18 128.2 P2p
    Fa0/4 Root FWD 200000 128.4 P2p
    Fa0/9 Desg FWD 200000 128.9 Edge P2p
    Sau đó cắm lại port 1:
    SwitchA#
    01:19:13: MSTP(0): Fa0/1 is now designated
    01:19:13: MSTP(0): updt roles
    01:19:13: MSTP(0): Fa0/1 is now root port
    01:19:13: MSTP(0): Fa0/4 is now alternate
    01:19:15: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
    01:19:16: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
    SwitchA#
    SwitchA#sh spa

    MST00
    Spanning tree enabled protocol mstp
    Root ID Priority 32768
    Address 000d.bc33.2b00
    Cost 0
    Port 1 (FastEthernet0/1)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 61440 (priority 61440 sys-id-ext 0)
    Address 000d.bd29.d080
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Interface Role Sts Cost Prio.Nbr Type
    ---------------- ---- --- --------- -------- --------------------------------
    Fa0/1 Root FWD 200000 128.1 P2p
    Fa0/2 Altn BLK 18 128.2 P2p
    Fa0/4 Altn BLK 200000 128.4 P2p
    Fa0/9 Desg FWD 200000 128.9 Edge P2p
    Cuối cùng dựt cả 2 port1,4, xem nó có chuyển qua port 2 để về root hay không:
    SwitchA#
    01:19:29: MSTP(0): updt roles
    01:19:29: MSTP(0): Fa0/4 is now root port
    01:19:29: MSTP(0): Fa0/1 is now alternate
    01:19:30: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
    01:19:31: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down
    SwitchA#
    01:19:39: MSTP(0): updt roles
    01:19:39: MSTP(0): Fa0/2 is now root port
    01:19:39: MSTP(0): Fa0/4 is now alternate
    01:19:40: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down
    01:19:41: %LINK-3-UPDOWN: Interface FastEthernet0/4, changed state to down
    Ta thấy, ngay lập tức sau khi dựt port1,4 switch chuyển liền sang port 2 làm root.
    Trên switchB:
    Ta cũng thử tương tự:
    Dựt port3, xem nó có chuyển sang port 2 để về switch root hay không:
    SwitchB#sh spa

    MST00
    Spanning tree enabled protocol mstp
    Root ID Priority 32768
    Address 000d.bc33.2b00
    Cost 0
    Port 3 (FastEthernet0/3)
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Bridge ID Priority 61440 (priority 61440 sys-id-ext 0)
    Address 000d.299a.7e00
    Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

    Interface Role Sts Cost Prio.Nbr Type
    ---------------- ---- --- --------- -------- --------------------------------
    Fa0/2 Desg FWD 200000 128.2 P2p
    Fa0/3 Root FWD 200000 128.3 P2p
    witchB#
    01:23:24: MSTP(0): updt roles
    01:23:24: MSTP(0): updt roles
    01:23:24: MSTP(0): Fa0/2 is now root port
    01:23:25: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down
    SwitchB#
    01:23:26: %LINK-3-UPDOWN: Interface FastEthernet0/3, changed state to down
    Ngay lập tức nó sẽ chuyển port 2 làm root port khi tháo cáp port 3 ra.

    Cắm lại port 3:
    SwitchB#
    01:23:37: MSTP(0): Fa0/3 is now designated
    01:23:37: MSTP(0): updt roles
    01:23:37: MSTP(0): Fa0/3 is now root port
    01:23:37: MSTP(0): Fa0/2 is now designated
    SwitchB#
    01:23:39: %LINK-3-UPDOWN: Interface FastEthernet0/3, changed state to up
    01:23:40: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up
    Email : vnpro@vnpro.org
    ---------------------------------------------------------------------------------------------------------------
Trung Tâm Tin Học VnPro
149/1D Ung Văn Khiêm P25 Q.Bình thạnh TPHCM
Tel : (08) 35124257 (5 lines)
Fax: (08) 35124314

Home page: http://www.vnpro.vn
Support Forum: http://www.vnpro.org
- Chuyên đào tạo quản trị mạng và hạ tầng Internet
- Phát hành sách chuyên môn
- Tư vấn và tuyển dụng nhân sự IT
- Tư vấn thiết kế và hỗ trợ kỹ thuật hệ thống mạng

Network channel: http://www.dancisco.com
Blog: http://www.vnpro.org/blog

  • #2
    Admin ơi dùng GNS3 hay Packet Tracer vậy
    Up giùm sơ đồ mạng với
    thank so much

    Comment


    • #3
      Hiện tại thì GNS3 chưa có thể giả lập được SW đâu bạn
      Last edited by Networking; 28-11-2011, 07:04 PM.
      Khô mực - Mực 1 nắng - Hải Sản - Nước mắm nhỉ cá cơm Phan Thiết

      Cơ sở sản xuất: 26 Nguyễn Thông, Phú Hải, Phan Thiết, Bình Thuận.

      Đại lý phân phối: 714/4 Xô Viết Nghệ Tĩnh, P.25, Q.Bình Thạnh, Tp.HCM.

      Mobile : 0949 78 87 94

      :)RẤT HÂN HẠNH ĐƯỢC ĐÓN TIẾP:)

      Comment


      • #4
        hic sao hinh không thấy :((?

        Comment


        • #5
          Packet Tracer Catalyst 3550 hướng dẫn thêm giúp mình với và có mô hình mạng nữa mới dể hiểu bạn ơi :D

          Comment

          • Working...
            X