思科vPC技术和配置

思科VPC技术和配置

VPC概念

vpc (Virtual Port Channel),vPC 是一种实现跨设备链路聚合的机制,基于 LACP(单台设备链路聚合的标准) 进行了扩展,能够实现多台设备间的链路聚合,从而把链路可靠性从单板级提高到了设备级。

VPC可以实现==跨物理设备的端口聚合==,目前只在Cisco Nexus系列交换机支持,目前据我所知在CISCO的Nexus 5000以上的型号都可以使用该功能。

VPC中包含VPC domain、VPC peer-link、VPC peer keepalive link、VPC peer switch以及port-channel端口等元素。

一定牢记,VPC是一组端口的概念,而不是一组设备的概念。

实现方式:

2nexus设备关联到VPC domain。两台设备通过2条特殊链路实现信息交换:

vpc的缘由

如上图所示,在传统的网络拓扑中要实现网络的冗余,一般都会使用双链路上连的方式,而这种方式明显有一个环路,在这种拓扑下都会开起生成树协议,这时就会有一种链路是block状态的。所以这种方式实现冗余,并不会增加网络带宽。如果想用链路聚合方式来做双链路上连到两台不同的设备,port-channel功能又不支持跨设备聚合。所以在这种背景下就出现了vPC的概念,和port-channel功能相比区别是:vPC功能解决了传统聚合端口不能跨设备的问题。和传统跨设备方案相比的区别是:即增强网络冗余又能增加网络带宽。

VPC的部署拓扑

 

VPC优势

vPC 为第二层网络提供大量重要优势,并借助第二层功能提供的优势,对第三层互联进行一系列改进。

  1. 实现跨设备的端口聚合
  2. 实现无环网络架构
  3. 消除了因为生成树协议而产生的阻塞端口
  4. 可以使用所有可用的上行链路,成倍增加链路带宽
  5. 当有链路或者设备失效的时候实现快速收敛
  6. 双活工作机制
  7. 增强链路的高可用性和可扩展性

此外,还支持以下重要的三层特性:

  • 通过 HSRP 配置进行主用-主用第三层转发
  • 通过主用-主用 HSRP 进行完全第三层带宽访问
  • 通过主用-主用 PIM 指定路由器进行第三层迅速组播融合

注意:VPC只能用于二层,VPC端口不能运行路由协议。

VPC术语名词

1.  vPC domain

vPC domain定义了一个vPC分组,分组中包含2台vPC peer devices,两台vPC peer devices配置的domain ID必须一致,在同一个二层网络中,vPC domain ID需要唯一存在。

2.  vPC peer link

用来在两台peer devices之间同步状态信息的链路。vPC peer link最少要是2个10G以太网接口。

3.  vPC peer keepalive link

可以使管理接口或者SVI接口,只承载心跳信息,用来检查vPC对端设备是否active。

4.  vPC peer switch

构成vPC的其中一台交换机,vPC中两台交换机一台被选举为primary,另一台为secondary。

5.  vPC member port

vPC成员端口。

6.  vPC vlan

可以在vPC peer link上透传的vlan,non-vPC vlan则反之。

7.  Orphan device

单链路上联nexus交换机的设备称之为孤立设备。

8.  Orphan port

用来连接nexus交换机和Orphan device的接口称之为孤立接口。

9.  CFS(Cisco Fabric Service)

运行在vPC peer link上面用来实现vPC peer device状态同步的协议。

配置vpc功能:

开启VPC特性

Congo(config)# feature vpc
Egypt(config)# feature vpc

创建用于VPC的VRF

创建VRF

Congo(config)# vrf context vpc-keepalive
Egypt(config)# vrf context vpc-keepalive

创建VPC keeplive链路

Congo(config)# int ethernet 2/47
Congo(config-if)#   no switchport
Congo(config-if)#  vrf member vpc-keepalive
Congo(config-if)#  ip address 1.1.1.1 255.255.255.252

Egypt(config)# interface ethernet 2/48
Egypt(config-if)#  no switchport
Egypt(config-if)#  vrf member vpc-keepalive
Egypt(config-if)#  ip address 1.1.1.2 255.255.255.252

测试连通性:

Congo# ping 1.1.1.2 vrf vpc-keepalive

查看:

Congo# sho vpc

Legend:

(*) - local vPC is down, forwarding via vPC peer-link

vPC domain id                   : 1

Peer status                     : peer link not configured

vPC keep-alive status              : peer is alive

Configuration consistency status       : failed

Configuration consistency reason       : vPC peer-link does not exists

vPC role                       : none established

Number of vPCs configured            : 0

Peer Gateway                    : Disabled

Dual-active excluded VLANs           : -

可以看到keepalive已经OK,但vpc peer没有起来

建立VPC-domain

Congo(config)# vpc domain 1
Congo(config-vpc-domain)#  peer-keepalive destination 1.1.1.2 source 1.1.1.1 vrf vpc-keepalive

