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

Конфигурация протокола Spanning Tree

Эта глава содержит полный пример конфигурации STP. STP предотвращает дублирование пакетов, устраняя петли в сети.

Топология

Следующий пример представляет собой простую топологию с несколькими bridges.

Image

Рисунок 2-34: Топология STP

       Примечание:      Выполните команду switchport на каждом порту, чтобы переключить его в режим уровня 2.

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

Switch 1

Switch1#configure terminalПерейти в режим конфигурации.
Switch1(config)#bridge 1 protocol ieeeДобавить bridge (1) в таблицу spanning tree.
Switch1(config)#interface eth2Перейти в режим интерфейса.
Switch1(config-if)#bridge-group 1Ассоциировать интерфейс с bridge group 1.
Switch1(config-if)#exitВыйти из режима интерфейса.
Switch1(config)#interface eth3Перейти в режим интерфейса.
Switch1(config-if)#bridge-group 1Ассоциировать интерфейс с bridge group 1.
Switch1(config-if)#exitВыйти из режима интерфейса.
Switch1(config)#interface eth4Перейти в режим интерфейса.
Switch1(config-if)#bridge-group 1Ассоциировать интерфейс с bridge group 1.
Switch1(config-if)#exitВыйти из режима интерфейса.
Switch1(config)#interface eth5Перейти в режим интерфейса.
Switch1(config-if)#bridge-group 1Ассоциировать интерфейс с bridge group 1.

Switch 2

Switch2#configure terminalПерейти в режим конфигурации.
Switch2(config)#bridge 2 protocol ieeeДобавить bridge (2) в таблицу spanning tree.
Switch2(config)#interface eth2Перейти в режим интерфейса.
Switch2(config-if)#bridge-group 2Ассоциировать интерфейс с bridge group 2.
Switch2(config-if)#exitВыйти из режима интерфейса.
Switch2(config)#interface eth3Перейти в режим интерфейса.
Switch2(config-if)#bridge-group 2Ассоциировать интерфейс с bridge group 2.
Switch2(config-if)#exitВыйти из режима интерфейса.
Switch2(config)#interface eth4Перейти в режим интерфейса.
Switch2(config-if)#bridge-group 2Ассоциировать интерфейс с bridge group 2.
Switch2(config-if)#exitВыйти из режима интерфейса.
Switch2(config)#interface eth5Перейти в режим интерфейса.
Switch2(config-if)#bridge-group 2Ассоциировать интерфейс с bridge group 2.

Switch 4

Switch4#configure terminalПерейти в режим конфигурации.
Switch4(config)#bridge 4 protocol ieeeДобавить bridge (4) в таблицу spanning tree.
Switch4(config)#interface eth2Перейти в режим интерфейса.
Switch4(config-if)#bridge-group 4Ассоциировать интерфейс с bridge group 4.
Switch4(config-if)#exitВыйти из режима интерфейса.
Switch4(config)#interface eth3Перейти в режим интерфейса.
Switch4(config-if)#bridge-group 4Ассоциировать интерфейс с bridge group 4.
Switch4(config-if)#exitВыйти из режима интерфейса.
Switch4(config)#interface eth4Перейти в режим интерфейса.
Switch4(config-if)#bridge-group 4Ассоциировать интерфейс с bridge group 4.
Switch4(config-if)#exitВыйти из режима интерфейса.
Switch4(config)#interface eth5Перейти в режим интерфейса.
Switch4(config-if)#bridge-group 4Ассоциировать интерфейс с bridge group 4.

Switch 3

Switch3#configure terminalПерейти в режим конфигурации.
Switch3(config)#bridge 3 protocol ieeeДобавить bridge (3) в таблицу spanning tree.
Switch3(config)#interface eth2Перейти в режим интерфейса.
Switch3(config-if)#bridge-group 3Ассоциировать интерфейс с bridge group 3.
Switch3(config-if)#exitВыйти из режима интерфейса.
Switch3(config)#interface eth3Перейти в режим интерфейса.
Switch3(config-if)#bridge-group 3Ассоциировать интерфейс с bridge group 3.
Проверка

show spanning-tree, show spanning-tree interface \<if-name\>

Switch 1

