Configure VPC between two Cisco Nexus switches

From Notes_Wiki

Home > Switch configuration notes > Configure VPC between two Cisco Nexus switches

Theory

Most of the time for doing link-aggregation (LACP) or port-aggregtation (PaGP) two switches are stacked together and then one port is used from each switch for redundancy. While this method creates redundancy for data-path it creates a single control-path, which can still be single point of failure. In real-life we have encountered cases where if one of the two stacked switch fails, the working switch reboots before it operates properly. To solve this problem Cisco has introduced VPC concept. In case of VPC two swiches become VPC peers. Both swiches have their own control (Different management IP, different configuration) and data-path. However, it is still possible to configure port-channel (LACP) using two ports one from each VPC peer. Thus, it is ideal to use VPC instead of using legacy stacking in case of Nexus switches.

To configure VPC across two switches:

  • Example-top
  • Example-bottom

use following configuration. The configuration assumes use of first-three ports Ethernet 1/1 - 3 for creating VPC between the two switches. Other ports (4 onwards) can be used for other network connections.

Also note use of vrf. Each vrf has its own IP addressing, routing, etc. Hence the same IPs can be used across different vrf without IP conflict. So use of 10.3.0.9 and 10.3.0.10 on vrf PEER-KEEPALIVE will not conflict with use of same IPs on management or other VRFs.

As an example:

  • Ethernet1/4 of both switches have been configured for LACP
  • HSRP is configured for VLANs 10, 20 and 30. Note in this case X1 IPs would always be with top switch and X2 IPs would be with bottom switch. However, HSRP IP X3 would be with the switch with higher priority. If higher priority switch is down X3 IP would be taken by other switch. Hence, all machines in the network should use corresponding X3 IP as gateway for high availability.


Example configuration

Example-top switch configuration

Configure admin user, hostname, required, features and default gateway using:

username admin password <secret> level 15

hostname Example-top

feature interface-vlan
feature vpc
feature lacp
feature hsrp

ip route 0.0.0.0/0 <default gw>   


Create required vrf contexts and management IP in vrf management using:

vrf context PEER-KEEPALIVE
vrf context management
exit

interface mgmt 0
  vrf member management
  ip address <management-ip>/<netmask>    
  exit

Configure port-channel for vpc-peerlink and vpc 3 for keepalive heartbeats using vrf PEER-KEEPALIVE

port-channel load-balance ethernet source-dest-port

vpc domain 3
  role priority 1
  peer-keepalive destination 10.3.0.10 source 10.3.0.9 vrf PEER-KEEPALIVE

interface port-channel3
  description *** VPC PEERLINK ***
  switchport mode trunk
  spanning-tree port type network
  speed 10000
  vpc peer-link


Configure first two ports for vpc-peerlink and third for keep-alive (Connected to Example-bottom)

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

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

interface Ethernet1/3
  description *** VPC KEEPALIVE LINK ***
  no switchport
  vrf member PEER-KEEPALIVE
  ip address 10.3.0.9/30


Configure required VLANs

vlan 10
  name VLAN-10
  exit
vlan 20
  name VLAN-20
  exit
vlan 30 
  name VLAN-30
  exit


Configure LACP using Ethernet1/4, port-channel 104 and vpc 4

interface port-channel104
  description *** Example LACP link using Ethernet 1/4 on both switches *** 
  switchport mode trunk
  switchport trunk allowed vlan 10,20,30
  vpc 4

interface Ethernet1/4
  switchport mode trunk
  switchport trunk allowed vlan 10,20,30
  channel-group 104 mode active
  no shutdown


Configure HSRP for a few VLANs:

interface Vlan1
  no shutdown

interface Vlan10
  description *** VLAN-10***
  no shutdown
  ip address 10.3.1.X1/24
  hsrp 10
    name VLAN_10
    timers msec 250 msec 750
    ip 10.3.1.X3

interface Vlan20
  description *** VLAN-20 ***
  no shutdown
  ip address 10.3.2.X1/24
  hsrp 20
    name VLAN_20
    timers msec 250 msec 750
    ip 10.3.2.X3

interface Vlan30
  description *** VLAN-30 ***
  no shutdown
  ip address 10.3.3.X1/24
  hsrp 30
    name VLAN_30
    timers msec 250 msec 750
    ip 10.3.3.X3


Example-bottom switch configuration

Configure admin user, hostname, required, features and default gateway similar to top-switch

username admin password <secret> level 15

hostname Example-bottom

feature interface-vlan
feature vpc
feature lacp
feature hsrp

ip route 0.0.0.0/0 <default gw>   


Create required vrf contexts and management IP in vrf management using:

vrf context PEER-KEEPALIVE
vrf context management
exit

interface mgmt 0
  vrf member management
  ip address <management-ip>/<netmask>    
  exit

Configure port-channel for vpc-peerlink and vpc 3 for keepalive heartbeats using vrf PEER-KEEPALIVE

port-channel load-balance ethernet source-dest-port

vpc domain 3
  role priority 1
  peer-keepalive destination 10.3.0.9 source 10.3.0.10 vrf PEER-KEEPALIVE

interface port-channel3
  description *** VPC PEERLINK ***
  switchport mode trunk
  spanning-tree port type network
  speed 10000
  vpc peer-link


Configure first two ports for vpc-peerlink and third for keep-alive (Connected to Example-top)

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

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

interface Ethernet1/3
  description *** VPC KEEPALIVE LINK ***
  no switchport
  vrf member PEER-KEEPALIVE
  ip address 10.3.0.10/30


Configure required VLANs

vlan 10
  name VLAN-10
  exit
vlan 20
  name VLAN-20
  exit
vlan 30 
  name VLAN-30
  exit


Configure LACP using Ethernet1/4, port-channel 104 and vpc 4

interface port-channel104
  description *** Example LACP link using Ethernet 1/4 on both switches *** 
  switchport mode trunk
  switchport trunk allowed vlan 10,20,30
  vpc 4

interface Ethernet1/4
  switchport mode trunk
  switchport trunk allowed vlan 10,20,30
  channel-group 104 mode active
  no shutdown


Configure HSRP for a few VLANs:

interface Vlan1
  no shutdown

interface Vlan10
  description *** VLAN-10***
  no shutdown
  ip address 10.3.1.X2/24
  hsrp 10
    name VLAN_10
    priority 90
    timers msec 250 msec 750
    ip 10.3.1.X3

interface Vlan20
  description *** VLAN-20 ***
  no shutdown
  ip address 10.3.2.X2/24
  hsrp 20
    name VLAN_20
    priority 90
    timers msec 250 msec 750
    ip 10.3.2.X3

interface Vlan30
  description *** VLAN-30 ***
  no shutdown
  ip address 10.3.3.X2/24
  hsrp 30
    name VLAN_30
    priority 90
    timers msec 250 msec 750
    ip 10.3.3.X3



Home > Switch configuration notes > Configure VPC between two Cisco Nexus switches