問網工,vPC 爲何物?

1、什麼是端口捆綁?

在我們深入研究 vPC 之前,快速回顧一下端口捆綁很重要。

端口捆綁是一種提供將多個接口聚合(綁定)在一起的技術。然後流量唄負載分擔到每個連接上。端口捆綁提供 3 個主要優勢,

儘管端口捆綁很棒,但問題是 “捆綁” 中的所有鏈接都必須來自同一交換機上的端口。

2、什麼是 vPC?

vPC(虛擬端口捆綁),也稱爲多機箱 EtherChannel (MEC),是 Cisco Nexus 交換機上的一項功能,可提供跨多個交換機(即 vPC 對等體)配置端口捆綁的能力。

vPC 類似於 Catalyst 6500s 上的虛擬交換機系統 (VSS)。但是,vPC 和 VSS 之間的主要區別在於 VSS 創建單個邏輯交換機,這樣的結果是管理和配置都在同一個控制平面。而使用 vPC,每臺交換機都是獨立管理和配置的。

請務必記住,使用 vPC 時,兩臺交換機都是獨立管理的。這意味着您需要在兩臺 Nexus 交換機上創建並允許您的 VLAN。

3、組件

vPC 由以下組件組成。下面的示例圖顯示了關鍵的 vPC 組件,

讓我們看看每個 vPC 組件,

4、孤立端口

如前所述,孤立端口是未配置爲 vPC 成員端口並配置有 vPC VLAN(即 VLAN 通過 vPC 對等鏈路承載)的端口。

問題就在這裏。當 vPC peer-link 關閉時,只有 vPC 成員端口關閉,即孤立端口保持 up。因此,配置了 NIC 組合或處於活動 / 備用設置並連接到兩個交換機的設備將無法正確故障轉移。爲了確保孤立端口正確關閉,使用了接口命令孤立端口暫停。

對於有主備鏈路的單臺設備,建議在兩臺交換機之間進行 port-channel 端口,並將兩個端口都配置爲 vPC 成員端口。

5、對等鏈接

vPC 對等鏈路是 vPC 域中最重要的組件。正如我們提到的,如果一個成員端口出現故障,那麼 peer-link 將用於向對等體發送單播流量。

參考如下示例:

圖 2:PeerLink 場景

6、配置

下面展示了必要的配置。此配置適用於兩個交換機。但是,請確保相應地修改 IP 地址。

此外,請注意,在此示例中,以下端口捆綁將用於 PeerLink 和 KeepAlive。

Po300 - vPC PeerLink 

Po400 - vPC KeepAlive

6.1 創建 vPC VRF

vrf context VPC_KEEPALIVE

6.2 啓用 vPC

feature vpc

6.3 創建 vPC 域

vpc domain 105
 peer-keepalive destination 10.1.1.1 source 10.1.1.2 vrf VPC_KEEPALIVE
interface Ethernet1/37
 description vPC Peerlink
 switchport mode trunk
 channel-group 300 mode active

interface Ethernet1/38
 description vPC Peerlink
 switchport mode trunk
 channel-group 300 mode active

interface port-channel300
 description vPC Peerlink
 vpc peer-link

6.5 創建 vPC KeepAlive

interface Ethernet1/47
 description vPC Keepalive
 no switchport
 channel-group 400 mode active

interface Ethernet1/48
 description vPC Keepalive
 no switchport
 channel-group 400 mode active

interface port-channel400
 description vPC Keepalive
 vrf member VPC_KEEPALIVE
 no switchport
 ip address 10.1.1.[1-2]/30

6.6 創建 vPC 成員端口

最後,我們通過在每個交換機上創建一個端口通道來創建一個虛擬端口通道。端口通道配置是標準配置,但我們也包括命令 vpc 30. 此命令添加到兩個交換機上的兩個端口通道。

# switch 1
interface gi0/30
 channel-group 30

interface po30
 vpc 30

# switch 2
interface gi0/30
  channel-group 30

interface po30
  vpc 30

完成後,使用以下命令檢查 vPC 的狀態。