#show spanning-tree
% 1: Bridge up - Spanning Tree Enabled  - topology change detected
% 1: Root Path Cost 0 - Root Port 0 -  Bridge Priority 32768
% 1: Forward Delay 15 - Hello Time 2 - Max Age 20 - Transmit Hold Count 6
% 1: Root Id 8000525400244323
% 1: Bridge Id 8000525400244323
% 1: last topology change Mon Mar  4 11:40:41 2022
% 1: 20 topology change(s)  - last topology change Mon Mar  4 11:40:41 2022
% 1: portfast bpdu-filter disabled
% 1: portfast bpdu-guard disabled
% 1: portfast errdisable timeout disabled
% 1: portfast errdisable timeout interval 300 sec
%   eth1: Port Number 3 - Ifindex 3 - Port Id 0x8003 - Role Designated - State Forwarding
%   eth1: Designated Path Cost 0
%   eth1: Configured Path Cost 20000  - Add type Explicit ref count 1
%   eth1: Designated Port Id 0x8003 - Priority 128  -
%   eth1: Root 8000525400244323
%   eth1: Designated Bridge 8000525400244323
%   eth1: Message Age 0 - Max Age 20
%   eth1: Hello Time 2 - Forward Delay 15
%   eth1: Forward Timer 0 - Msg Age Timer 0 - Hello Timer 0 - topo change timer 0
%   eth1: forward-transitions 1
%   eth1: Version Rapid Spanning Tree Protocol - Received RSTP - Send RSTP
%   eth1: No portfast configured - Current  portfast off
%   eth1: bpdu-guard  default  - Current bpdu-guard off
%   eth1: bpdu-filter default  - Current bpdu-filter off
%   eth1: no root guard configured     - Current root guard off
%   eth1: Configured Link Type point-to-point - Current point-to-point
%   eth1: No auto-edge configured - Current port Auto Edge off
%
%   eth2: Port Number 4 - Ifindex 4 - Port Id 0x8004 - Role Designated - State Forwarding
%   eth2: Designated Path Cost 0
%   eth2: Configured Path Cost 20000  - Add type Explicit ref count 1
%   eth2: Designated Port Id 0x8004 - Priority 128  -
%   eth2: Root 8000525400244323
%   eth2: Designated Bridge 8000525400244323
%   eth2: Message Age 0 - Max Age 20
%   eth2: Hello Time 2 - Forward Delay 15
%   eth2: Forward Timer 0 - Msg Age Timer 0 - Hello Timer 1 - topo change timer 0
%   eth2: forward-transitions 1
%   eth2: Version Rapid Spanning Tree Protocol - Received None - Send RSTP
%   eth2: No portfast configured - Current  portfast off
%   eth2: bpdu-guard  default  - Current bpdu-guard off
%   eth2: bpdu-filter default  - Current bpdu-filter off
%   eth2: no root guard configured     - Current root guard off
%   eth2: Configured Link Type point-to-point - Current point-to-point
%   eth2: No auto-edge configured - Current port Auto Edge off
%
%   eth3: Port Number 5 - Ifindex 5 - Port Id 0x8005 - Role Designated - State Forwarding
%   eth3: Designated Path Cost 0
%   eth3: Configured Path Cost 20000  - Add type Explicit ref count 1
%   eth3: Designated Port Id 0x8005 - Priority 128  -
%   eth3: Root 8000525400244323
%   eth3: Designated Bridge 8000525400244323
%   eth3: Message Age 0 - Max Age 20
%   eth3: Hello Time 2 - Forward Delay 15
%   eth3: Forward Timer 0 - Msg Age Timer 0 - Hello Timer 1 - topo change timer 0
%   eth3: forward-transitions 1
%   eth3: Version Rapid Spanning Tree Protocol - Received None - Send RSTP
%   eth3: No portfast configured - Current  portfast off
%   eth3: bpdu-guard  default  - Current bpdu-guard off
%   eth3: bpdu-filter default  - Current bpdu-filter off
%   eth3: no root guard configured     - Current root guard off
%   eth3: Configured Link Type point-to-point - Current point-to-point
%   eth3: No auto-edge configured - Current port Auto Edge off
%
%   eth4: Port Number 6 - Ifindex 6 - Port Id 0x8006 - Role Designated - State Forwarding
%   eth4: Designated Path Cost 0
%   eth4: Configured Path Cost 20000  - Add type Explicit ref count 1
%   eth4: Designated Port Id 0x8006 - Priority 128  -
%   eth4: Root 8000525400244323
%   eth4: Designated Bridge 8000525400244323
%   eth4: Message Age 0 - Max Age 20
%   eth4: Hello Time 2 - Forward Delay 15
%   eth4: Forward Timer 0 - Msg Age Timer 0 - Hello Timer 0 - topo change timer 0
%   eth4: forward-transitions 1
%   eth4: Version Rapid Spanning Tree Protocol - Received None - Send RSTP
%   eth4: No portfast configured - Current  portfast off
%   eth4: bpdu-guard  default  - Current bpdu-guard off
%   eth4: bpdu-filter default  - Current bpdu-filter off
%   eth4: no root guard configured     - Current root guard off
%   eth4: Configured Link Type point-to-point - Current point-to-point
%   eth4: No auto-edge configured - Current port Auto Edge off
%
#
#show spanning-tree interface eth1
% 1: Bridge up - Spanning Tree Enabled  - topology change detected
% 1: Root Path Cost 0 - Root Port 0 -  Bridge Priority 32768
% 1: Forward Delay 15 - Hello Time 2 - Max Age 20 - Transmit Hold Count 6
% 1: Root Id 8000525400244323
% 1: Bridge Id 8000525400244323
% 1: last topology change Mon Mar  4 11:40:41 2022
% 1: 20 topology change(s)  - last topology change Mon Mar  4 11:40:41 2022
% 1: portfast bpdu-filter disabled
% 1: portfast bpdu-guard disabled
% 1: portfast errdisable timeout disabled
% 1: portfast errdisable timeout interval 300 sec
%   eth1: Port Number 3 - Ifindex 3 - Port Id 0x8003 - Role Designated - State Forwarding
%   eth1: Designated Path Cost 0
%   eth1: Configured Path Cost 20000  - Add type Explicit ref count 1
%   eth1: Designated Port Id 0x8003 - Priority 128  -
%   eth1: Root 8000525400244323
%   eth1: Designated Bridge 8000525400244323
%   eth1: Message Age 0 - Max Age 20
%   eth1: Hello Time 2 - Forward Delay 15
%   eth1: Forward Timer 0 - Msg Age Timer 0 - Hello Timer 1 - topo change timer 0
%   eth1: forward-transitions 1
%   eth1: Version Rapid Spanning Tree Protocol - Received RSTP - Send RSTP
%   eth1: No portfast configured - Current  portfast off
%   eth1: bpdu-guard  default  - Current bpdu-guard off
%   eth1: bpdu-filter default  - Current bpdu-filter off
%   eth1: no root guard configured     - Current root guard off
%   eth1: Configured Link Type point-to-point - Current point-to-point
%   eth1: No auto-edge configured - Current port Auto Edge off #

