Перейти к основному содержимому

2.15 Настройка MSTP

2.15.1 Введение в функцию

MSTP (Multiple Spanning Tree Protocol) - алгоритм и протокол IEEE 802.1Q-2005) позволяет сопоставлять несколько VLAN с одним экземпляром spanning-tree, что сокращает количество экземпляров spanning-tree, необходимых для поддержки большого числа VLAN. MSTP обеспечивает несколько путей для передачи данных и позволяет балансировать нагрузку. Это улучшает отказоустойчивость сети, так как сбой в одном экземпляре (пути передачи) не влияет на другие экземпляры (пути передачи). Наиболее часто MSTP внедряется на магистральных и распределительных уровнях коммутируемой сети уровня 2; это обеспечивает высокую доступность сети, необходимую в среде поставщика услуг. В режиме MST включается Rapid Spanning Tree Protocol (RSTP), основанный на IEEE 802.1w, который обеспечивает быстрое схождение spanning-tree благодаря явному обмену, устраняющему задержку IEEE 802.1D и быстро переводящему порты корневого и назначенного коммутаторов в состояние передачи.

2.15.2 Конфигурация

Настройка MSTP

Рисунок 2-25: MSTP

Рисунок 2-25: MSTP

Конфигурации для коммутаторов Switch1–Switch4 приведены ниже. Конфигурации для этих четырех коммутаторов одинаковы, если не указано иное.

Шаг 1: Войдите в режим конфигурации

Switch# configure terminal

Шаг 2: Установите режим STP

Switch(config)# spanning-tree mode mstp

Шаг 3: Войдите в режим настройки VLAN и создайте VLAN

Switch(config)# vlan database
Switch(config-vlan)# vlan 10
Switch(config-vlan)# vlan 20
Switch(config-vlan)# exit

Шаг 4: Войдите в режим настройки MSTP, создайте регион и экземпляр. Свяжите VLAN с экземпляром

Switch(config)# spanning-tree mst configuration
Switch(config-mst)# region RegionName
Switch(config-mst)# instance 1 vlan 10
Switch(config-mst)# instance 2 vlan 20
Switch(config-mst)# exit

Шаг 5: Войдите в режим настройки интерфейсов и установите атрибуты интерфейсов

Switch(config)# interface eth-0-9
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan all
Switch(config-if)# no shutdown
Switch(config-if)# exit

Switch(config)# interface eth-0-10
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan all
Switch(config-if)# no shutdown
Switch(config-if)# exit

Switch(config)# interface eth-0-17
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan all
Switch(config-if)# no shutdown
Switch(config-if)# exit

Switch(config)# interface eth-0-18
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk allowed vlan all
Switch(config-if)# no shutdown
Switch(config-if)# exit

Шаг 6: Включите STP и установите приоритет для каждого коммутатора

Switch1:

Switch# configure terminal
Switch(config)# spanning-tree priority 0
Switch(config)# spanning-tree enable

Switch2:

Switch# configure terminal
Switch(config)# spanning-tree instance 1 priority 0
Switch(config)# spanning-tree enable

Switch3:

Switch# configure terminal
Switch(config)# spanning-tree instance 2 priority 0
Switch(config)# spanning-tree enable

Switch4:

Switch# configure terminal
Switch(config)# spanning-tree enable

Шаг 7: Выйдите из режима конфигурации

Switch(config)# end

Шаг 8: Проверка

Используйте следующую команду для отображения информации MSTP на коммутаторе Switch1:

Switch# show spanning-tree mst brief
##### MST0: Vlans: 1
Multiple spanning tree protocol Enabled
Root ID Priority 0 (0x0000)
Address 2225.fa28.c900
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 0 (0x0000)
Address 2225.fa28.c900
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role State Cost Priority.Number Type
--------------------------------------------------------------------------------
eth-0-9 Designated Forwarding 20000 128.9 P2p
eth-0-10 Designated Forwarding 20000 128.10 P2p
eth-0-17 Designated Forwarding 20000 128.17 P2p
eth-0-18 Designated Forwarding 20000 128.18 P2p
##### MST1: Vlans: 10
Root ID Priority 1 (0x0001)
Address 9c9a.7d91.9f00
Bridge ID Priority 32769 (0x8001)
Address 2225.fa28.c900
Interface Role State Cost Priority.Number Type
--------------------------------------------------------------------------------
eth-0-9 Rootport Forwarding 20000 128.9 P2p
eth-0-10 Alternate Discarding 20000 128.10 P2p
eth-0-17 Designated Forwarding 20000 128.17 P2p
eth-0-18 Designated Forwarding 20000 128.18 P2p
##### MST2: Vlans: 20
Root ID Priority 2 (0x0002)
Address 304c.275b.b200
Bridge ID Priority 32770 (0x8002)
Address 2225.fa28.c900
Interface Role State Cost Priority.Number Type
--------------------------------------------------------------------------------
eth-0-9 Alternate Discarding 20000 128.9 P2p
eth-0-10 Alternate Discarding 20000 128.10 P2p
eth-0-17 Rootport Forwarding 20000 128.17 P2p
eth-0-18 Alternate Discarding 20000 128.18 P2p

Используйте следующую команду для отображения информации MSTP на коммутаторе Switch2:

Switch# show spanning-tree mst brief
##### MST0: Vlans: 1
Multiple spanning tree protocol Enabled
Root ID Priority 0 (0x0000)
Address 2225.fa28.c900
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768 (0x8000)
Address 9c9a.7d91.9f00
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role State Cost Priority.Number Type
--------------------------------------------------------------------------------
eth-0-9 Rootport Forwarding 20000 128.9 P2p
eth-0-10 Alternate Discarding 20000 128.10 P2p
eth-0-17 Designated Forwarding 20000 128.17 P2p
eth-0-18 Designated Forwarding 20000 128.18 P2p
##### MST1: Vlans: 10
Root ID Priority 1 (0x0001)
Address 9c9a.7d91.9f00
Bridge ID Priority 1 (0x0001)
Address 9c9a.7d91.9f00
Interface Role State Cost Priority.Number Type
--------------------------------------------------------------------------------
eth-0-9 Designated Forwarding 20000 128.9 P2p
eth-0-10 Designated Forwarding 20000 128.10 P2p
eth-0-17 Designated Forwarding 20000 128.17 P2p
eth-0-18 Designated Forwarding 20000 128.18 P2p
##### MST2: Vlans: 20
Root ID Priority 2 (0x0002)
Address 304c.275b.b200
Bridge ID Priority 32770 (0x8002)
Address 9c9a.7d91.9f00
Interface Role State Cost Priority.Number Type
--------------------------------------------------------------------------------
eth-0-9 Designated Forwarding 20000 128.9 P2p
eth-0-10 Designated Forwarding 20000 128.10 P2p
eth-0-17 Rootport Forwarding 20000 128.17 P2p
eth-0-18 Alternate Discarding 20000 128.18 P2p

Используйте следующую команду для отображения информации MSTP на коммутаторе Switch3:

Switch# show spanning-tree mst brief
##### MST0: Vlans: 1
Multiple spanning tree protocol Enabled
Root ID Priority 0 (0x0000)
Address 2225.fa28.c900
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768 (0x8000)
Address 304c.275b.b200
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role State Cost Priority.Number Type
--------------------------------------------------------------------------------
eth-0-9 Rootport Forwarding 20000 128.9 P2p
eth-0-10 Alternate Discarding 20000 128.10 P2p
eth-0-17 Alternate Discarding 20000 128.17 P2p
eth-0-18 Alternate Discarding 20000 128.18 P2p
##### MST1: Vlans: 10
Root ID Priority 1 (0x0001)
Address 9c9a.7d91.9f00
Bridge ID Priority 32769 (0x8001)
Address 304c.275b.b200
Interface Role State Cost Priority.Number Type
--------------------------------------------------------------------------------
eth-0-9 Designated Forwarding 20000 128.9 P2p
eth-0-10 Designated Forwarding 20000 128.10 P2p
eth-0-17 Rootport Forwarding 20000 128.17 P2p
eth-0-18 Alternate Discarding 20000 128.18 P2p
##### MST2: Vlans: 20
Root ID Priority 2 (0x0002)
Address 304c.275b.b200
Bridge ID Priority 2 (0x0002)
Address 304c.275b.b200
Interface Role State Cost Priority.Number Type
--------------------------------------------------------------------------------
eth-0-9 Designated Forwarding 20000 128.9 P2p
eth-0-10 Designated Forwarding 20000 128.10 P2p
eth-0-17 Designated Forwarding 20000 128.17 P2p
eth-0-18 Designated Forwarding 20000 128.18 P2p

Используйте следующую команду для отображения информации MSTP на коммутаторе Switch4:

Switch# show spanning-tree mst brief
##### MST0: Vlans: 1
Multiple spanning tree protocol Enabled
Root ID Priority 0 (0x0000)
Address 2225.fa28.c900
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768 (0x8000)
Address 80a4.be55.6400
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300 sec
Interface Role State Cost Priority.Number Type
--------------------------------------------------------------------------------
eth-0-9 Designated Forwarding 20000 128.9 P2p
eth-0-10 Designated Forwarding 20000 128.10 P2p
eth-0-17 Rootport Forwarding 20000 128.17 P2p
eth-0-18 Alternate Discarding 20000 128.18 P2p
##### MST1: Vlans: 10
Root ID Priority 1 (0x0001)
Address 9c9a.7d91.9f00
Bridge ID Priority 32769 (0x8001)
Address 80a4.be55.6400
Interface Role State Cost Priority.Number Type
--------------------------------------------------------------------------------
eth-0-9 Alternate Discarding 20000 128.9 P2p
eth-0-10 Alternate Discarding 20000 128.10 P2p
eth-0-17 Rootport Forwarding 20000 128.17 P2p
eth-0-18 Alternate Discarding 20000 128.18 P2p
##### MST2: Vlans: 20
Root ID Priority 2 (0x0002)
Address 304c.275b.b200
Bridge ID Priority 32770 (0x8002)
Address 80a4.be55.6400
Interface Role State Cost Priority.Number Type
--------------------------------------------------------------------------------
eth-0-9 Rootport Forwarding 20000 128.9 P2p
eth-0-10 Alternate Discarding 20000 128.10 P2p
eth-0-17 Designated Forwarding 20000 128.17 P2p
eth-0-18 Designated Forwarding 20000 128.18 P2p