CISCO数据中心虚拟化之VPC技术和配置

CISCO数据中心虚拟化之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优势

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

  1. 实现跨设备的端口聚合;

  2. 避免了以太网环路,也就无需启用STP,也就避免端口被STP协议block;

  3. 可以实现无话网络架构;

  4. 双活工作机制;

  5. 成倍增加链路带宽;

  6. 当链路或是设备出现故障可以实现快速的故障恢复;

  7. 为任意支持 IEEE 802.3ad 的边缘设备提供端口信道连接

  8. 增强链路的高可用性和可扩展性;

  9. 实现网络拓扑简单化.

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

  • 通过 HSRP 配置进行主用-主用第三层转发

  • 通过主用-主用 HSRP 进行完全第三层带宽访问

  • 通过主用-主用 PIM 指定路由器进行第三层迅速组播融合

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

VPC术语名词

  1. vPC domain

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

  1. vPC peer link

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

  1. vPC peer keepalive link

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

  1. vPC peer switch

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

  1. vPC member port

vPC成员端口。

  1. vPC vlan

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

  1. Orphan device

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

  1. Orphan port

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

  1. 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-if)#  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)#switchport mode trunk

Congo(config)# interface port-channel 100

Congo(config-if)#  vpc peer-link

Egypt(config)# interface port-channel 100

Egypt(config)#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 vlans
---------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

Congo(config)# feature vpc

Egypt(config)# feature vpc

2、创建用于VPC的VRF

创建**VRF

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

Egypt(config)# vrf context vpc-keepalive

3、创建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没有起来

4、建立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

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

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

配置port-channel 100(省略)

Congo(config)# interface port-channel 100

Congo(config)#switchport mode trunk

Congo(config)# interface port-channel 100

Congo(config-if)# vpc peer-link

Egypt(config)# interface port-channel 100

Egypt(config)#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 vlans

– ---- ------ --------------------------------------------------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 - - -

6、将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 vlans

– ---- ------ --------------------------------------------------1 Po100 up 1-20,100

vPC status

----------------------------------------------------------------------id Port Status Consistency Reason Active vlans

– ---- ------ ----------- -------------------------- ------------1 Po1 up success success 1-20,100

vPC status
-------------id   Port   Status Consistency Reason      Active vlans

 ------ -----1    Po1    up     success     success       1-20,100

配置VPC Peer-Gateway(可选)

Peer-Gateway用于fast-path functionality(存储,应用服务器)

节点发送返回流量到发送方的一个特殊的mac地址而不是hsrp mac地址(由于VPC防环机制,默认情况这种流量会被丢弃------不允许将VPC peer link收到的流量发送到VPC端口–VPC防环机制

VPC Peer-Gateway使VPC对端(peer)设备转发目的MAC地址为对端路由器的本地mac地址的流量

配置:

 `Congo(config-vpc-domain)#  peer-gateway

应用场景:

有一些NAS设备( NETAPP Fast-Path 或 EMC IP-Reflect ) 回应的时候使用的是发送设备的实MAC地址,而不是HSRP网关的虚拟MAC地址

报文被负载分担到非实MAC所在VPC设备时,会通过peer-link发送到实MAC所在的VPC设备上,而由于重复帧防护机制,该设备会把报文丢弃.

Vpc peer-gateway 解决方案:

当目标MAC地址为peer vpc设备的三层报文发送到本地时,该功能允许本地vpc设备网关正常转发该报文.

cy Reason Active vlans

------ -----1 Po1 up success success 1-20,100


 

## 配置VPC Peer-Gateway(可选)

Peer-Gateway用于fast-path  functionality(存储,应用服务器)

节点发送返回流量到发送方的一个特殊的mac地址而不是hsrp mac地址(由于VPC防环机制,默认情况这种流量会被丢弃------不允许将VPC peer link收到的流量发送到VPC端口--==**VPC防环机制**==)

 VPC Peer-Gateway使VPC对端(peer)设备转发目的MAC地址为对端路由器的本地mac地址的流量

### **配置:**

`Congo(config-vpc-domain)# peer-gateway




### 应用场景:

有一些NAS设备(  NETAPP Fast-Path 或 EMC IP-Reflect ) 回应的时候使用的是发送设备的实MAC地址,而不是HSRP网关的虚拟MAC地址

报文被负载分担到非实MAC所在VPC设备时,会通过peer-link发送到实MAC所在的VPC设备上,而由于重复帧防护机制,该设备会把报文丢弃.



### Vpc peer-gateway 解决方案:

当目标MAC地址为peer vpc设备的三层报文发送到本地时,该功能允许本地vpc设备网关正常转发该报文.



  • 3
    点赞
  • 40
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值