I/Tổng quan :
Mục tiêu của bài viết này là xem các thực thi MSTP của Switch , qua đó chúng ta có thể
thử được sự hoạt động của RSTP bằng cách nối thêm 1 đường fa0/5 của Sw3 vào Sw1 .
Như vậy trong bài lab này chúng ta có thể được cả hai loại protocol trên
II/Các bước cấu hình :
Ta sử dụng 2 Switch 3550 và 2 Switch 2950 ,các Switch này đề nằm trong VTP doamin
là vnpro , VTP mode của 2 Sw1 , Sw 2 là Server còn Sw3 là mode client .
Bước 1 : Xoá cấu hình cũ Switch , khi khởi động vào
Bước 2 : Cấu hình trunk giữa các Switch : ta cấu hình như sau
Sw1(config)#int fa0/1
Sw1(config-if)#switchport trunk encapsulation dot1q
Sw1(config-if)#switchport mode trunk
Sw1(config)#int fa0/3
Sw1(config-if)#switchport trunk encapsulation dot1q
Sw1(config-if)#switchport mode trunk
Sw2(config)#int fa0/1
Sw2(config-if)#switchport trunk encapsulation dot1q
Sw2(config-if)#switchport mode trunk
Sw2(config)#int fa0/3
Sw2(config-if)#switchport trunk encapsulation dot1q
Sw2(config-if)#switchport mode trunk
Giống như Sw1, Sw2 . Sw3 cấu hình tương tự .
Bước 3 : Bây giờ ta bắt đầu tạo các Vlan tại Sw1
Trước khi cấu hình Vlan , ta cấu hình vtp mode của Sw1, Sw2 là server . Sw3 là client .
Cả ba đều có domain là vnpro .
Sw1#vlan database
Sw1(vlan)#vtp m server
Device mode already VTP SERVER.
Sw1(vlan)#vtp do
Sw1(vlan)#vtp domain vnpro
Changing VTP domain name from NULL to vnpro
Sw1(vlan)#apply
APPLY completed.
Sw1(vlan)#exit
APPLY completed
Sw2#vlan database
Sw2(vlan)#vtp server
Device mode already VTP SERVER.
Sw2(vlan)#vtp do
Sw2(vlan)#vtp domain vnpro
Domain name already set to vnpro .
Sw2(vlan)#apply
APPLY completed.
Sw2(vlan)#con exit
APPLY completed.
Exiting
Sw3#vlan database
Sw3(vlan)#vtp client
Setting device to VTP CLIENT mode.
Sw3(vlan)#vtp domain vnpro
Domain name already set to vnpro .
Sw3(vlan)#apply
Apply not allowed when device is in CLIENT state.
Sau khi cấu hình vtp , ta cấu hình các vlan từ Switch 1 .
Sw1(vlan)#vlan 10 name Accounting
VLAN 10 added:
Name: Accounting
Sw1(vlan)#vlan 20 name Marketing
VLAN 20 added:
Name: Marketing
Sw1(vlan)#vlan 30 nane Engineering
VLAN 30 added:
Name: Engineering
Sw1(vlan)#vlan 49 name HumanResouce
VLAN 40 added:
Name: HumanResource
Sw1(vlan)#vlan 50 name GraphicDesign
VLAN 50 added:
Name: GraphicDesign
Sau đó kiểm tra các Vlan này bằng cách đánh lệnh show vlan tại các Switch
Sw2#show vlan
VLAN Name Status Ports
1 default active Fa0/2, Fa0/4, Fa0/5, Fa0/6
Fa0/7, Fa0/8, Fa0/9, Fa0/10
Fa0/11, Fa0/12, Fa0/13, Fa0/14
Fa0/15, Fa0/16, Fa0/17, Fa0/18
Fa0/19, Fa0/20, Fa0/21, Fa0/22
Fa0/23, Fa0/24, Gi0/1, Gi0/2
10 Accounting active
20 Marketing active
30 Engineering active
40 HumanResource active
50 GraphicDesign active
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active
Bước 4 : Chạy mặc định của Spanning tree là : Multiple spaning –tree sử dụng RSTP cho
sự hội tụ tức thời . Mỗi instance hoạt động độc lập với instance khác . Cấu trúc này có thể
cung cấp nhiều đường dẫn cho các traffic và chia tải .
Sw1#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 000d.299a.7e00
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 000d.299a.7e00
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300
Interface Role Sts Cost Prio.Nbr Type
Fa0/1 Desg FWD 19 128.1 P2p
Fa0/3 Desg FWD 19 128.3 P2p
Ta cấu hình MSTP trên Switch 1 , MSTP cho phép chúng ta nhóm các Vlan lại thành các
Spanning-tree instance , các spanning tree khác số instance sẽ hoạt động đọc lập với nhau
, giải pháp này là một giải pháp thực sự để chia tải vài giảm bớt được sự hoạt động quá
nhiều của Spanning-tree . MSTP chỉ hỗ trợ 16 instance , các số instance từ 1 đến 15
Từ config mode , vào mst config mode :
Sw1(config)#spanning-tree mst configuration
Sw1(config-mst)#instance 1 vlan 1-30
Sw1(config-mst)#name vnpro
Sw1(config-mst)#revision 10
Dùng lệnh show pending để xem lại .
Sw1(config-mst)#show pending
Pending MST configuration
Name [vnpro]
Revision 10
Instance Vlans mapped
0 31-4094
1 1-30
Các mst có instance 1 là chứa các Vlan 1->30 , còn instance 0 chứa tất cả các vlan còn lại
.
Tương tự cấu hình cho các Sw2, Sw 3
Sw2(config)#spanning-tree mst configuration
Sw2(config-mst)#instance 1 vlan 1-30
Sw2(config-mst)#name vnpro
Sw2(config-mst)#revision 10
Ta sử dụng show spanning-tree để xem hoạt động của các spanning-tree .
MST00
Spanning tree enabled protocol mstp
Root ID Priority 32768
Address 000d.299a.7e00
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768 (priority 32768 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/1 Desg FWD 200000 128.1 P2p
Fa0/3 Desg FWD 200000 128.3 P2p
MST01
Spanning tree enabled protocol mstp
Root ID Priority 32769
Address 000d.299a.7e00
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 000d.299a.7e00
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interface Role Sts Cost Prio.Nbr Type
Fa0/1 Desg FWD 200000 128.1 P2p
Fa0/3 Desg FWD 200000 128.3 P2p
Cả hai MST00 và MST01 đều có root brigde là switch 1 , bây giờ ta cấu hình đối với
MST00 thì root bridge là switch 2 .
Sw2(config)#spanning-tree mst 0 root primary
Dùng lệnh show spanning-tree để kiểm tra trên switch 2 lúc này .
Sw2#show spanning-tree
MST00
Spanning tree enabled protocol mstp
Root ID Priority 24576
Address 000d.bd29.d080
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 24576 (priority 24576 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 Desg FWD 200000 128.1 P2p
Fa0/3 Desg FWD 200000 128.3 P2p
MST01
Spanning tree enabled protocol mstp
Root ID Priority 24577
Address 000d.299a.7e00
Cost 200000
Port 3 (FastEthernet0/3)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
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 Altn BLK 200000 128.1 P2p
Fa0/3 Root FWD 200000 128.3 P2p
Như vậy đối với MST00 thì Switch làm root và MST01 thì vẫn là Sw1 .
Bước 5 : Thử RSTP . Bây giờ ta cắm port 5 của Sw1 với port 5 của Switch 3 , và sau đó
cấu hình “ Trunk “ cho 2 port này .
Sw1(config)#int fa0/5
Sw1(config-if)#switchport trunk encapsulation dot1q
Sw1(config-if)#switchport mode trunk
Sw3(config)#int fa0/5
Sw3(config-if)#switchport trunk encapsulation dot1q
Sw3(config-if)#switchport mode trunk
Sau khi cấu hình xong , ta show spanning-tree ở cả 2 Sw1, Sw3
Sw3#show spanning-tree
MST00
Spanning tree enabled protocol mstp
Root ID Priority 24576
Address 000d.bd29.d080
Cost 0
Port 3 (FastEthernet0/3)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768 (priority 32768 sys-id-ext 0)
Address 000d.bc33.2b00
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interface Role Sts Cost Prio.Nbr Type
Fa0/1 Altn BLK 200000 128.1 P2p
Fa0/3 Root FWD 200000 128.3 P2p
Fa0/5 Altn BLK 200000 128.5 P2p
Sw1#show spanning-tree
MST00
Spanning tree enabled protocol mstp
Root ID Priority 24576
Address 000d.bd29.d080
Cost 0
Port 1 (FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768 (priority 32768 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/1 Root FWD 200000 128.1 P2p
Fa0/3 Desg FWD 200000 128.3 P2p
Fa0/5 Desg FWD 200000 128.5 P2p
More
MST01
Spanning tree enabled protocol mstp
Root ID Priority 24577
Address 000d.299a.7e00
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 24577 (priority 24576 sys-id-ext 1)
Address 000d.299a.7e00
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Interface Role Sts Cost Prio.Nbr Type
Fa0/1 Desg FWD 200000 128.1 P2p
Fa0/3 Desg FWD 200000 128.3 P2p
Fa0/5 Desg FWD 200000 128.5 P2p
Bước tiếp theo ta dựt cáp của fa0/1 của Sw3 , lúc này root port sẽ không còn nữa , cổng
fa0/5 sẽ chuyển lên làm root port . Do link type của các liên kết là ( fa0/5 ) là p2p , nên
quá trình chuyển trạng thái sẽ bị rút gọn . Cổng fa0/5 sẽ chuyển trạng thái rất nhanh . Ta
bật các lệnh debug spanning mst role và service timestamp trong mode config .
Khi dựt cáp từ port 1 sw3
Sw3#
01:10:41: MSTP(1): Fa0/5 is now root port
01:10:41: MSTP(1): Fa0/1 is now alternate port
01:10:41: MSTP(0): updt roles
01:10:42: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1,
changed state to down
01:10:43: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down
Bây giờ ta cắm lại :
Sw3#
01:10:52: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
01:10:53: MSTP(0): Fa0/1 is now designated
01:10:53: MSTP(1): Fa0/1 is now designated portcam
01:10:53: MSTP(0): updt roles
01:10:53: MSTP(0): Fa0/1 is now alternate
01:10:53: MSTP(1): Fa0/1 is now root port
01:10:53: MSTP(1): Fa0/5 is now alternate port
Translating "cam" domain server (255.255.255.255)
% Unknown command or computer name, or unable to find computer address
Sw3#
01:10:54: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1,
changed state to up. Quá trình xảy ra rất nhanh , có thể dễ dàng theo dõi bằng các lệnh
debug . Như vậy so với STP và RSTP ta thấy RSTP nhanh hơn và tiện lợi hơn .