Switch 2

#show spanning-tree
% 2: Bridge up - Spanning Tree Enabled  - topology change detected
% 2: Root Path Cost 20000 - Root Port 3 -  Bridge Priority 32768
% 2: Forward Delay 15 - Hello Time 2 - Max Age 20 - Transmit Hold Count 6
% 2: Root Id 8000525400244323
% 2: Bridge Id 8000525400d15789
% 2: last topology change Mon Mar  4 11:40:43 2022
% 2: 11 topology change(s)  - last topology change Mon Mar  4 11:40:43 2022
% 2: portfast bpdu-filter disabled
% 2: portfast bpdu-guard disabled
% 2: portfast errdisable timeout disabled
% 2: portfast errdisable timeout interval 300 sec
%   eth1: Port Number 3 - Ifindex 3 - Port Id 0x8003 - Role Rootport - State Forwarding
%   eth1: Designated Path Cost 0
%   eth1: Configured Path Cost 20000  - Add type Explicit ref count 1
%   eth1: Designated Port Id 0x8003 - Priority 128  -
%   eth1: Root 8000525400244323
%   eth1: Designated Bridge 8000525400244323
%   eth1: Message Age 0 - Max Age 20
%   eth1: Hello Time 2 - Forward Delay 15
%   eth1: Forward Timer 0 - Msg Age Timer 4 - Hello Timer 0 - topo change timer 0
%   eth1: forward-transitions 1
%   eth1: Version Rapid Spanning Tree Protocol - Received RSTP - Send RSTP
%   eth1: No portfast configured - Current  portfast off
%   eth1: bpdu-guard  default  - Current bpdu-guard off
%   eth1: bpdu-filter default  - Current bpdu-filter off
%   eth1: no root guard configured     - Current root guard off
%   eth1: Configured Link Type point-to-point - Current point-to-point
%   eth1: No auto-edge configured - Current port Auto Edge off
%
%   eth2: Port Number 4 - Ifindex 4 - Port Id 0x8004 - Role Alternate - State Discarding
%   eth2: Designated Path Cost 0
%   eth2: Configured Path Cost 20000  - Add type Explicit ref count 1
%   eth2: Designated Port Id 0x8004 - Priority 128  -
%   eth2: Root 8000525400244323
%   eth2: Designated Bridge 8000525400244323
%   eth2: Message Age 0 - Max Age 20
%   eth2: Hello Time 2 - Forward Delay 15
%   eth2: Forward Timer 0 - Msg Age Timer 4 - Hello Timer 1 - topo change timer 0
%   eth2: forward-transitions 0
%   eth2: Version Rapid Spanning Tree Protocol - Received RSTP - Send RSTP
%   eth2: No portfast configured - Current  portfast off
%   eth2: bpdu-guard  default  - Current bpdu-guard off
%   eth2: bpdu-filter default  - Current bpdu-filter off
%   eth2: no root guard configured     - Current root guard off
%   eth2: Configured Link Type point-to-point - Current point-to-point
%   eth2: No auto-edge configured - Current port Auto Edge off
%
%   eth3: Port Number 5 - Ifindex 5 - Port Id 0x8005 - Role Designated - State Forwarding
%   eth3: Designated Path Cost 20000
%   eth3: Configured Path Cost 20000  - Add type Explicit ref count 1
%   eth3: Designated Port Id 0x8005 - Priority 128  -
%   eth3: Root 8000525400244323
%   eth3: Designated Bridge 8000525400d15789
%   eth3: Message Age 1 - Max Age 20
%   eth3: Hello Time 2 - Forward Delay 15
%   eth3: Forward Timer 0 - Msg Age Timer 0 - Hello Timer 0 - topo change timer 0
%   eth3: forward-transitions 1
%   eth3: Version Rapid Spanning Tree Protocol - Received RSTP - Send RSTP
%   eth3: No portfast configured - Current  portfast off
%   eth3: bpdu-guard  default  - Current bpdu-guard off
%   eth3: bpdu-filter default  - Current bpdu-filter off
%   eth3: no root guard configured     - Current root guard off
%   eth3: Configured Link Type point-to-point - Current point-to-point
%   eth3: No auto-edge configured - Current port Auto Edge off
%
%   eth4: Port Number 6 - Ifindex 6 - Port Id 0x8006 - Role Designated - State Forwarding
%   eth4: Designated Path Cost 20000
%   eth4: Configured Path Cost 20000  - Add type Explicit ref count 1
%   eth4: Designated Port Id 0x8006 - Priority 128  -
%   eth4: Root 8000525400244323
%   eth4: Designated Bridge 8000525400d15789
%   eth4: Message Age 1 - Max Age 20
%   eth4: Hello Time 2 - Forward Delay 15
%   eth4: Forward Timer 0 - Msg Age Timer 0 - Hello Timer 0 - topo change timer 0
%   eth4: forward-transitions 1
%   eth4: Version Rapid Spanning Tree Protocol - Received None - Send RSTP
%   eth4: No portfast configured - Current  portfast off
%   eth4: bpdu-guard  default  - Current bpdu-guard off
%   eth4: bpdu-filter default  - Current bpdu-filter off
%   eth4: no root guard configured     - Current root guard off
%   eth4: Configured Link Type point-to-point - Current point-to-point
%   eth4: No auto-edge configured - Current port Auto Edge off %

