다음과 같이 SW1과는 vPC로 연결되어 있지 않고, SW2와는 vPC로 연결되었을 때 SW1과 SW2에서 Spanning-Tree 정보가 어떻게 되는지 확인해 보자.

출처 : www.cisco.com

Normal vPC Behavior for Hybrid Setup

  Normal vPC 구성에서 SW1 정보를 확인해 다음과 같다.

SW-1# show span vlan 1 detail

 VLAN0001 is executing the rstp compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, sysid 1, address 0024.986f.3b44
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 8193, address 0024.986f.3b41
  Root port is 295 (Ethernet2/39), cost of root path is 4
  Topology change flag not set, detected flag not set
  Number of topology changes 4 last change occurred 0:29:13 ago
          from Ethernet2/39
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0

 Port 295 (Ethernet2/39) of VLAN0001 is root forwarding
   Port path cost 4, Port priority 128, Port Identifier 128.295
   Designated root has priority 8193, address 0024.986f.3b41 (N7K-1 = Root)
   Designated bridge has priority 8193, address 0024.986f.3b41 (Connect N7K-1)
   Designated port id is 128.260, designated path cost 0, Topology change is set
   Timers: message age 16, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 4, received 898

 Port 296 (Ethernet2/40) of VLAN0001 is alternate blocking
   Port path cost 4, Port priority 128, Port Identifier 128.296
   Designated root has priority 8193, address 0024.986f.3b41 (N7K-1 = Root)
   Designated bridge has priority 8193, address 0024.986f.3b42 (Connect N7K-2)
   Designated port id is 128.272, designated path cost 2 
   Timers: message age 16, forward delay 0, hold 0
   Number of transitions to forwarding state: 2
   Link type is point-to-point by default
   BPDU: sent 6, received 895

  non-vPC Switch에게 BPDU를 전달할 때, vPC Switch가 자신의 Bridge ID와 Priority 정보를 기반으로 일반 Spanning-Tree를 구동하는 것을 확인할 수 있다. 그래서, N7K-1은 자신이 Root이기 때문에 Root까지 Cost가 ‘0’이라 전달하고, N7K-2는 Root까지 Cost가 ‘2’라 전달하고 있다.

Enable Peer-Switch on Both Nexus Switches

  이번에는 peer-switch 명령어를 수행한 후 SW1 정보를 확인해 보자.

출처 : www.cisco.com
SW-1# show span vlan 1

VLAN0001
  Spanning tree enabled protocol rstp
  Root ID    Priority    8193
             Address     0023.04ee.be01
             Cost        4
             Port        295 (Ethernet2/39)
             Hello Time  2  sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     0024.986f.3b44
             Hello Time  2  sec  Max Age 20 sec  Forward Delay 15 sec

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Eth2/39          Root FWD 4         128.295  P2p
Eth2/40          Altn BLK 4         128.296  P2p

SW-1# show span vlan 1 detail
 VLAN0001 is executing the rstp compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, sysid 1, address 0024.986f.3b44
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 8193, address 0023.04ee.be01
  Root port is 295 (Ethernet2/39), cost of root path is 4
  Topology change flag not set, detected flag not set
  Number of topology changes 6 last change occurred 0:25:38 ago
          from Ethernet2/39
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0
 Port 295 (Ethernet2/39) of VLAN0001 is root forwarding
   Port path cost 4, Port priority 128, Port Identifier 128.295
   Designated root has priority 8193, address 0023.04ee.be01 (vPC Bridge = Root)
   Designated bridge has priority 8193, address 0024.986f.3b41 (Connect N7K-1)
   Designated port id is 128.260, designated path cost 0, Topology change is set 
   Timers: message age 16, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   Link type is point-to-point by default
   BPDU: sent 4, received 2280
 Port 296 (Ethernet2/40) of VLAN0001 is alternate blocking
   Port path cost 4, Port priority 128, Port Identifier 128.296
   Designated root has priority 8193, address 0023.04ee.be01 (vPC Bridge = Root)
   Designated bridge has priority 8193, address 0024.986f.3b42 (Connect N7K-2)
   Designated port id is 128.272, designated path cost 0
   Timers: message age 15, forward delay 0, hold 0
   Number of transitions to forwarding state: 2
   Link type is point-to-point by default
   BPDU: sent 7, received 2278

  vPC Peer 모두가 각각 BPDU를 전달하는 것은 동일하지만, Root Bridge ID의 MAC address 부분을 확인해 보면 vPC에 의해 생성된 Virtual MAC address로 설정하여 전달하는 것을 확인할 수 있다. 그리고, Root까지의 Cost가 모두 ‘0’이라 전달하고 있다.

  위 정보를 기반으로 Toplogy를 구성해 보면 다음과 같다. ‘peer-switch’를 설정하면, 마치 가상의 vPC device가 실제 존재하여 Root 역할을 하고 있는 것처럼 구성된다.

  그리고, vPC로 연결된 장비에서는 하나의 장비로 보여야 하니까 당연히 다음과 같이 보일 것이다. 물론, 기존에 Primary Switch에서만 발생하던 BPDU를 Primary Switch와 Secondary Switch 모두 발생시킨다는 차이는 있지만 두개의 BPDU가 동일하기 때문에 결과는 다르지 않다.

