使用EVE实现Nexus vPC 功能

模拟nxos的内存要求有点高

Posted by i9u on April 26, 2020

使用EVE实现Nexus vPC 功能

这是我的第一篇博客。

1.前言

vPC是Cisco交换机虚拟化功能,能够在双上联非堆叠的情况下使用port channel的技术,当然我想看这编文章的人也相当清楚这个技术的原理和应用场景。使用EVE来做这个实验是不错的选择,前提是你的电脑内存要十分充足,因为一台NXOS的模拟设备就要分配出4G的内存空间,建议你至少拥有16G以上的内存。

2.实验环境

  1. 模拟器 EVE-ng社区版 下载地址

3.镜像

  1. Cisco NX-OSv 9k-7.0.3.17.4
  2. i86bi_linux_l2-adventerprisek9-ms.SS

镜像资源可以从这搜寻,按需下载并导入: 链接

4.拓扑图

vpc topology

5.简单描述

  1. Mgmt 0 口用作直连peer keep alive检测用
  2. E1/2-3则作为vPC peer link 用
  3. E1/4-5是属于vPC member port ,用于连接下挂的交换机。
  4. 配置port-channel mode的时候其实可以不使用LACP亦能够完成对接,这里的member port就使用静态的on模式,peer-link则使用LACP。

6.配置步骤

  1. 给mgmt口配置ip,并开启
  2. 划分vpc domain,配置peer-keepalive 目的ip和源ip
  3. 创建port-channel 20,并将E1/2-3划入port-channel 20,配置vpc peer-link
  4. 创建port-channel 2,并将E1/4-5划入port-channel 21,配置为vpc member角色,分配id21

7.配置

N9K-1
feature vPC
feature lacp

interface mgmt0
  vrf member management
  ip address 100.1.1.1/24

vPC domain 7
  role priority 1
  peer-keepalive destination 100.1.1.2 source 100.1.1.1

interface port-channel20
  switchport mode trunk
  vPC peer-link

interface Ethernet1/2
  switchport mode trunk
  channel-group 20 mode active

interface Ethernet1/3
  switchport mode trunk
  channel-group 20 mode active

interface port-channel2
  switchport mode trunk
  switchport trunk allowed vlan 1,10,20,30
  vPC 21

interface Ethernet1/4
  switchport mode trunk
  switchport trunk allowed vlan 1,10,20,30
  channel-group 2

interface Ethernet1/5
  switchport mode trunk
  switchport trunk allowed vlan 1,10,20,30
  channel-group 2

N9K-2
feature vPC
feature lacp

interface mgmt0
  vrf member management
  ip address 100.1.1.2/24

vPC domain 7
  peer-keepalive destination 100.1.1.1 source 100.1.1.2

interface port-channel20
  switchport mode trunk
  vPC peer-link

interface Ethernet1/2
  switchport mode trunk
  channel-group 20 mode active

interface Ethernet1/3
  switchport mode trunk
  channel-group 20 mode active

interface port-channel2
  switchport mode trunk
  switchport trunk allowed vlan 1,10,20,30
  vPC 21

interface Ethernet1/4
  switchport mode trunk
  switchport trunk allowed vlan 1,10,20,30
  channel-group 2

interface Ethernet1/5
  switchport mode trunk
  switchport trunk allowed vlan 1,10,20,30
  channel-group 2

SW

interface range Ethernet0/0-3
 switchport trunk allowed vlan 1,10,20,30
 switchport trunk encapsulation dot1q
 switchport mode trunk
 channel-group 2 mode on

interface Port-channel2
 switchport trunk allowed vlan 1,10,20,30
 switchport trunk encapsulation dot1q
 switchport mode trunk

8.验证配置

使用
show vpc brief
or
show vpc consistency-parameters [Virtual Port Channel number]
来检查配置的结果

vpc brief

使用
show vpc consistency-parameters
可以用来检查配置一致性是否正确

vpc-con-par

同样在N9K-2 上查看vpc brief和vpc consistency-parameters: n9k-2-vpcbrief

n9k-2-vpc-con-vpc

查看下挂的SW交换机port-channel 状态是否为“SU”

show etherchan sum

sw

9.最后

EVE可以成功模拟出vPC的效果,同时不会有报错,但是我尝试的过程中发现如果和下挂的SW交换机各使用1条链路进行捆绑的时,会一直起不来。并且如果不是使用直连的mgmt口作为peer-keepalive的话,peer检测也会起不来。