Отключение конфигурации Spanning Tree

В этой главе описывается отключение работы Spanning Tree на уровне отдельных Multiple Spanning Tree Instance (MSTI).

Топология

Image

Рисунок 5-37: Топология отключения Spanning Tree

Примечание:      Выполните команду switchport на каждом порту, чтобы переключить его в режим Layer-2.

Отключение конфигурации MSTP

Sw1

Отключение MSTP для конкретного Instance

Sw1(config-mst)#no bridge 1 instance 2Отключить Spanning Tree для MSTP на Instance 2
Sw1(config-mst)#no bridge 1 instance 3Отключить Spanning Tree для MSTP на Instance 3
Отключение MSTP глобально
Sw1(config)#no bridge 1 multiplespanning-tree enable bridge-forwardОтключить Spanning Tree глобально для MSTP, оставив порты в состоянии форвардинга.

Отключение MSTP на уровне порта

Sw1(config)#interface ge2Перейти в режим конфигурации интерфейса для ge2.
Sw1(config-if)#bridge-group 1 spanningtree disableОтключить Spanning Tree на уровне порта для MSTP и перевести порт в состояние форвардинга [Эта команда отключает любой тип STP на порту].

Sw2

Отключение MSTP для конкретного Instance

Sw2(config-mst)#no bridge 1 instance 2Отключить Spanning Tree для MSTP на Instance 2
Sw2(config-mst)#no bridge 1 instance 3Отключить Spanning Tree для MSTP на Instance 3
Отключение MSTP глобально
Sw2(config)#no bridge 1 multiplespanning-tree enable bridge-forwardОтключить Spanning Tree глобально для MSTP.

Отключение MSTP на уровне порта

Sw2(config)#interface xe2Перейти в режим конфигурации интерфейса для xe2.
Sw2(config-if)#bridge-group 1 spanningtree disableОтключить Spanning Tree на уровне порта для MSTP и перевести порт в состояние форвардинга [Эта команда отключает любой тип STP на порту].
Проверка

