IT Technology/Network

STP 경로 설정 3가지 방법

by빵수 2021. 12. 20. 21:54
728x90
반응형

STP 경로 설정 3가지 방법에 대해서 알아보자

 

 

STP 경로 조정 

  • Cisco Switch는 기본적으로 PVST+ 혹은 Rapid-PVST(RSTP)로 동작한다.  (IOS 버전에 따라 차이가 있다) 
  • 두 가지 방식 모두 VLAN 마다 독립된 STP 프로세스가 동작하게 된다. 
  • 하지만 관리자가 별도로 설정을 하지 않는 경우 모든 VLAN은 공통된 Rooo Bright와 Blocking Port를 사용하게 된다.
  • 이유는 MAC주소에 의해서 Root bridge와 포트 역할이 결정되기 때문이다.
  • 결과적으로 모든 VLAN은 동일한 경로를 사용하여 트래픽을 전송하기 때문에 부하 분산이 되지 않는다.
  • 관리자는 필요에 따라 각 VLAN 트래픽이 다른 경로로 사용할 수 있도록 STP 경로 조정을 수행해야 한다

 

 

STP 경로 조정 종류 (3가지)


1. Bridge ID 변경

 

  • Switch가 가지고있는 고유의 ID
  • Bridge Priority (Default: 32,768) + MAC Address 형태로 구성되어 있다.
  • Cisco Switch의 경우 PVST 동작을 수행하기 때문에 VLAN마다 각각 독립된 Bridge ID를 사용해야 하고, 독립된 Configuration BPDU를 전송해야 한다.
  • 이를 위해 Bridge Priority값에 해당 VLAN ID를 더해서 독립된 Bridge ID를 사용하는 것이 가능하다.
  • 그러므로 Bridge Priority를 설정할 경우 4096배 수로 설정이 가능하다. 

 

Bridge ID

 

 

 

Bridge ID를 이용한 Root Switch 변경

 

Bridge ID를 이용한 Root Switch설정

 

 

IOU1 Switch(VLAN 10, 20)

 

IOU1(config)#spanning-tree vlan 10,20 priority 4096


IOU1(config)#do sh spanning-tree vlan 10            

VLAN0010 
  Spanning tree enabled protocol rstp 
  Root ID    Priority    4106 (Root Switch 설정 확인)
             Address     aabb.cc00.0100 
             This bridge is the root 
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 

  Bridge ID  Priority    4106   (priority 4096 sys-id-ext 10) 
             Address     aabb.cc00.0100 
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 
             Aging Time  300 sec 

Interface           Role Sts Cost      Prio.Nbr Type 
------------------- ---- --- --------- -------- -------------------------------- 
Et0/0               Desg FWD 100       128.1    Shr  
Et0/1               Desg FWD 100       128.2    Shr 

 

 

Primary를 이용한 Root Switch 변경

 

spanning-tree vlan (Num) root primary

spanning-tree vlan (Num) root primary

을 통해 VLAN 별 STP의 Root를 변경하여  

링크관리 및 STP에 의한 트래픽 load balancing을 구현할 수 있다.

 

Bridge ID를 이용한 Root Port 변경

 

 

 

 

 

 

IOU4 Switch(VLAN 10)

 

IOU4(config)#spanning-tree vlan 10 priority 8192
IOU4#sh spanning-tree vlan 10 

VLAN0010 
  Spanning tree enabled protocol rstp 
  Root ID    Priority    4106 
             Address     aabb.cc00.0100 
             Cost        200 
             Port        2 (Ethernet0/0) 
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 

  Bridge ID  Priority    8202   (priority 8192 sys-id-ext 10) 
             Address     aabb.cc00.0400 
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 
             Aging Time  300 sec 

Interface           Role Sts Cost      Prio.Nbr Type 
------------------- ---- --- --------- -------- -------------------------------- 
Et0/0               Root FWD 100       128.2    Shr 
Et0/1               Altn BLK 100       128.1    Shr  (Block 설정된 것 확인)

 

VLAN 20설정

 

 

VLAN10, 20 경로 설정

IOU2 Switch(VLAN 20)

IOU2(config)#spanning-tree vlan 20 priority 8192
VLAN0020 
  Spanning tree enabled protocol rstp 
  Root ID    Priority    4116 
             Address     aabb.cc00.0100 
             Cost        100 
             Port        1 (Ethernet0/0) 
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 

  Bridge ID  Priority    8212   (priority 8192 sys-id-ext 20) 
             Address     aabb.cc00.0200 
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 
             Aging Time  300 sec 

