在我们深入研究 vPC 之前,快速回顾一下端口捆绑很重要。
端口捆绑是一种提供将多个接口聚合(绑定)在一起的技术。然后流量呗负载分担到每个连接上。端口捆绑提供 3 个主要优势,
尽管端口捆绑很棒,但问题是“捆绑”中的所有链接都必须来自同一交换机上的端口。
vPC(虚拟端口捆绑),也称为多机箱 EtherChannel (MEC),是 Cisco Nexus 交换机上的一项功能,可提供跨多个交换机(即 vPC 对等体)配置端口捆绑的能力。
vPC 类似于 Catalyst 6500s 上的虚拟交换机系统 (VSS)。但是,vPC 和 VSS 之间的主要区别在于 VSS 创建单个逻辑交换机,这样的结果是管理和配置都在同一个控制平面。而使用 vPC,每台交换机都是独立管理和配置的。
请务必记住,使用 vPC 时,两台交换机都是独立管理的。这意味着您需要在两台 Nexus 交换机上创建并允许您的 VLAN。
vPC 由以下组件组成。下面的示例图显示了关键的 vPC 组件,
让我们看看每个 vPC 组件,
如前所述,孤立端口是未配置为 vPC 成员端口并配置有 vPC VLAN(即 VLAN 通过 vPC 对等链路承载)的端口。
问题就在这里。当 vPC peer-link 关闭时,只有 vPC 成员端口关闭,即孤立端口保持up。因此,配置了 NIC 组合或处于活动/备用设置并连接到两个交换机的设备将无法正确故障转移。为了确保孤立端口正确关闭,使用了接口命令孤立端口暂停。
对于有主备链路的单台设备,建议在两台交换机之间进行port-channel端口,并将两个端口都配置为vPC成员端口。
vPC 对等链路是 vPC 域中最重要的组件。正如我们提到的,如果一个成员端口出现故障,那么 peer-link 将用于向对等体发送单播流量。
参考如下示例:
流量到达 Server1,目的地是 Server2。
流量通过 Po30 发送到 Switch1。
由于成员端口关闭,数据包无法通过 Switch1 上的 Po40 路径。
相反,数据包通过 vPC 对等链路发送到对等交换机,并通过 Po40 发送到 Server2。
图 2:PeerLink 场景
下面展示了必要的配置。此配置适用于两个交换机。但是,请确保相应地修改 IP 地址。
此外,请注意,在此示例中,以下端口捆绑将用于PeerLink和KeepAlive。
Po300 - vPC PeerLink
Po400 - vPC KeepAlive
vrf context VPC_KEEPALIVE
feature 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
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
最后,我们通过在每个交换机上创建一个端口通道来创建一个虚拟端口通道。端口通道配置是标准配置,但我们也包括命令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 的状态。
要查看 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
要确认哪些端口是孤立端口,请使用以下命令,
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
为了显示 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 - - -
最后,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
来自:网络工程师阿龙
END
官方站点:www.linuxprobe.com
Linux命令大全:www.linuxcool.com
刘遄老师QQ:5604241
Linux技术交流群:3586725
(新群,火热加群中……)
想要学习Linux系统的读者可以点击"阅读原文"按钮来了解书籍《Linux就该这么学》,同时也非常适合专业的运维人员阅读,成为辅助您工作的高价值工具书!