show spanning-tree mst detail, show spanning-tree mst instance<instance_id>, show spanning-tree

Sw1

Проверьте MSTP, выполнив команду show spanning-tree mst detail

#show spanning-tree mst detail
% 1: Bridge up - Spanning Tree Enabled  - topology change detected
% 1: CIST Root Path Cost 0 - CIST Root Port 905 -  CIST Bridge Priority 32768
% 1: Forward Delay 15 - Hello Time 2 - Max Age 20 - Transmit Hold Count 6 -   Max-hops 20
% 1: CIST Root Id 80003417ebfbe9c4
% 1: CIST Reg Root Id 80003417ebfbe9c4
% 1: CIST Bridge Id 800064006ac779a0
% 1: 9 topology change(s)  - last topology change Thu Nov 17 15:06:17 2022
% 1: portfast bpdu-filter disabled
% 1: portfast bpdu-guard disabled
% 1: portfast errdisable timeout disabled
% 1: portfast errdisable timeout interval 300 sec
%   ge2: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Rootport - State Forwarding
%   ge2: Designated External Path Cost 0 -Internal Path Cost 20000
%   ge2: Configured Path Cost 20000  - Add type Explicit ref count 2
%   ge2: Designated Port Id 0x838a - CIST Priority 128  -
%   ge2: CIST Root 80003417ebfbe9c4
%   ge2: Regional Root 80003417ebfbe9c4
%   ge2: Designated Bridge 80003417ebfbe9c4
%   ge2: Message Age 0 - Max Age 20
%   ge2: CIST Hello Time 2 - Forward Delay 15
%   ge2: CIST Forward Timer 0 - Msg Age Timer 4 - Hello Timer 0 - topo change timer 0
%   ge2: forward-transitions 1
%   ge2: Version Multiple Spanning Tree Protocol - Received MSTP - Send MSTP
%   ge2: No portfast configured - Current  portfast off
%   ge2: bpdu-guard  default  - Current bpdu-guard off
%   ge2: bpdu-filter default  - Current bpdu-filter off
%   ge2: no root guard configured     - Current root guard off
%   ge2: Configured Link Type point-to-point - Current point-to-point
%   ge2: No auto-edge configured - Current port Auto Edge off %
%   ge3: Port Number 908 - Ifindex 5004 - Port Id 0x838c - Role Alternate - State Discarding
%   ge3: Designated External Path Cost 0 -Internal Path Cost 20000
%   ge3: Configured Path Cost 20000  - Add type Explicit ref count 2
%   ge3: Designated Port Id 0x838b - CIST Priority 128  -
%   ge3: CIST Root 80003417ebfbe9c4
%   ge3: Regional Root 80003417ebfbe9c4
%   ge3: Designated Bridge 80003417ebfbe9c4
%   ge3: Message Age 0 - Max Age 20
%   ge3: CIST Hello Time 2 - Forward Delay 15
%   ge3: CIST Forward Timer 0 - Msg Age Timer 5 - Hello Timer 1 - topo change timer 0
%   ge3: forward-transitions 2
%   ge3: Version Multiple Spanning Tree Protocol - Received MSTP - Send MSTP
%   ge3: No portfast configured - Current  portfast off
%   ge3: bpdu-guard  default  - Current bpdu-guard off
%   ge3: bpdu-filter default  - Current bpdu-filter off
%   ge3: no root guard configured     - Current root guard off
%   ge3: Configured Link Type point-to-point - Current point-to-point
%   ge3: No auto-edge configured - Current port Auto Edge off
% Instance  2:  Vlans: 2
% 1: MSTI Root Path Cost 20000 -MSTI Root Port 5001 - MSTI Bridge Priority 32768
% 1: MSTI Root Id 80023417ebfbe9c4
% 1: MSTI Bridge Id 800264006ac779a0
%   ge2: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Rootport - State Forwarding
%   ge2: Designated Internal Path Cost 0  - Designated Port Id 0x838a
%   ge2: Configured Internal Path Cost 20000
%   ge2: Configured CST External Path cost 20000
%   ge2: CST Priority 128  - MSTI Priority 128
%   ge2: Designated Root 80023417ebfbe9c4
%   ge2: Designated Bridge 800264006ac779a0
%   ge2: Message Age 0
%   ge2: Hello Time 2 - Forward Delay 15
%   ge2: Forward Timer 0 - Msg Age Timer 4 - Hello Timer 0
% Instance  3:  Vlans: 3
% 1: MSTI Root Path Cost 0 -MSTI Root Port 0 - MSTI Bridge Priority 32768
% 1: MSTI Root Id 800364006ac779a0
% 1: MSTI Bridge Id 800364006ac779a0
%   ge3: Port Number 908 - Ifindex 5004 - Port Id 0x838c - Role Designated - State Forwarding
%   ge3: Designated Internal Path Cost 0  - Designated Port Id 0x838c
%   ge3: Configured Internal Path Cost 20000
%   ge3: Configured CST External Path cost 20000
%   ge3: CST Priority 128  - MSTI Priority 128
%   ge3: Designated Root 800364006ac779a0
%   ge3: Designated Bridge 800364006ac779a0
%   ge3: Message Age 0
%   ge3: Hello Time 2 - Forward Delay 15
%   ge3: Forward Timer 0 - Msg Age Timer 0 - Hello Timer 1
  • Глобальные конфигурации MSTP
  • Проверка конфигураций MSTP, когда MSTP включен глобально