Interface           Role Sts Cost      Prio.Nbr Type 
------------------- ---- --- --------- -------- -------------------------------- 
Et0/0               Root FWD 100       128.1    Shr  
Et0/1               Desg FWD 100       128.2    Shr 


 

-   전송되길 원하는 경로와 연결된 상대방 Switch의 Bridge ID를 반대편 Switch보다 낮게 설정하면 해당 포트가 Root 포트로 선출되어 전송 경로로 사용된다.

 

 

2. Path Cost 변경

 

  • 상대 스위치를 변경할 수 없는데 IOU4 Switch 경로를 서로 바꾸고 싶을 경우 Path Cost를 이용해야 한다.
  • 특정 VLAN 트래픽이 전송되길 원하는 포트의 Path Cost를 반대편 Path Cost보다 낮게 설정하면 해당 포트가 Root 포트로 선출되어 Forwording 상태가 된다.
  • 상대방의 Switch의 Bridge ID가 아무리 낮아도 Path Cost 조건이 우선되기 때문에 해당 설정 결과를 따르게 된다.

 

 

IOU4 Switch(VLAN 10)

 

IOU4(config)#int e0/1
IOU4(config-if)#spanning-tree vlan 10 cost 50
IOU4#sh run int e0/1 
Building configuration... 
Current configuration : 215 bytes 
! 
interface Ethernet0/1 
 switchport trunk allowed vlan 10,20 
 switchport trunk encapsulation dot1q 
 switchport trunk native vlan 10 
 switchport mode trunk 
 switchport nonegotiate 
 spanning-tree vlan 10 cost 50 
end

IOU4#sh spanning-tree vlan 10 
VLAN0010 
  Spanning tree enabled protocol rstp 
  Root ID    Priority    4106 
             Address     aabb.cc00.0100 
             Cost        150 
             Port        2 (Ethernet0/1) 
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 

  Bridge ID  Priority    8202   (priority 8192 sys-id-ext 10) 
             Address     aabb.cc00.0400 
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 
             Aging Time  300 sec 

Interface           Role Sts Cost      Prio.Nbr Type 
------------------- ---- --- --------- -------- -------------------------------- 
Et0/0               Altn BLK 100       128.1    Shr  
Et0/1               Root FWD 50        128.2    Shr 


 

IOU4 Switch(VLAN 20)

 

IOU4(config-if)#spanning-tree vlan 20 cost 50
VLAN0020 
  Spanning tree enabled protocol rstp 
  Root ID    Priority    4116 
             Address     aabb.cc00.0100 
             Cost        150 
             Port        1 (Ethernet0/0) 
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 

  Bridge ID  Priority    32788  (priority 32768 sys-id-ext 20) 
             Address     aabb.cc00.0400 
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 
             Aging Time  300 sec 

Interface           Role Sts Cost      Prio.Nbr Type 
------------------- ---- --- --------- -------- -------------------------------- 
Et0/0               Root FWD 50        128.1    Shr  
Et0/1               Altn BLK 100       128.2    Shr 

 

-   확인해 보면 둘의 경로가 다른 Switch를 수정하지 않고도 변한 것을 확인할 수 있다.

 

 

3. Port ID 변경

 

 

 

 

IOU5 Switch(VLAN 20)

IOU5(config)#int e0/1
IOU5(config-if)#spanning-tree vlan 20 port-priority 64

 

IOU6 Switch에서 확인

IOU6#sh spanning-tree vlan 20 

VLAN0020 
  Spanning tree enabled protocol rstp 
  Root ID    Priority    32788 
             Address     aabb.cc00.0500 
             Cost        100 
             Port        2 (Ethernet0/1) 
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 

  Bridge ID  Priority    32788  (priority 32768 sys-id-ext 20) 
             Address     aabb.cc00.0600 
             Hello Time   2 sec  Max Age 20 sec  Forward Delay 15 sec 
             Aging Time  300 sec

Interface           Role Sts Cost      Prio.Nbr Type 
------------------- ---- --- --------- -------- -------------------------------- 
Et0/0               Altn BLK 100       128.1    Shr  
Et0/1               Root FWD 100       128.2    Shr 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

출처

https://peemangit.tistory.com/28

반응형