Egypt(config)# vpc domain 1
Egypt(config-vpc-domain)#  peer-keepalive destination 1.1.1.1 source 1.1.1.2 vrf vpc-keepalive

配置VPC peer 链路(NEXUS交换机互联)

必须使用10G端口,并且指定速率。

配置port-channel 100(省略)

Congo(config)# interface port-channel 100
Congo(config-if)#switchport mode trunk
Congo(config)# interface port-channel 100
Congo(config-if)#  vpc peer-link
 
Egypt(config)# interface port-channel 100
Egypt(config-if)#switchport mode trunk
Egypt(config)# interface port-channel 100
Egypt(config-if)#  vpc peer-link

配置后STP端口类型从network变为vPC peer-STP Bridge Assurance将会开启,并且不能被关闭。

验证:

Egypt# show vpc
Legend:
(*) - local vPC is down, forwarding via vPC peer-link
vPC domain id                  : 1
Peer status                   : peer adjacency formed ok
vPC keep-alive status                 : peer is alive
Configuration consistency status                : success
vPC role                    : secondary
Number of vPCs configured                 : 0
Peer Gateway                   : Disabled
Dual-active excluded VLANs           : -vPC Peer-link status
---------------id   Port   Status   Active
---------------1    Po100  up     1-20,100

如果Configuration consistency status状态为any,可以通过下面命令检查具体不一致的信息

Congo# show vpc consistency-parameters global
Legend: 
Type 1 : vPC will be suspended in case of mismatch
Name            Type  Local Value            Peer Value
------
STP Mode           1     Rapid-PVST             Rapid-PVST
STP Disabled         1     VLANs 91               VLANs 91
STP MST Region Name    1     customer               customer
STP MST Region Revision   1     1                      1
STP MST Region Instance to  1
VLAN Mapping
STP Loopguard        1     Disabled               Disabled
STP Bridge Assurance     1     Enabled                Enabled
STP Port Type, Edge     1     Normal, Disabled,          Normal,Disabled,
BPDUFilter, Edge BPDUGuard         Disabled                Disabled
STP MST Simulate PVST   1     Enabled                Enabled
Interface-vlan admin up   2     40-43,50,60,70-71,91,1 40-43,50,60,70-71,91,100-103                 00-103
Allowed VLANs        -     40-43,50,60,91,100-103 9,40-43,50,60,91,100-1,1000                  03,1000
Local suspended VLANs    -     -                      -

将port-channel加入VPC(连接下行端口)

Congo(config)# interface ethernet 2/1
Congo(config-if)#  channel-group 1 mode active
Congo(config)# interface port-channel 1
Congo(config-if)#  switchport
Congo(config-if)#  switchport mode trunk
Congo(config-if)#  vpc 1

Egypt(config)# int ethernet 2/2
Egypt(config-if)#  channel-group 1 mode active
Egypt(config)# int port-channel 1
Egypt(config-if)#  switchport
Egypt(config-if)#  switchport mode trunk
Egypt(config-if)#  vpc 1

下行交换机配置(不支持VPC设备)配置为普通ether-channel

Kenya(config)# interface ethernet 2/11-12
Kenya(config-if-range)# switchport
Kenya(config-if-range)# channel-group 1 mode active
Kenya(config-if-range)# no shutdown
Kenya(config)# int port-channel 1
Kenya(config-if)#  switchport
Kenya(config-if)#  switchport mode trunk

验证VPC

Congo# show vpc
Legend:
(*) - local vPC is down, forwarding via vPC peer-link
vPC domain id                     : 1
Peer status                     : peer adjacency formed ok
vPC keep-alive status                  : peer is alive
Configuration consistency status          : success
vPC role                       : primary
Number of vPCs configured                  : 1
Peer Gateway                     : Disabled
Dual-active excluded VLANs                     : -vPC Peer-link status
---------------id   Port   Status   Active
---------------1    Po100  up     1-20,100

重复帧防护机制

vPC的一个重要转发机制:vpc peer通过peer link发送过来的帧不会从vpc成员端口转发出去,而发给非vpc vlanorphan port或者上联链路的流量会正常转发

Orphan port:不是通过vpc连接,但承载vpc vlan的端口

示例:单播——Mac_A  Mac_B

 

 说明:从Mac_A发送到MAC_B的包最初被泛洪到fabric中。它通过vPC1(这是一个端口通道,因此使用Sw3端口通道负载平衡算法来选择一个路径)选择一条路径,然后通过VLAN中的其他vPC以及vPC对等链接被泛洪。SW2不转发包,它是本地vPC链接,因为它通过vPC对等链接接收包。只有在SW1vPC中没有端口的情况下,它才会向下转发它的本地vPC成员端口。

转载自:https://blog.csdn.net/sisyphuss/article/details/102784756

    https://blog.csdn.net/qq_22193519/article/details/90038830

原文地址:https://www.cnblogs.com/dier-gaohe/p/14292949.html