#show running-config
!
bridge 1 protocol mstp
!
  • Проверка конфигураций MSTP, когда MSTP отключен глобально
#show running-config
!
bridge 1 protocol mstp
no bridge 1 multiple-spanning-tree enable bridge-forward
!
  • Конфигурации MSTP для каждого instance
  • Проверка конфигураций MSTP, когда MSTP instance 2 и 3 включены.
#show running-config spanning-tree
!
spanning-tree mst configuration bridge 1  instance 2 bridge 1  instance 2 vlan 2 bridge 1  instance 3 bridge 1  instance 3 vlan 3
!
interface xe2 bridge-group 1 instance 2
!
interface xe3 bridge-group 1 instance 3
!
  • Проверка конфигураций MSTP, когда MSTP instance 2 отключен
#show running-config spanning-tree
!
spanning-tree mst configuration bridge 1 instance 3 bridge 1 instance 3 vlan 3
!
interface ge3 bridge-group 1 instance 3
!
  • Конфигурации интерфейсов MSTP
  • Проверка конфигураций MSTP, когда Spanning Tree включен на интерфейсе.
#show running-config interface ge2
!
interface ge2 switchport bridge-group 1 switchport mode access switchport access vlan 2 bridge-group 1 instance 2
!
  • Проверка конфигураций MSTP, когда Spanning Tree отключен на интерфейсе.
#show running-config interface ge2
!
interface ge2 switchport
bridge-group 1 spanning-tree disable
switchport mode access switchport access vlan 2 bridge-group 1 instance 2
  • Проверка деталей MSTP после отключения Spanning Tree на интерфейсе ge2 с помощью команды “show spanning-tree mst details”.
