Hướng dẫn cấu hình STP (Spanning Tree Protocol) trên Switch Ruijie

Hướng dẫn cấu hình STP (Spanning Tree Protocol) trên Switch Ruijie

Spanning Tree là gì?

Spanning Tree Protocol (STP) là một giao thức được sử dụng để ngăn chặn một vòng lặp. Giao thức này cho phép các bridge truyền thông với nhau từ đó để phát hiện vòng lặp vật lý trong mạng. 

Topology

Cấu hình


Core switch A configuration:

Ruijie>enable //Enter privileged mode

Ruijie#configure terminal //Enter global configuration mode

Ruijie(config)#vlan 10 //create vlan 10, 20, 30 and 40

Ruijie(config-vlan)#vlan 20

Ruijie(config-vlan)#vlan 30

Ruijie(config-vlan)#vlan 40

Ruijie(config-vlan)#exit

Ruijie(config)#spanning-tree //enable spanning tree, default mode is mst

Ruijie(config)#spanning-tree mst configuration //configure mst

Ruijie(config-mst)# instance 1 vlan 10, 20 //vlan 10 and 20 use instance (instance) 1

Ruijie(config-mst)# instance 2 vlan 30, 40 //vlan 30 and 40 use instance (instance) 2

Ruijie(config-mst)#spanning-tree mst 1 priority 4096 //instance (instance) 1 has a priority of 4096, the smaller the priority the higher the priority, the default priority is 32768

Ruijie(config-mst)#exit

Ruijie(config)#interface FastEthernet 0/1

Ruijie(config-if-FastEthernet 0/1)#switch mode trunk

Ruijie(config)#interface FastEthernet 0/2

Ruijie(config-if-FastEthernet 0/2)#switch mode trunk

Core switch B configuration:

Ruijie>enable //enter privileged mode

Ruijie#configure terminal //Enter global configuration mode

Ruijie(config)#vlan 10 //create vlan 10, 20, 30 and 40

Ruijie(config-vlan)#vlan 20

Ruijie(config-vlan)#vlan 30

Ruijie(config-vlan)#vlan 40

Ruijie(config-vlan)#exit

Ruijie(config)#spanning-tree

Ruijie(config)#spanning-tree mst configuration

Ruijie(config-mst)# instance 1 vlan 10, 20

Ruijie(config-mst)# instance 2 vlan 30, 40

Ruijie(config-mst)# spanning-tree mst 2 priority 4096

Ruijie(configmst)#exit

Ruijie(config)#interface FastEthernet 0/1

Ruijie(config-if-FastEthernet 0/1)#switch mode trunk //configure the first 100-gigabit interface of the switch as trunk

Ruijie(config)#interface FastEthernet 0/2

Ruijie(config-if-FastEthernet 0/2)#switch mode trunk //Configure the second 100-gigabit interface of the switch as trunk

Accessing the switch configuration:

Ruijie>enable

Ruijie#configure terminal

Ruijie(config)#vlan 10 //create vlan 10, 20, 30 and 40

Ruijie(config-vlan)#vlan 20

Ruijie(config-vlan)#vlan 30

Ruijie(config-vlan)#vlan 40

Ruijie(config-vlan)#exit

Ruijie(config)#spanning-tree

Ruijie(config)#spanning-tree mst configuration

Ruijie(config-mst)# instance 1 vlan 10, 20

Ruijie(config-mst)# instance 2 vlan 30, 40

Ruijie(config-mst)#exit

Ruijie(config)#interface FastEthernet 0/1

Ruijie(config-if-FastEthernet 0/1)#switch mode trunk

Ruijie(config)#interface FastEthernet 0/2

Ruijie(config-if-FastEthernet 0/2)#switch mode trunk

Save the configuration

Ruijie(config)#end

Ruijie#write //Confirm the correct configuration and save the configuration

Kiểm tra lại cấu hình

1)Ruijie#show spanning-tree summary

Spanning tree enabled protocol mstp

MST 0 vlans map : 1-9, 11-19, 21-29, 31-39, 41-4094   

  Root ID    Priority    32768                             

             Address     001a.a976.9d0a            

             this bridge is root                     

             Hello Time   2 sec  Forward Delay 15 sec  Max Age 20 sec   

  Bridge ID  Priority    32768                                    

             Address     001a.a979.bc44

             Hello Time   2 sec  Forward Delay 15 sec  Max Age 20 sec

Interface        Role           Sts          Cost        Prio              Type     OperEdge

---------------- ----              ---       ----------   --------             -----      ---------------

Fa0/24           Root          FWD       200000     128               P2p          False         

Fa0/10            Altn           BLK        200000      128              P2p           False

MST 1 vlans map : 10, 20

  Region Root Priority   4096

             Address     001a.a979.bc44

             This bridge is region root

  Bridge ID  Priority    4096

             Address     001a.a979.bc44


Interface        Role Sts    Cost       Prio     Type  OperEdge

--------------- ---- --- ---------- -------- ----- ---------------

Fa0/24           Desg FWD 200000     128      P2p   False         

Fa0/10           Desg FWD 200000     128      P2p   False         

MST 2 vlans map : 30, 40

  Region Root Priority   4096

             Address     001a.a979.b880

             This bridge is region root

  Bridge ID  Priority    32768

             Address     001a.a979.bc44

Interface        Role Sts Cost       Prio     Type  OperEdge

---------------- ---- --- ---------- -------- ----- ---------------

Fa0/24           Altn BLK 200000     128      P2p   False         

Fa0/10           Root FWD 200000     128      P2p   False      

2)Ruijie#show spanning-tree mst 1

MST 1 vlans mapped : 10, 20

BridgeAddr : 001a.a979.bc44

Priority: 4096

TimeSinceTopologyChange : 0d:0h:0m:56s

TopologyChanges : 9

DesignatedRoot : 1001.001a.a979.bc44

RootCost : 0

RootPort : 0

Như vậy là chúng ta đã hoàn tất việc cấu hình. Hi vọng bài viết này sẽ giúp các bạn trong công việc. Chúc các bạn thực hiện thành công. Trong quá trình thiết lập nếu như có thắc mắc hoặc gặp sự cố hãy liên hệ đội ngũ kỹ thuật của chúng tôi để được trợ giúp một cách tốt nhất.

Hẹn gặp lại các bạn trong các bài viết tiếp theo !

CÔNG TY CỔ PHẦN DỊCH VỤ CÔNG NGHỆ DATECH

• Địa chỉ: Số 23E4 KĐT Cầu Diễn, Tổ 7, Phú Diễn, Bắc Từ Liêm, Hà Nội

• Điện thoại: 02432012368

• Hotline: 098 115 6699

• Email: info@datech.vn

• Website: https://datech.vn