SW-2# show span vlan 1 detail

 VLAN0001 is executing the rstp compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, sysid 1, address 0024.986f.3b43
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 8193, address 0023.04ee.be01
  Root port is 4105 (port-channel10), cost of root path is 3
  Topology change flag not set, detected flag not set
  Number of topology changes 5 last change occurred 0:21:40 ago
          from port-channel10
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0

 Port 4105 (port-channel10) of VLAN0001 is root forwarding
   Port path cost 3, Port priority 128, Port Identifier 128.4105
   Designated root has priority 8193, address 0023.04ee.be01 (vPC Bridge = Root)
   Designated bridge has priority 8193, address 0023.04ee.be01 (Connect vPC Bridge)
   Designated port id is 128.4105, designated path cost 0, Topology change is set
   Timers: message age 15, forward delay 0, hold 0
   Number of transitions to forwarding state: 2
   Link type is point-to-point by default
   BPDU: sent 96, received 2804

  그럼, ‘peer-switch’를 구성했을 때 무슨 장점이 있을까? 그것은 non-vPC 장비와 연결된 구간에 PVST+를 구성하기가 수월하다는 것이다. 우리는 vPC의 Spanning-Tree Priority를 잘못 구성하여 Root가 되지 않으면 Loop이 발생할 수 있다는 것을 앞에서 학습하였다.

  그런데, PVST+를 사용하려면 vPC 간에 Priority를 다르게 설정하여야 하기 때문에, vPC 장비가 Root를 유지하면서 Spanning-tree Priority를 자유롭게 변경할 수 있는 방법이 필요할 것이다.

Enable Load Balancing between VLANs on Non-vPC Links

  먼저, VLAN 별로 Priority 값을 다르게 주기 위해서는 다음과 같이 설정한다.

[N7k-1]
vpc domain 1
  peer-switch
spanning-tree pseudo-information
  vlan 9-10 root priority 4096 (Virtual vPC device Priority = Root)
  vlan 9 designated priority 8192 (Real Device Priority)
  vlan 10 designated priority 12288 (Real Device Priority)
[N7k-2]
vpc domain 1
  peer-switch
spanning-tree pseudo-information
  vlan 9-10 root priority 4096 (Virtual vPC device Priority = Root)
  vlan 9 designated priority 12288 (Real Device Priority)
  vlan 10 designated priority 8192 (Real Device Priority)
출처 : www.cisco.com

  설정한 후에 SW1에서 BPDU 정보를 확인해 보면 다음과 같다.

SW-1# show span vlan 9 detail

VLAN0009 is executing the rstp compatible Spanning Tree protocol
Bridge Identifier has priority 32768, sysid 9, address 0024.986f.3b44
Configured hello time 2, max age 20, forward delay 15
Current root has priority 4105, address 0023.04ee.be01
Root port is 295 (Ethernet2/39), cost of root path is 4
Topology change flag not set, detected flag not set
Number of topology changes 16 last change occurred 0:06:56 ago
from Ethernet2/39
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 0, topology change 0, notification 0

Port 295 (Ethernet2/39) of VLAN0009 is root forwarding
Port path cost 4, Port priority 128, Port Identifier 128.295
Designated root has priority 4105, address 0023.04ee.be01 (vPC Bridge = Root)
Designated bridge has priority 8201, address 0024.986f.3b41 (Connect N7K-1)
Designated port id is 128.260, designated path cost 0
Timers: message age 15, forward delay 0, hold 0
Number of transitions to forwarding state: 3
Link type is point-to-point by default
BPDU: sent 31, received 3486

Port 296 (Ethernet2/40) of VLAN0009 is alternate blocking
Port path cost 4, Port priority 128, Port Identifier 128.296
Designated root has priority 4105, address 0023.04ee.be01 (vPC Bridge = Root)
Designated bridge has priority 12297, address 0024.986f.3b42 (Connect N7K-2)
Designated port id is 128.272, designated path cost 0
Timers: message age 15, forward delay 0, hold 0
Number of transitions to forwarding state: 4
Link type is point-to-point by default
BPDU: sent 31, received 3496
SW-1# show span vlan 10 detail

VLAN0010 is executing the rstp compatible Spanning Tree protocol
Bridge Identifier has priority 32768, sysid 10, address 0024.986f.3b44
Configured hello time 2, max age 20, forward delay 15
Current root has priority 4106, address 0023.04ee.be01
Root port is 296 (Ethernet2/40), cost of root path is 4
Topology change flag not set, detected flag not set
Number of topology changes 7 last change occurred 0:07:13 ago
from Ethernet2/40
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 0, topology change 0, notification 0

Port 295 (Ethernet2/39) of VLAN0010 is alternate blocking
Port path cost 4, Port priority 128, Port Identifier 128.295
Designated root has priority 4106, address 0023.04ee.be01 (vPC Bridge = Root)
Designated bridge has priority 12298, address 0024.986f.3b41 (Connect N7K-1)
Designated port id is 128.260, designated path cost 0, Topology change is set
Timers: message age 16, forward delay 0, hold 0
Number of transitions to forwarding state: 1
Link type is point-to-point by default
BPDU: sent 4, received 3497

Port 296 (Ethernet2/40) of VLAN0010 is root forwarding
Port path cost 4, Port priority 128, Port Identifier 128.296
Designated root has priority 4106, address 0023.04ee.be01 (vPC Bridge = Root)
Designated bridge has priority 8202, address 0024.986f.3b42 (Connect N7K-2)
Designated port id is 128.272, designated path cost 0
Timers: message age 16, forward delay 0, hold 0
Number of transitions to forwarding state: 3
Link type is point-to-point by default
BPDU: sent 10, received 3492

  각 장비에서 Priority를 자유롭게 변경해도 Root의 Priority가 4096으로 설정되어 있기 때문에 그보다 더 낮은 Priority를 가진 장비가 연결되지 않는한 vPC 장비가 Root를 빼앗기는 일은 발생하지 않을 것이다.