Cisco NX-OS vPC Configuration: Step-by-Step with Commands - 夜莺博客

Cisco NX-OS vPC Configuration: Step-by-Step with Commands

A virtual port channel (vPC) lets two Cisco Nexus switches present a single port channel to a downstream device, enabling Layer 2 multipathing with full redundancy and doubled bandwidth. This article explains the vPC concepts and walks the official 10-step configuration - peer-keepalive VRF, peer link port-channel, vPC domain and downstream port-channel - with the exact NX-OS commands.

vPC Overview and Terminology

  • vPC domain - the group of two peer switches acting as one.
  • vPC peer link - the port-channel between the two switches carrying control traffic and BPDUs.
  • Peer-keepalive link - a Layer 3 link (usually in a dedicated VRF) exchanging heartbeat messages; required before the peer link forms.
  • vPC member port-channel - the port-channel to the downstream device, configured as vpc <id> on both peers.

Only Layer 2 port channels can be in a vPC, and configuration is manual on both peers - it is never synchronized.

Guidelines and Limitations

  • Port-channel compatibility parameters must match on both peers.
  • Use dedicated ports on different modules for the peer link where possible.
  • Verify hardware support with show hardware feature-capability.

Step-by-Step Configuration

! 1. Convert two interfaces to dedicated mode for the peer link
switch(config)# interface ethernet 7/1
switch(config-if)# rate-mode dedicated
switch(config-if)# no shutdown
switch(config-if)# exit

! 2. Create the peer link port-channel (active LACP)
switch(config)# interface ethernet 7/1-2
switch(config-if)# switchport
switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk allowed vlan 1-50
switch(config-if)# switchport trunk native vlan 20
switch(config-if)# channel-group 20 mode active
switch(config-if)# exit

! 3. Create the VLANs
switch(config)# vlan 1-50
switch(config-vlan)# no shutdown
switch(config-vlan)# exit

! 4. Create a VRF for peer-keepalive and add a Layer 3 interface
switch(config)# vrf context pkal
switch(config-vrf)# exit
switch(config)# interface ethernet 8/1
switch(config-if)# vrf member pkal
switch(config-if)# ip address 172.23.145.218/24
switch(config-if)# no shutdown
switch(config-if)# exit

! 5. Create the vPC domain with peer-keepalive
switch(config)# vpc domain 1
switch(config-vpc-domain)# peer-keepalive destination 172.23.145.217 source 172.23.145.218 vrf pkal
switch(config-vpc-domain)# exit

! 6. Configure the vPC peer link
switch(config)# interface port-channel 20
switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk allowed vlan 1-50
switch(config-if)# vpc peer-link
switch(config-if)# exit

! 7. Configure the downstream port-channel and assign the vPC number
switch(config)# interface ethernet 7/9
switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk allowed vlan 1-50
switch(config-if)# channel-group 50 mode active
switch(config-if)# exit
switch(config)# interface port-channel 50
switch(config-if)# vpc 50
switch(config-if)# exit

! 8. Save the configuration
switch(config)# copy running-config startup-config

Repeat the full configuration on the second Nexus switch with its own IPs (peer-keepalive destination/source swapped) and the same vPC domain and port-channel numbers.

Verification Commands

switch# show vpc
switch# show vpc brief
switch# show vpc consistency-parameters
switch# show port-channel summary

show vpc brief confirms the peer link and member port-channels are up; show vpc consistency-parameters catches configuration mismatches between the peers.

Related articles: Cisco Nexus NX-OS VLAN and trunk configuration, Spine-leaf vs 3-tier migration guide, and Data center ToR switch selection.

原文链接:https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus9000/sw/6-x/interfaces/configuration/guide/b_Cisco_Nexus_9000_Series_NX-OS_Interfaces_Configuration_Guide/configuring_vpcs.html