با فرض اینکه این جفت بهعنوان ریشه STP در شبکه استفاده میشود، دستور system priority value اولویت سیستم را برای ارسال به پورتهای VPC تنظیم میکند. این مقدار باید در هر دو دستگاه یکسان باشد. با این حال، اگر مقداری غیر از اولویت مجاز STP/RSTP تنظیم کنید، این عدد به پایین گرد میشود. بهعنوان مثال، اگر اولویت سیستم را 101 تنظیم کنید، اولویت STP/RSTP به 0 تنظیم خواهد شد.
تنظیمات vpc domain:
Switch_1 vpc domain 1 peer detection peer detection ipaddr 1.1.1.2 1.1.1.1 peer keepalive role priority 1 system priority 101 peer link port-channel 1 exit Switch_2 vpc domain 1 peer detection peer detection ipaddr 1.1.1.1 1.1.1.2 peer keepalive role priority 1 system priority 101 peer link port-channel 1 exit
Switch_1 vpc domain 1 peer detection peer detection ipaddr 1.1.1.2 1.1.1.1 peer keepalive role priority 1 system priority 101 peer link port-channel 1 exit Switch_2 vpc domain 1 peer detection peer detection ipaddr 1.1.1.1 1.1.1.2 peer keepalive role priority 1 system priority 101 peer link port-channel 1 exit
system-mac-addr pair بهعنوان Root ID و Bridge ID استفاده میشود، با فرمت 00:02:bc:00:82:01، که در آن 01، domain number است.
مشاهده وضعیت STP در تمام دستگاههای schematic:
Switch_1#show spanning-tree active Spanning tree enabled mode: RSTP Default port cost method: long Loopback guard: Disabled TC protection: Disabled Root ID Priority: 0 Address: 00:02:bc:00:82:01 This switch is the root Hello Time: 2 sec Max Age: 20 sec Forward Delay: 15 sec Number of TC BPDU handled 6 Number of topology changes: 5 last change occurred: 00:08:31 ago from Po2 Times: hold: 1, topology change: 35, notification: 2 hello: 2, max age: 20, forward delay: 15 Interfaces Name State Prio.Nbr Cost Sts Role PortFast Type ---------- -------- --------- -------- ------ ---- -------- ----------------- Po1 enabled 128.1000 2000 Frw Desg No P2P (RSTP) Po2 enabled 128.1001 2000 Frw Desg No P2P (RSTP) Po3 enabled 128.1002 2000 Frw Desg No P2P (RSTP) Switch_2#show spanning-tree active Spanning tree enabled mode: RSTP Default port cost method: long Loopback guard: Disabled TC protection: Disabled Root ID Priority: 0 Address: 00:02:bc:00:82:01 This switch is the root Hello Time: 2 sec Max Age: 20 sec Forward Delay: 15 sec Number of TC BPDU handled 6 Number of topology changes: 4 last change occurred: 00:08:31 ago from Po2 Times: hold: 1, topology change: 35, notification: 2 hello: 2, max age: 20, forward delay: 15 Interfaces Name State Prio.Nbr Cost Sts Role PortFast Type ---------- -------- --------- -------- ------ ---- -------- ----------------- Po1 enabled 128.1000 2000 Frw Desg No P2P (RSTP) Po2 enabled 128.1001 2000 Frw Desg No P2P (RSTP) Po3 enabled 128.1002 2000 Frw Desg No P2P (RSTP) Access_1#show spanning-tree active *********************************** Process 0 *********************************** Spanning tree enabled mode RSTP Default port cost method: long Loopback guard: Disabled Loop guard default: Disabled TC protection: Disabled Root ID Priority 0 Address 00:02:bc:00:82:01 Cost 1000 Port Po1 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32768 Address e4:5a:d4:d3:66:40 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Number of TC BPDU handled 24 Number of topology changes 2 last change occurred 00:08:32 ago from Po1 Times: hold 1, topology change 35, notification 2 hello 2, max age 20, forward delay 15 Interfaces Name State Prio.Nbr Cost Sts Role PortFast Type --------- --------- -------- -------- ------ ---- -------- ---------------------------- Po1 enabled 128.1000 1000 Frw Root No P2P (RSTP) Access_2#show spanning-tree active *********************************** Process 0 *********************************** Spanning tree enabled mode RSTP Default port cost method: long Loopback guard: Disabled Loop guard default: Disabled TC protection: Disabled Root ID Priority 0 Address 00:02:bc:00:82:01 Cost 1000 Port Po1 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32768 Address e4:5a:d4:6a:16:00 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Number of TC BPDU handled 12 Number of topology changes 2 last change occurred 00:08:31 ago from Po1 Times: hold 1, topology change 35, notification 2 hello 2, max age 20, forward delay 15 Interfaces Name State Prio.Nbr Cost Sts Role PortFast Type --------- --------- -------- -------- ------ ---- -------- ---------------------------- Po1 enabled 128.1000 1000 Frw Root No P2P (RSTP)
Switch_1#show spanning-tree active Spanning tree enabled mode: RSTP Default port cost method: long Loopback guard: Disabled TC protection: Disabled Root ID Priority: 0 Address: 00:02:bc:00:82:01 This switch is the root Hello Time: 2 sec Max Age: 20 sec Forward Delay: 15 sec Number of TC BPDU handled 6 Number of topology changes: 5 last change occurred: 00:08:31 ago from Po2 Times: hold: 1, topology change: 35, notification: 2 hello: 2, max age: 20, forward delay: 15 Interfaces Name State Prio.Nbr Cost Sts Role PortFast Type ---------- -------- --------- -------- ------ ---- -------- ----------------- Po1 enabled 128.1000 2000 Frw Desg No P2P (RSTP) Po2 enabled 128.1001 2000 Frw Desg No P2P (RSTP) Po3 enabled 128.1002 2000 Frw Desg No P2P (RSTP) Switch_2#show spanning-tree active Spanning tree enabled mode: RSTP Default port cost method: long Loopback guard: Disabled TC protection: Disabled Root ID Priority: 0 Address: 00:02:bc:00:82:01 This switch is the root Hello Time: 2 sec Max Age: 20 sec Forward Delay: 15 sec Number of TC BPDU handled 6 Number of topology changes: 4 last change occurred: 00:08:31 ago from Po2 Times: hold: 1, topology change: 35, notification: 2 hello: 2, max age: 20, forward delay: 15 Interfaces Name State Prio.Nbr Cost Sts Role PortFast Type ---------- -------- --------- -------- ------ ---- -------- ----------------- Po1 enabled 128.1000 2000 Frw Desg No P2P (RSTP) Po2 enabled 128.1001 2000 Frw Desg No P2P (RSTP) Po3 enabled 128.1002 2000 Frw Desg No P2P (RSTP) Access_1#show spanning-tree active *********************************** Process 0 *********************************** Spanning tree enabled mode RSTP Default port cost method: long Loopback guard: Disabled Loop guard default: Disabled TC protection: Disabled Root ID Priority 0 Address 00:02:bc:00:82:01 Cost 1000 Port Po1 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32768 Address e4:5a:d4:d3:66:40 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Number of TC BPDU handled 24 Number of topology changes 2 last change occurred 00:08:32 ago from Po1 Times: hold 1, topology change 35, notification 2 hello 2, max age 20, forward delay 15 Interfaces Name State Prio.Nbr Cost Sts Role PortFast Type --------- --------- -------- -------- ------ ---- -------- ---------------------------- Po1 enabled 128.1000 1000 Frw Root No P2P (RSTP) Access_2#show spanning-tree active *********************************** Process 0 *********************************** Spanning tree enabled mode RSTP Default port cost method: long Loopback guard: Disabled Loop guard default: Disabled TC protection: Disabled Root ID Priority 0 Address 00:02:bc:00:82:01 Cost 1000 Port Po1 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32768 Address e4:5a:d4:6a:16:00 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Number of TC BPDU handled 12 Number of topology changes 2 last change occurred 00:08:31 ago from Po1 Times: hold 1, topology change 35, notification 2 hello 2, max age 20, forward delay 15 Interfaces Name State Prio.Nbr Cost Sts Role PortFast Type --------- --------- -------- -------- ------ ---- -------- ---------------------------- Po1 enabled 128.1000 1000 Frw Root No P2P (RSTP)
اگر دستگاه اصلی در شبکه دستگاه دیگری باشد، تنظیمات pair دستگاهها تغییر میکند و اولویت STP (spanning-tree priority) این pair با استفاده از دستور زیر تنظیم میشود. این اولویت باید در هر دو دستگاه یکسان باشد:
در این مثال، Access_1 به عنوان STP root انتخاب شده است.
Switch_1#show running-config spanning-tree priority 8192 ! vlan database vlan 10,1001 exit ! vpc vpc domain 1 peer detection peer detection ipaddr 1.1.1.2 1.1.1.1 peer keepalive role priority 1 peer link port-channel 1 exit Switch_1#show spanning-tree active Spanning tree enabled mode: RSTP Default port cost method: long Loopback guard: Disabled TC protection: Disabled Root ID Priority: 0 Address: e4:5a:d4:d3:66:40 Cost: 2000 Port: Po2 Hello Time: 2 sec Max Age: 20 sec Forward Delay: 15 sec Bridge ID Priority: 8192 Address: 00:02:bc:00:82:01 Hello Time: 2 sec Max Age: 20 sec Forward Delay: 15 sec Number of TC BPDU handled 9 Number of topology changes: 6 last change occurred: 00:25:31 ago from Po2 Times: hold: 1, topology change: 35, notification: 2 hello: 2, max age: 20, forward delay: 15 Interfaces Name State Prio.Nbr Cost Sts Role PortFast Type ---------- -------- --------- -------- ------ ---- -------- ----------------- Po1 enabled 128.1000 2000 Frw Desg No P2P (RSTP) Po2 enabled 128.1001 2000 Frw Root No P2P (RSTP) Po3 enabled 128.1002 2000 Frw Desg No P2P (RSTP)
Switch_1#show running-config spanning-tree priority 8192 ! vlan database vlan 10,1001 exit ! vpc vpc domain 1 peer detection peer detection ipaddr 1.1.1.2 1.1.1.1 peer keepalive role priority 1 peer link port-channel 1 exit Switch_1#show spanning-tree active Spanning tree enabled mode: RSTP Default port cost method: long Loopback guard: Disabled TC protection: Disabled Root ID Priority: 0 Address: e4:5a:d4:d3:66:40 Cost: 2000 Port: Po2 Hello Time: 2 sec Max Age: 20 sec Forward Delay: 15 sec Bridge ID Priority: 8192 Address: 00:02:bc:00:82:01 Hello Time: 2 sec Max Age: 20 sec Forward Delay: 15 sec Number of TC BPDU handled 9 Number of topology changes: 6 last change occurred: 00:25:31 ago from Po2 Times: hold: 1, topology change: 35, notification: 2 hello: 2, max age: 20, forward delay: 15 Interfaces Name State Prio.Nbr Cost Sts Role PortFast Type ---------- -------- --------- -------- ------ ---- -------- ----------------- Po1 enabled 128.1000 2000 Frw Desg No P2P (RSTP) Po2 enabled 128.1001 2000 Frw Root No P2P (RSTP) Po3 enabled 128.1002 2000 Frw Desg No P2P (RSTP)
اگر STP BPDU به سوئیچ اصلی (Primary) برسد، اطلاعات از طریق Peer-Link در پیامهای سرویس VPC به سوئیچ ثانویه (Secondary) ارسال میشود. این مکانیزم بهطور مشابه عمل میکند اگر STP BPDU به سوئیچ ثانویه برسد.
اگر Root Interface در یکی از سوئیچهای pair
خراب شود، Root Interface جدید Peer-Link خواهد بود.
15-Aug-2024 02:27:06 %LINK-W-Down: te1/0/12 15-Aug-2024 02:27:06 %TRUNK-W-PORTREMOVED: Port te1/0/12 removed from Po2 15-Aug-2024 02:27:06 %STP-N-ROOTBRIDGECHANGE: This bridge is root. 15-Aug-2024 02:27:06 %LINK-W-Down: Po2 15-Aug-2024 02:27:06 %STP-N-ROOTBRIDGECHANGE: New root bridge e4:5a:d4:d3:66:40 is on Po1. Switch_1#show spanning-tree active Spanning tree enabled mode: RSTP Default port cost method: long Loopback guard: Disabled TC protection: Disabled Root ID Priority: 0 Address: e4:5a:d4:d3:66:40 Cost: 4000 Port: Po1 Hello Time: 2 sec Max Age: 20 sec Forward Delay: 15 sec Bridge ID Priority: 8192 Address: 00:02:bc:00:82:01 Hello Time: 2 sec Max Age: 20 sec Forward Delay: 15 sec Number of TC BPDU handled 9 Number of topology changes: 6 last change occurred: 00:26:28 ago from Po2 Times: hold: 1, topology change: 35, notification: 2 hello: 2, max age: 20, forward delay: 15 Interfaces Name State Prio.Nbr Cost Sts Role PortFast Type ---------- -------- --------- -------- ------ ---- -------- ----------------- Po1 enabled 128.1000 2000 Frw Root No P2P (RSTP) Po3 enabled 128.1002 2000 Frw Desg No P2P (RSTP)
15-Aug-2024 02:27:06 %LINK-W-Down: te1/0/12 15-Aug-2024 02:27:06 %TRUNK-W-PORTREMOVED: Port te1/0/12 removed from Po2 15-Aug-2024 02:27:06 %STP-N-ROOTBRIDGECHANGE: This bridge is root. 15-Aug-2024 02:27:06 %LINK-W-Down: Po2 15-Aug-2024 02:27:06 %STP-N-ROOTBRIDGECHANGE: New root bridge e4:5a:d4:d3:66:40 is on Po1. Switch_1#show spanning-tree active Spanning tree enabled mode: RSTP Default port cost method: long Loopback guard: Disabled TC protection: Disabled Root ID Priority: 0 Address: e4:5a:d4:d3:66:40 Cost: 4000 Port: Po1 Hello Time: 2 sec Max Age: 20 sec Forward Delay: 15 sec Bridge ID Priority: 8192 Address: 00:02:bc:00:82:01 Hello Time: 2 sec Max Age: 20 sec Forward Delay: 15 sec Number of TC BPDU handled 9 Number of topology changes: 6 last change occurred: 00:26:28 ago from Po2 Times: hold: 1, topology change: 35, notification: 2 hello: 2, max age: 20, forward delay: 15 Interfaces Name State Prio.Nbr Cost Sts Role PortFast Type ---------- -------- --------- -------- ------ ---- -------- ----------------- Po1 enabled 128.1000 2000 Frw Root No P2P (RSTP) Po3 enabled 128.1002 2000 Frw Desg No P2P (RSTP)