#show spanning-tree mst detail
% 1: Bridge up - Spanning Tree Enabled  - topology change detected
% 1: CIST Root Path Cost 0 - CIST Root Port 908 -  CIST Bridge Priority 32768
% 1: Forward Delay 15 - Hello Time 2 - Max Age 20 - Transmit Hold Count 6 - Max-hops 20
% 1: CIST Root Id 80003417ebfbe9c4
% 1: CIST Reg Root Id 80003417ebfbe9c4
% 1: CIST Bridge Id 800064006ac779a0
% 1: 10 topology change(s)  - last topology change Fri Nov 25 21:21:05 2022
% 1: portfast bpdu-filter disabled
% 1: portfast bpdu-guard disabled
% 1: portfast errdisable timeout disabled
% 1: portfast errdisable timeout interval 300 sec
%   ge2: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Disabled - State Forwarding
%   ge2: Designated External Path Cost 0 -Internal Path Cost 20000
%   ge2: Configured Path Cost 20000  - Add type Explicit ref count 2
%   ge2: Designated Port Id 0x838a - CIST Priority 128  -
%   ge2: Message Age 0 - Max Age 20
%   ge2: CIST Hello Time 2 - Forward Delay 15
%   ge2: CIST Forward Timer 0 - Msg Age Timer 4 - Hello Timer 0 - topo change timer 0
%   ge2: forward-transitions 2
%   ge2: Version Multiple Spanning Tree Protocol - Received MSTP - Send MSTP
%   ge2: No portfast configured - Current  portfast off
%   ge2: bpdu-guard  default  - Current bpdu-guard off
%   ge2: bpdu-filter default  - Current bpdu-filter off
%   ge2: no root guard configured     - Current root guard off
%   ge2: Configured Link Type point-to-point - Current point-to-point
%   ge2: No auto-edge configured - Current port Auto Edge off
%   ge3: Port Number 908 - Ifindex 5004 - Port Id 0x838c - Role Rootport - State Forwarding
%   ge3: Designated External Path Cost 0 -Internal Path Cost 20000
%   ge3: Configured Path Cost 20000  - Add type Explicit ref count 2
%   ge3: Designated Port Id 0x838b - CIST Priority 128  -
%   ge3: CIST Root 80003417ebfbe9c4
%   ge3: Regional Root 80003417ebfbe9c4
%   ge3: Designated Bridge 80003417ebfbe9c4
%   ge3: Message Age 0 - Max Age 20
%   ge3: CIST Hello Time 2 - Forward Delay 15
%   ge3: CIST Forward Timer 0 - Msg Age Timer 4 - Hello Timer 1 - topo change timer 0
%   ge3: forward-transitions 3
%   ge3: Version Multiple Spanning Tree Protocol - Received MSTP - Send MSTP
%   ge3: No portfast configured - Current  portfast off
%   ge3: bpdu-guard  default  - Current bpdu-guard off
%   ge3: bpdu-filter default  - Current bpdu-filter off
%   ge3: no root guard configured     - Current root guard off
%   ge3: Configured Link Type point-to-point - Current point-to-point
%   ge3: No auto-edge configured - Current port Auto Edge off
% Instance  2:  Vlans: 2
% 1: MSTI Root Path Cost 0 -MSTI Root Port 0 - MSTI Bridge Priority 32768
% 1: MSTI Root Id 800264006ac779a0
% 1: MSTI Bridge Id 800264006ac779a0
%   ge2: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - Role Disabled - State Discarding
%   ge2: Designated Internal Path Cost 0  - Designated Port Id 0x8389
%   ge2: Configured Internal Path Cost 20000
%   ge2: Configured CST External Path cost 20000
%   ge2: CST Priority 128  - MSTI Priority 128
%   ge2: Designated Root 800264006ac779a0
%   ge2: Designated Bridge 800264006ac779a0
%   ge2: Message Age 0
%   ge2: Hello Time 2 - Forward Delay 15
%   ge2: Forward Timer 0 - Msg Age Timer 0 - Hello Timer 0
% Instance  3:  Vlans: 3
% 1: MSTI Root Path Cost 20000 -MSTI Root Port 5004 - MSTI Bridge Priority
32768
% 1: MSTI Root Id 80033417ebfbe9c4
% 1: MSTI Bridge Id 800364006ac779a0
%   ge3: Port Number 908 - Ifindex 5004 - Port Id 0x838c - Role Rootport - State Forwarding
%   ge3: Designated Internal Path Cost 0  - Designated Port Id 0x838b
%   ge3: Configured Internal Path Cost 20000
%   ge3: Configured CST External Path cost 20000
%   ge3: CST Priority 128  - MSTI Priority 128
%   ge3: Designated Root 80033417ebfbe9c4
%   ge3: Designated Bridge 800364006ac779a0
%   ge3: Message Age 0
%   ge3: Hello Time 2 - Forward Delay 15
%   ge3: Forward Timer 0 - Msg Age Timer 4 - Hello Timer 1
Конфигурация STP

Sw1

Отключение STP глобально

Sw1(config)#no bridge 1 spanning-tree enable bridge-forwardОтключить Spanning Tree глобально для STP.

Отключение STP для каждого порта

Sw1(config)#interface ge2Перейти в режим интерфейса для ge2.
Sw1(config-if)#bridge-group 1 spanningtree disableОтключить Spanning Tree для порта в STP и перевести порт в состояние форвардинга (эта команда отключает любой тип STP на порту)

Sw2

Disabling STP globally

Sw2(config)#no bridge 1 spanning-tree enable bridge-forwardОтключить Spanning Tree глобально для STP.

Отключение STP для каждого порта

Sw2(config)#interface xe2Перейти в режим интерфейса для xe2.
Sw2(config-if)#bridge-group 1 spanningtree disableОтключить Spanning Tree для порта в STP и перевести порт в состояние форвардинга (эта команда отключает любой тип STP на порту)
Validation

show spanning-tree, show spanning-tree <interface name>

Sw1

  • Проверьте STP, когда STP включен глобально и ge2 и ge3 являются частью bridge, выполнив команду show spanning-tree
