Функция Root Guard и STP
Отредактирована 12.05.2025
claiming [ˈkleɪmɪŋ] претендующий
Пример 1. Роли интерфейсов на коммутаторах до атаки
sw1#show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 32778 Address a40c.c392.1180 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address a40c.c392.1180 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi0/1 Desg FWD 4 128.49 P2p Gi0/2 Desg FWD 4 128.50 P2p
sw2#show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 32778 Address a40c.c392.1180 Cost 4 Port 49 (GigabitEthernet0/1) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address c025.5cd6.a180 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa0/12 Desg FWD 19 128.12 P2p Edge Gi0/1 Root FWD 4 128.49 P2p Gi0/2 Altn BLK 4 128.50 P2p
sw3#show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 32778 Address a40c.c392.1180 Cost 4 Port 50 (GigabitEthernet0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address a40c.c392.1900 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa0/13 Desg FWD 19 128.13 P2p Edge Gi0/1 Desg FWD 4 128.49 P2p Gi0/2 Root FWD 4 128.50 P2p
sw3#debug spanning-tree events
Пример 2. Cобытия изменения топологии STP во время атаки
sw3# *Apr 16 13:14:42.219: STP: VLAN0010 heard root 32778-a40c.c391.1180 on Fa0/13 *Apr 16 13:14:42.219: supersedes 32778-a40c.c392.1180 *Apr 16 13:14:42.219: STP: VLAN0010 new root is 32778, a40c.c391.1180 on port Fa0/13, cost 23 *Apr 16 13:14:42.225: STP: VLAN0010 Topology Change rcvd on Gi0/1 *Apr 16 13:14:42.226: STP: VLAN0010 sent Topology Change Notice on Fa0/13 *Apr 16 13:15:12.223: STP: VLAN0010 Topology Change rcvd on Gi0/1 *Apr 16 13:15:12.223: STP: VLAN0010 sent Topology Change Notice on Fa0/13
supersede [sjuːpəˈsiːd] заменять
Пример 3. Роли интерфейсов на коммутаторах после атаки
sw3#show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 32778 Address 0c06.19d1.0000 Cost 23 Port 13 (FastEthernet0/13) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address a40c.c392.1900 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa0/13 Root FWD 19 128.13 P2p Gi0/1 Desg FWD 4 128.49 P2p Gi0/2 Desg FWD 4 128.50 P2p
sw1#show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 32778 Address 0c06.19d1.0000 Cost 27 Port 49 (GigabitEthernet0/1) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address a40c.c392.1180 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Gi0/1 Root FWD 4 128.49 P2p Gi0/2 Desg FWD 4 128.50 P2p
sw2#show spanning-tree vlan 10 VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 32778 Address 0c06.19d1.0000 Cost 27 Port 52 (GigabitEthernet0/4) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address c025.5cd6.a180 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 sec Interface Role Sts Cost Prio.Nbr Type ------------------- ---- --- --------- -------- -------------------------------- Fa0/12 Desg FWD 19 128.12 P2p Gi0/1 Altn BLK 4 128.51 P2p Gi0/2 Root FWD 4 128.52 P2p
sw3(config)#interface range FastEthernet 0/1-48 sw3(config-if-range)spanning-tree guard ? loop Set guard mode to loop guard on interface none Set guard mode to none root Set guard mode to root guard on interface sw3(config-if-range)spanning-tree guard root sw3(config-if-range) *Apr 16 15:26:00.098: %SPANTREE-2-ROOTGUARD_CONFIG_CHANGE: Root guard enabled on port fastEthernet0/13 sw3(config-if-range)#end sw3# sw3#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK]
sw3# *Mar 1 00:10:59.160: %SPANTREE-2-ROOTGUARD_BLOCK: Root guard blocking port FastEthernet0/13 on VLAN0010. sw3#
sw3#show spanning-tree vlan 10 | include Fa0/13 Fa0/13 Desg BKN*19 128.13 P2p *ROOT_Inc
sw3#show interfaces fastEthernet 0/13 status Port Name Status Vlan Duplex Speed Type Fa0/13 Attacker connected 10 a-full a-100 10/100BaseTX
Порт был заблокирован логически в сегменте STP VLAN0010, но физически он в статусе connected. Если отправить ICMP запросы командой ping c PC2 на PC1, то PC1 будет недоступен (сетевая связность отсутствует).
sw3# *Mar 1 00:55:44.730: %SPANTREE-2-ROOTGUARD_UNBLOCK: Root guard unblocking port FastEthernet0/13 on VLAN0010. sw3#
sw3#show spanning-tree vlan 10 | include Fa0/13 Fa0/13 Desg FWD 19 128.13 P2p
sw3(config)#interface range FastEthernet 0/1-48 sw3(config-if-range)#no spanning-tree guard root sw3(config-if-range)#spanning-tree bpdufilter enable sw3(config-if-range)#end sw3# sw3#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK]
sw3#show running-config interface FastEthernet 0/13 Building configuration... Current configuration : 226 bytes ! interface FastEthernet0/13 description Attacker switchport access vlan 10 switchport mode access switchport nonegotiate no lldp receive no cdp enable spanning-tree portfast trunk spanning-tree bpdufilter enable end
В данном примере были использованы коммутаторы Cisco Catalyst серии 2960, прошивка:
c2960-lanlitek9-mz.150-2.SE5.bin
«-«-«- Назад | Вперед -»-»-» |