7 顯示 / 調試命令

7.1 Brief

要查看 vPC 設置及其運行方式的概述,首先要檢查的地方是通過命令 show vpc brief.

switch2# show vpc brief
Legend:
             (*) - local vPC is down, forwarding via vPC peer-link

vPC domain id                  : 100
Peer status                    : peer adjacency formed ok
vPC keep-alive status          : peer is alive
Configuration consistency status  : success
Per-vlan consistency status    : success
Type-2 consistency status      : success
vPC role                       : secondary
Number of vPCs configured      : 2
Peer Gateway                   : Enabled
Peer gateway excluded VLANs    : -
Dual-active excluded VLANs     : -
Graceful Consistency Check     : Enabled
Auto-recovery status           : Enabled (timeout = 240 seconds)

vPC Peer-link status
---------------------------------------------------------------------
id   Port   Status Active vlans
--   ----   ------ --------------------------------------------------
1     Po2    up     1,9,1120,4093

vPC status
----------------------------------------------------------------------------
id  Port     Status Consistency Reason                  Active vlans
------ ----------- ------ ----------- -------------------------- -----------
30  Po30     up     success      success                   1120
40  Po40     up     success      success                   1120

7.2 孤立端口

要確認哪些端口是孤立端口,請使用以下命令,

switch1# sh vpc orphan-ports
Note:
--------::Going through port database. Please be patient.::--------

VLAN    Orphan Ports
------- -------------------------
400     Eth1/1, Eth1/2, Eth1/3, Eth1/4, Eth1/5, Eth1/6

7.3 一致性

爲了顯示 vPC 對等體之間的一致性,show vpc consistency-parameter … 使用了。

switch2# sh vpc consistency-parameters vpc 30

 Legend:
     Type 1 : vPC will be suspended in case of mismatch

Name                     Type  Local Value         Peer Value
-------------            ----  ---------------------- -----------------------
Shut Lan                 1  No                  No
STP Port Type            1  Edge Trunk Port     Edge Trunk Port
STP Port Guard           1  None                None
STP MST Simulate PVST    1  Default             Default
lag-id                   1  [(7f9b,             [(7f9b,
                               0-2-4-ef-be-69, 801b, 0-2-4-ef-be-69, 801b,
                                0, 0)(8000,       0, 0)(8000,
                               f4-cf-e2-0-1e-76, 2,   f4-cf-e2-0-1e-76, 2,
                               0, 0)]              0, 0)]
mode                     1  active              active
Speed                    1  10 Gb/s             10 Gb/s
Duplex                   1  full                full
Port Mode                1  trunk               trunk
Native Vlan              1  1                   1
MTU                      1  1500                1500
Admin port mode          1
vPC card type            1  Empty               Empty
Allowed VLANs            -  2-8,10-4092,4094    2-8,10-4092,4094
Local suspended VLANs    -  -                   -

7.4 Peer-KeepAlive

最後,show vpc peer-keepalive 使用該命令檢查 vPC keepalive 的狀態。

switch2# show vpc peer-keepalive

vPC keep-alive status           : peer is alive
--Peer is alive for          : (2300862) seconds, (249) msec
--Send status                : Success
--Last send at               : 2015.03.19 06:52:22 954 ms
--Sent on interface          : Po400
--Receive status             : Success
--Last receive at            : 2015.03.19 06:52:22 955 ms
--Received on interface      : Po400
--Last update from peer      : (0) seconds, (219) msec

vPC Keep-alive parameters
--Destination                : 10.1.1.1
--Keepalive interval         : 1000 msec
--Keepalive timeout          : 5 seconds
--Keepalive hold timeout     : 3 seconds
--Keepalive vrf              : VPC_KEEPALIVE
--Keepalive udp port         : 3200
--Keepalive tos              : 192

來自:網絡工程師阿龍

本文由 Readfog 進行 AMP 轉碼,版權歸原作者所有。
來源https://mp.weixin.qq.com/s/Nsyh7x3qZfubFcEAW6Z7Wg