#show spanning-tree
% 1: Bridge up - Spanning Tree Enabled - topology change
% 1: Root Path Cost 4 - Priority 32768
% 1: Forward Delay 15 - Hello Time 2 - Max Age 20 - Transmit Hold Count 6 - Root port 905
% 1: Root Id 80003417ebfbe9c4
% 1: Bridge Id 800064006ac779a0
% 1: 3 topology changes - last topology change Tue Nov 15 21:33:53 2022
% 1: portfast bpdu-filter disabled
% 1: portfast bpdu-guard disabled
% 1: portfast errdisable timeout disabled
% 1: portfast errdisable timeout interval 300 sec
%ge2: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - path cost 4 -      designated cost 0
%ge2: Designated Port Id 0x838a - state Forwarding -Priority 128
%ge2: Designated root 80003417ebfbe9c4
%ge2: Designated Bridge 80003417ebfbe9c4
%ge2: Message Age 0 - Max Age 20
%ge2: Hello Time 2 - Forward Delay 15
%ge2: Forward Timer 0 - Msg Age Timer 18 - Hello Timer 1 - topo change  timer0
%ge2: forward-transitions 1
%ge2: No portfast configured – Current  portfast
%ge2: bpdu-guard default- Current bpdu-guard off
%ge2: bpdu-filter default- Current bpdu-filter off
%ge2: no root guard configured- Current root guard off
%ge3: Port Number 908 - Ifindex 5004 - Port Id 0x838c - path cost 4 - designated cost 0
%ge3: Designated Port Id 0x838b - state Blocked -Priority 128
%ge3: Designated root 80003417ebfbe9c4
%ge3: Designated Bridge 80003417ebfbe9c4
%ge3: Message Age 0 - Max Age 20
%ge3: Hello Time 2 - Forward Delay 15
%ge3: Forward Timer 0 - Msg Age Timer 19 - Hello Timer 1 - topo change timer0
%ge3: forward-transitions 0
%ge3: No portfast configured - Currentportfast off %ge3: bpdu-guarddefault- Current bpdu-guard off
%ge3: bpdu-filter default- Current bpdu-filter off
%ge3: no root guard configured- Current root guard off %

Глобальная конфигурации STP Проверьте конфигурацию STP, когда STP включен глобально

#show running-config
!
bridge 1 protocol ieee vlan-bridge
!

Проверьте конфигурацию STP, когда STP выключен глобально

#show running-config
!
bridge 1 protocol ieee vlan-bridge
no bridge 1 spanning-tree enable bridge-forward
!

Конфигурации интерфейсов STP Проверьте конфигураций STP, когда Spanning Tree включен на интерфейсе

#show running-config interface ge2
!
interface ge2 switchport bridge-group 1 switchport mode trunk switchport trunk allowed vlan all
!

Проверьте конфигураций STP, когда Spanning Tree выключен на интерфейсе

#show running-config interface ge2
!
interface ge2 switchport
bridge-group 1 spanning-tree disable switchport mode trunk switchport trunk allowed vlan all
!

Проверьте детали STP после отключения Spanning Tree на интерфейсе ge2 с помощью команды “show spanning-tree”

#show spanning-tree
% 1: Bridge up - Spanning Tree Enabled
% 1: Root Path Cost 4 - Priority 32768
% 1: Forward Delay 15 - Hello Time 2 - Max Age 20 - Transmit Hold Count 6 - Root port 908
% 1: Root Id 80003417ebfbe9c4
% 1: Bridge Id 800064006ac779a0
% 1: 5 topology changes - last topology change Fri Nov 25 21:15:35 2022
% 1: portfast bpdu-filter disabled
% 1: portfast bpdu-guard disabled
% 1: portfast errdisable timeout disabled
% 1: portfast errdisable timeout interval 300 sec
%   ge2: Port Number 905 - Ifindex 5001 - Port Id 0x8389 - path cost 4 - designated cost 0
%   ge2: Designated Port Id 0x838a - state Disabled -Priority 128
%   ge2: Message Age 0 - Max Age 20
%   ge2: Hello Time 2 - Forward Delay 15
%   ge2: Forward Timer 0 - Msg Age Timer 18 - Hello Timer 0 - topo change timer 23
%   ge2: forward-transitions 2
%   ge2: No portfast configured - Current  portfast off
%   ge2: bpdu-guard  default  - Current bpdu-guard off
%   ge2: bpdu-filter default  - Current bpdu-filter off
%   ge2: no root guard configured     - Current root guard off
%
%   ge3: Port Number 908 - Ifindex 5004 - Port Id 0x838c - path cost 4 - designated cost 0
%   ge3: Designated Port Id 0x838b - state Forwarding -Priority 128
%   ge3: Designated root 80003417ebfbe9c4
%   ge3: Designated Bridge 80003417ebfbe9c4
%   ge3: Message Age 0 - Max Age 20
%   ge3: Hello Time 2 - Forward Delay 15
%   ge3: Forward Timer 0 - Msg Age Timer 19 - Hello Timer 1 - topo change timer 23
%   ge3: forward-transitions 2
%   ge3: No portfast configured - Current  portfast off
%   ge3: bpdu-guard  default  - Current bpdu-guard off
%   ge3: bpdu-filter default  - Current bpdu-filter off
%   ge3: no root guard configured     - Current root guard off