You are on page 1of 150

1.

Nexus产品介绍
2.Nexus 基本系统管理
3.Nexus 7K 配置VDC
4.Nexus L2 L3配置介绍
5. FEX技术介绍与配置

Yeslab数据中心课程
6. Port Channel与vPC
7.FabricPatch

Nexus 交换机系列 8.OTV


9.组播与QoS
作者:马海波 10.Nexus安全技术
现任明教教主

北京Yeslab数据中心实验室出品
现任明教教主
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

内容简介

内容简介
第一部分:Port Channel介绍
第二部分:vPC理论
第三部分:配置N7K vPC
第四部分:配置N7K N5K vPC
第五部分:配置EvPC
第六部分:vPC最佳实践
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

第一部分
Port Channel介绍
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

Port Channel简介
• Bundle multiple physical links into a single logical
link between two physical devices
(绑定多个物理链路到一个单一的逻辑链路,在两个物理设备之间。)
• Each physical port can be in only one port
channel.
(每一个物理端口只能被放入一个port-channel中)
• All the ports in a port channel must be compatible,
and must have same speed/duplex setting
(在一个port-channel中的所有的端口必须兼容,并且需要有相同的速
率和双工模式)
• Layer 2 and Layer 3 Port Channels (2层和3层的port channel)
• Cannot combine Layer 2 and Layer 3 interfaces in
the same port channel.
(不能把2层和3层的接口放入相同的port channel)
• Port Channel can be: (Port Channel分为如下两种类型)
‒Access port - Routed interface
‒Trunk port - Routed with sub interfaces
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

Port Channel模式
• To use static port channels with no aggregation protocol, use
channel mode on.
(如果希望创建没有聚合协议的静态的port channels,配置
channel 模式为“on”)
• To use LACP as aggregation protocol, enable LACP globally.
(如果希望使用LACP作为聚合协议,需要全局激活LACP)
• Enable LACP for each channel by setting the channel mode
for each interface to active or passive.
(为每一个Channel启用LACP,通过为每一个接口设置channel
模式为“active”或者“passive”)
• Port Aggregation Protocol (PAgP) is NOT supported.
(不支持PAgP协议)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

Hash Options(散列选项)
• Header hashing is used to distribute the traffic over the links for load
blancing. (头部散列为了负载均衡,分布流量穿越多条链路)
• Following methods can be used for hashing:
(如下的方式可以被用来做散列)
• source-destination-ip Source & Destination IP address (Default)
• source-ip Source IP address
• destination-ip Destination IP address
• source-destination-port Source & Destination TCP/UDP port
• source-port Source TCP/UDP port
• destination-port Destination TCP/UDP port
• source-destination-mac Source & Destination MAC address
• source-mac Source MAC address
• destination-mac Destination MAC address
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

Port Channel 配置简介


Switchport Access Switchport Trunk
interface ethernet 1/4 interface ethernet 1/4
channel-group 1 mode active channel-group 1 mode active
interface ethernet 2/4 interface ethernet 2/4
channel-group 1 mode active channel-group 1 mode active
interface port-channel 1 interface port-channel 1
switchport switchport
switchport access vlan 200 switchport mode trunk
switchport trunk allowed vlan 10-20

Routed Interface Routed Subinterfaces


interface ethernet 1/4 interface ethernet 1/4
no switchport no switchport
channel-group 1 mode active channel-group 1 mode active
interface ethernet 2/4 interface ethernet 2/4
no switchport no switchport
channel-group 1 mode active channel-group 1 mode active
interface port-channel 1 interface port-channel 1.10
ip address 10.0.0.1/24 ip address 10.0.10.1/24
encapsulation dot1q 10
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验一:Switchport Access
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验一(1)启用Feature

N7K-3(config)# feature interface-vlan


N7K-3(config)# feature lacp

N7k-4(config)# feature interface-vlan


N7k-4(config)# feature lacp
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验一(2)配置VLAN

N7K-3(config)# vlan 10 N7k-4(config)# vlan 10


N7K-3(config-vlan)# no shutdown N7k-4(config-vlan)# no shutdown
N7K-3(config-vlan)# exit N7k-4(config-vlan)# exit
N7K-3(config)# interface vlan 10 N7k-4(config)# interface vlan 10
N7K-3(config-if)# ip address 10.1.1.1/24 N7k-4(config-if)# ip address 10.1.1.2/24
N7K-3(config-if)# no shutdown N7k-4(config-if)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验一(3)配置Port-Channel

N7K-3(config)# inter ethernet 3/19-20


N7K-3(config-if-range)# no shutdown
N7K-3(config-if-range)# switchport mode access
N7K-3(config-if-range)# switchport access vlan 10
N7K-3(config-if-range)# channel-group 1 mode active

N7k-4(config)# inter e3/25-26


N7k-4(config-if-range)# no shutdown
N7k-4(config-if-range)# switchport mode access
N7k-4(config-if-range)# switchport access vlan 10
N7k-4(config-if-range)# channel-group 1 mode active
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验一(4)查看Port-Channel状态
N7k-4# show port-channel summary
Flags: D - Down P - Up in port-channel (members)
I - Individual H - Hot-standby (LACP only)
s - Suspended r - Module-removed
S - Switched R - Routed
U - Up (port-channel)
M - Not in use. Min-links not met
--------------------------------------------------------------------------------
Group Port- Type Protocol Member Ports
Channel
--------------------------------------------------------------------------------
1 Po1(SU) Eth LACP Eth3/25(P) Eth3/26(P)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验二 :Switchport Trunk


马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验二(1)启用Feature

N7K-3(config)# feature interface-vlan


N7K-3(config)# feature lacp

N7k-4(config)# feature interface-vlan


N7k-4(config)# feature lacp
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验二(2)配置VLAN

N7K-3(config)# vlan 10 N7k-4(config)# vlan 10


N7K-3(config-vlan)# no shutdown N7k-4(config-vlan)# no shutdown
N7K-3(config-vlan)# exit N7k-4(config-vlan)# exit
N7K-3(config)# interface vlan 10 N7k-4(config)# interface vlan 10
N7K-3(config-if)# ip address 10.1.1.1/24 N7k-4(config-if)# ip address 10.1.1.2/24
N7K-3(config-if)# no shutdown N7k-4(config-if)# no shutdown

N7K-3(config)# vlan 20 N7k-4(config)# vlan 20


N7K-3(config-vlan)# no shutdown N7k-4(config-vlan)# no shutdown
N7K-3(config-vlan)# exit N7k-4(config-vlan)# exit
N7K-3(config)# interface vlan 20 N7k-4(config)# inter vlan 20
N7K-3(config-if)# ip address 20.1.1.1/24 N7k-4(config-if)# ip address 20.1.1.2/24
N7K-3(config-if)# no shutdown N7k-4(config-if)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验二(3)配置Port-Channel
N7K-3(config)# default interface e3/19-20
N7K-3(config)# no interface port-channel 1

N7K-3(config)# interface e3/19-20


N7K-3(config-if-range)# no shutdown
N7K-3(config-if-range)# switchport mode trunk
N7K-3(config-if-range)# channel-group 1 mode active

N7k-4(config)# default interface ethernet 3/25 – 26


N7K-4(config)# no interface port-channel 1

N7k-4(config)# interface e3/25-26


N7k-4(config-if-range)# no shutdown
N7k-4(config-if-range)# switchport mode trunk
N7k-4(config-if-range)# channel-group 1 mode active
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验二(4)查看Port-Channel状态
N7k-4# show port-channel summary
Flags: D - Down P - Up in port-channel (members)
I - Individual H - Hot-standby (LACP only)
s - Suspended r - Module-removed
S - Switched R - Routed
U - Up (port-channel)
M - Not in use. Min-links not met
--------------------------------------------------------------------------------
Group Port- Type Protocol Member Ports
Channel
--------------------------------------------------------------------------------
1 Po1(SU) Eth LACP Eth3/25(P) Eth3/26(P)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验三 :Routed Interface


马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验三(1)启用Feature

N7K-3(config)# feature lacp

N7k-4(config)# feature lacp


马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验三(2)配置Port-Channel
N7K-3(config)# interface e4/18-19
N7K-3(config-if-range)# no shutdown
N7K-3(config-if-range)# no switchport
N7K-3(config-if-range)# channel-group 1 mode active
N7K-3(config-if-range)# exit
N7K-3(config)# interface port-channel 1
N7K-3(config-if)# ip address 30.1.1.1/24

N7k-4(config)# interface e4/26-27


N7k-4(config-if-range)# no shutdown
N7k-4(config-if-range)# no switchport
N7k-4(config-if-range)# channel-group 1 mode active
N7k-4(config-if-range)# exit
N7k-4(config)# interface port-channel 1
N7k-4(config-if)# ip address 30.1.1.2/24
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验三(3)查看Port-Channel状态
N7k-4# show port-channel summary
Flags: D - Down P - Up in port-channel (members)
I - Individual H - Hot-standby (LACP only)
s - Suspended r - Module-removed
S - Switched R - Routed
U - Up (port-channel)
M - Not in use. Min-links not met
--------------------------------------------------------------------------------
Group Port- Type Protocol Member Ports
Channel
--------------------------------------------------------------------------------
1 Po1(RU) Eth LACP Eth4/26(P) Eth4/27(P)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验四 :Routed subinterfaces


马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验四(1)启用Feature

N7K-3(config)# feature lacp

N7k-4(config)# feature lacp


马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验四(2)配置Port-Channel
N7K-3(config)# default interface e4/18-19
N7K-3(config)# no inter port-channel 1

N7K-3(config)# interface e4/18-19


N7K-3(config-if-range)# no shutdown
N7K-3(config-if-range)# no switchport
N7K-3(config-if-range)# channel-group 1 mode active
N7K-3(config-if-range)# exit
N7K-3(config)# interface port-channel 1.30
N7K-3(config-subif)# encapsulation dot1Q 30
N7K-3(config-subif)# ip address 30.1.1.1/24
N7K-3(config-subif)# no shutdown
N7K-3(config-subif)# exit
N7K-3(config)# interface port-channel 1.40
N7K-3(config-subif)# encapsulation dot1Q 40
N7K-3(config-subif)# ip address 40.1.1.1/24
N7K-3(config-subif)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验四(3)配置Port-Channel
N7k-4(config)# default interface e4/26-27
N7k-4(config)# no interface port-channel 1

N7k-4(config)# interface e4/26-27


N7k-4(config-if-range)# no shutdown
N7k-4(config-if-range)# no switchport
N7k-4(config-if-range)# channel-group 1 mode active
N7k-4(config-if-range)# exit
N7k-4(config)# interface port-channel 1.30
N7k-4(config-subif)# encapsulation dot1Q 30
N7k-4(config-subif)# ip address 30.1.1.2/24
N7k-4(config-subif)# no shutdown
N7k-4(config-subif)# exit
N7k-4(config)# interface port-channel 1.40
N7k-4(config-subif)# encapsulation dot1Q 40
N7k-4(config-subif)# ip address 40.1.1.2/24
N7k-4(config-subif)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第一部分:Port Channel介绍

实验四(4)查看Port-Channel状态
N7k-4# show port-channel summary
Flags: D - Down P - Up in port-channel (members)
I - Individual H - Hot-standby (LACP only)
s - Suspended r - Module-removed
S - Switched R - Routed
U - Up (port-channel)
M - Not in use. Min-links not met
--------------------------------------------------------------------------------
Group Port- Type Protocol Member Ports
Channel
--------------------------------------------------------------------------------
1 Po1(RU) Eth LACP Eth4/26(P) Eth4/27(P)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

第二部分
vPC理论
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

vPCs 简介
• Allows a single device to use a port channel across two
upstream devices Logical Topology with vPC
(允许一个设备使用有两个上游设备的port channel)
• Eliminates Spanning Tree Protocol (STP) blocked ports
(消除STP阻止端口)
• Provides a loop-free topology(提供一个无环的拓扑)
• Uses all available uplink bandwidth
(使用所有可用的上联带宽)
• Provides fast convergence if either the link or a device
fails(在链路或者设备出现故障时,提供最快的收敛)
• Provides link-level resiliency(提供链路级的冗余)
• Assures high availability(确保高可用性)
• The third device can be a server, switch, or any other
networking device (need to surpport channel group)
(第三方设备可以是一个服务器,一个交换机或者任何网络
设备,只要这些设备支持channel Group技术)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

STP vs vPC
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

可以在现有的架构上使用vPC创建无环的网络
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

最多32路Port-Channel(Double-Sided vPC)
• 多层vPC能够加入一个有8个active成
员端口的port-channel到一个16路的
port-channel中。
• vPC对等体的负载均衡方式是由这个
对等体设备本地判断的。
• 在M系列模块中,每一个vPC对等体只
有8个active链路,两个vPC对等体加
在一起一共提供16路active的负载均衡
的链路。
• F系列模块,支持16路active的port-
channel,因此提供一个32路的vPC。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

原则与最佳实践
• You must enable vPCs before you can configure them.
(在配置vPC之前需要先激活vPC特性)
• You must configure the peer-keepalive link then peer-link in order to set up the
vPC domain.
(先配置Peer-keepalive链路,然后配置Peer-link链路,最后设置vPC domain)
• Only Layer 2 port channels can be in vPCs. (vPCs只支持二层port channel)
• You must configure both vPC peer devices; the configuration is not sent from
one device to the other.
(必须手动配置两个vPC设备,配置不会从一个设备发送到另外一个设备上)
• Check that the necessary configuration parameters are consistent on both
sides of the vPC peer link.
(检查在vPC Peer链路的两端,需要配置的参数是一致的)
• You may experience minimal traffic disruption while configuring vPCs.
(当配置vPCs时,可能会经历短暂的流量中断)
• It is recommended to configure all the port channels in the vPC using LACP
with the interfaces in active mode.(推荐所有vPC的port channel使用LACP)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

vPC 架构的组件(1)
• vPC Peers: A pair of vPC-enabled switches(一对
vPC激活的交换机)

• vPC Domain: A pair of vPC peers and associated


vPC components
(一对vPC对等体,和相关的vPC组件)

• vPC Peer Keepalive Link: Routed link carrying


heartbeat packets for active-active detection
(路由链路,承载心跳数据包,进行双Active的检测)

• vPC Peer Link: Carries control traffic between vPC


peer devices
(在两个vPC对等体设备间,承载控制层面流量)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

vPC 架构的组件(2)

• vPC: Combined port channel between


the vPC peers and a port channel-
capable downstream device
(在vPC对等体和有port-channel能力的下
游设备之间的port channel)

• vPC Member Port: One of a set of ports


that form a vPC
(形成vPC的一系列端口中的一个)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

vPC 架构的组件(3)
• Orphan Device: A device that is connected to a
vPC peer using a non-vPC link
(一个设备使用非vPC链路连接到一个vPC对等体)

• Orphan Port: Port on a vPC peer that connects to


an orphan device(一个vPC对等体连接一个
Orphan设备的端口)

• Cisco Fabric Services: A protocol used for state


synchronization and configuration validation
between vPC peer devices
(在vPC对等体设备间,用于状态同步和配置确认的
协议,)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

vPC - F1 and M1 I/O Modules


• In mixed chassis, either M1/M1-XL or Fl ports can function as vPC peer link
ports
(M1/M1-XL或者F1端口都可以作为vPC Peer Link端口)
— Must use ports from the same module type on each
side of the vPC peer link (all M1 or all Fl ports on each
side of the vPC peer link)(在vPC Peer Link两端必须使用相同模块类型
的端口。要么都是M1端口,要么都是F1端口。)
• If Fl ports form vPC peer link, vPCs with Ml/M1-XL ports are allowed only if the
vPC peer link runs in CE (Classical Ethernet) mode.
(只有当vPC Peer Link运行在CE模式时,M1/M1-XL端口才能被允许用于vPC)
• If vPC peer link runs in FabricPath mode (to support vPC+ for FabricPath), all
vPC ports must also be on Fl modules.
(如果vPC Peer Link运行在FabricPath模式(为了FabricPath支持vPC+),所
有的vPC端口必须使用F1模块)
• Mixing Ml/M1-XL and Fl interfaces in a single port channel is not allowed due
to different capabilities.(在一个port channel中混合使用M1/M1-XL和F1接口
是不允许的,因为他们有不能的性能)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

vPC与N7K模块设计图
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

支持vPC的N7K模块
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

支持vPC的N5K
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

支持vPC的N2K
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

M1和F1设计(1)
• M卡提供了可扩展的L2和L3功能。
• F1卡提供了高密度的2层10Gb连接。
• 混合配置的M和F1模块在一个汇聚交
换机,提供了一系列的好处。
桥接流量保留在F1模块
M模块为来至于F模块的路由流量
提供内部的代理路由。
• 配置F1模块的N7K只能提供模块化的
访问交换机的作用(如果不需要三层
功能,就不需要配备M系列模块)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

M1和F1设计(2)
• 混合配置的机箱,至少应该配置一个M卡。
• M1卡提供所有的本地路由能力,包括vlan
间路由和去往三层网络的路由。
• 当其中一个N7K中的M1卡失效
 VLAN间流量(vPC---FHRP---vPC)
,由于vPC环路避免功能,这种流量将
会被丢弃。
 上行流量(vPC---FHRP---L3)将会通
过vPC Peer Link桥接到另外一段的
N7K FHRP的虚拟MAC地址,并且被
路由到三层网络。
• 所以在混合配置的机箱中,推荐配备两个M
卡,来为三层路由提供冗余。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

vPC 控制层面操作
• Cisco Fabric Services is used to synchronize vPC control plane information:
(CFS用于同步vPC的控制层面信息)
— MAC address learning(MAC地址学习)
— IGMP snooping
— Configuration consistency checking(配置一致性检查)
— vPC member port status(vPC成员端口状态)
— ARP cache(ARP缓存)
• One switch is elected primary, the other secondary
(一个交换机被选举成为Primary,另外一端被选举为Secondary)
— Role determines behavior during peer link failure
(角色决定当Peer Link失效时的行为)
— Primary switch is leading for STP on vPCs
(Primary交换机主导在vPC中的STP)
— Non-preemptive election(不支持抢占选举)
• For LACP and STP vPC peers present themselves as a single switch to neighbor
devices connected on a vPC
(vPC对等体对于连接到vPC的邻居设备而言,表现为一个单一交换机)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

vPC数据层面操作
• The vPC peer link carries the following traffic only:
(vPC Peer Link只承载如下流量)
— vPC control traffic(vPC控制层流量)
— Flooded traffic (broadcast, multicast, unknown
unicast)(泛洪流量)
— Traffic for orphan ports(Orphan端口的流量)

• Regular switch MAC address learning is • Frames that enter a vPC peer
replaced with Cisco Fabric Services-based switch from the peer link cannot exit
MAC address learning for vPCs the switch on a vPC member port
— Non-vPC ports use regular MAC (从Peer Link进入vPC对等体的帧不
address learning 会通过vPC成员端口转发)
(普通交换机的MAC地址学习被替换为为vPC
设计的基于CFS的MAC地址学习)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

数据层防环

来至于Peer-Link的流量将 如果一端的vPC出现故障,
会被标记,并且不允许从 Peer-Link可以作为备用链
vPC成员端口发出 路来实现冗余
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

vPC Peer Link Device Failure


1. The switch A vPC peer link fails.
(交换机A的vPC Peer Link失效)
2. The software checks the status of the
remote vPC peer B using the
peer-keepalive link.
(通过Peer-Keepalive链路检查远端vPC Peer B的状态)
3. If the vPC peer B is up, the secondary
vPC B disables all vPC ports on its
device to prevent loops and blackholing
or flooding traffic.
(如果vPC Peer B是Up的,Secondary vPC B将会禁用所
有的vPC端口,阻止环路,黑洞和泛洪流量)
4. The data then forwards down the
remaining active links of the port
channel.
(数据依然在port channel中剩余的Active链路上被发送)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第二部分:vPC理论

vPC Peer Failure — Peer-keepalive Link


• The software learns of a vPC peer device failure
when the keepalive messages are not returned over
the peer-keepalive link.
(软件的学习一个vPC对等体设备的故障,当
Keepalive信息没有通过Peer-Keepalive链路返回)

• You use a separate link (vPC peerkeepalive link) to


send configurable keepalive messages between the
vPC peer devices. The keepalive messages on the
vPC peer keepalive link determine whether a failure
is on the vPC peer link only or on the vPC peer
device. The keepalive messages are used only
when all the links in the peer link fail.
(当所有的Peer Link失效时,Keepalive信息用于确认
对等体的状态,用来确认是peer link故障,还是peer
设备故障。)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

第三部分
配置 N7K vPC
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

配置vPCs

vPC configuration steps:


• Configuring the vPC domain
• Establishing the vPC peer
keepalive link
• Configuring the vPC peer link
• Configuring the vPCs
• Make Sure Configurations are
Consistent
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:N7K的vPC(拓扑介绍)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:配置vPC Domain

N7K-3(config)# feature vpc


N7K-3(config)# vpc domain 7
N7K-3(config-vpc-domain)# role priority 666

N7K-4(config)# feature vpc


N7K-4(config)# vpc domain 7
N7K-4(config-vpc-domain)# role priority 888
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:配置vPC Peer Keepalive Link(N7K-3)


N7K-3(config)# vrf context P-K-L
N7K-3(config)# feature lacp
N7K-3(config)# interface e4/18-19
N7K-3(config-if-range)# channel-group 10 mode active

N7K-3(config)# interface port-channel 10


N7K-3(config-if)# vrf member P-K-L
N7K-3(config-if)# ip address 192.168.1.1/24

N7K-3(config)# interface e4/18-19


N7K-3(config-if-range)# no shutdown

N7K-3(config)# vpc domain 7


N7K-3(config-vpc-domain)# peer-keepalive destination 192.168.1.2 source
192.168.1.1 vrf P-K-L
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:配置vPC Peer Keepalive Link(N7K-4)


N7K-4(config)# vrf context P-K-L
N7K-4(config)# feature lacp
N7K-4(config)# interface e4/26-27
N7K-4(config-if-range)# channel-group 10 mode active

N7K-4(config)# interface port-channel 10


N7K-4(config-if)# vrf member P-K-L
N7K-4(config-if)# ip address 192.168.1.2/24

N7K-4(config)# interface e4/26-27


N7K-4(config-if-range)# no shutdown

N7K-4(config)# vpc domain 7


N7K-4(config-vpc-domain)# peer-keepalive destination 192.168.1.1 source
192.168.1.2 vrf P-K-L
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:查看vPC Peer Keepalive Link状态


马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:配置vPC Peer Link(N7K-3)


N7K-3(config)# vlan 10

N7K-3(config)# interface e3/19-20


N7K-3(config-if-range)# switchport mode trunk
N7K-3(config-if-range)# spanning-tree port type network
N7K-3(config-if-range)# channel-group 20 mode active

N7K-3(config)# interface port-channel 20


N7K-3(config-if)# vpc peer-link

N7K-3(config)# interface e3/19-20


N7K-3(config-if-range)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:配置vPC Peer Link(N7K-4)


N7K-4(config)# vlan 10

N7K-4(config)# interface e3/25-26


N7K-4(config-if-range)# switchport mode trunk
N7K-4(config-if-range)# spanning-tree port type network
N7K-4(config-if-range)# channel-group 20 mode active

N7K-4(config)# interface port-channel 20


N7K-4(config-if)# vpc peer-link

N7K-4(config)# interface e3/25-26


N7K-4(config-if-range)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:查看vPC Peer Link状态


马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:配置Port-Channel(N5K)
NX5k-2(config)# feature lacp
NX5k-2(config)# vlan 10
NX5k-2(config-vlan)# no shutdown
NX5k-2(config)# interface e1/23,e1/29
NX5k-2(config-if-range)# shutdown
NX5k-2(config-if-range)# switchport mode trunk
NX5k-2(config-if-range)# channel-group 30 mode active

NX5k-2(config)# interface e1/5


NX5k-2(config-if)# switchport mode access
NX5k-2(config-if)# switchport access vlan 10
NX5k-2(config-if)# spanning-tree port type edge
NX5k-2(config-if)# speed 1000
NX5k-2(config-if)# shutdown
NX5k-2(config-if)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:配置vPC(N7K)
N7K-3(config)# interface e3/23
N7K-3(config-if)# switchport mode trunk
N7K-3(config-if)# channel-group 30 mode active

N7K-3(config)# interface port-channel 30


N7K-3(config-if)# vpc 30

N7K-4(config)# interface e3/29


N7K-4(config-if)# switchport mode trunk
N7K-4(config-if)# channel-group 30 mode active

N7K-4(config)# interface port-channel 30


N7K-4(config-if)# vpc 30
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:no shutdown接口
N7K-3(config)# interface e3/23
N7K-3(config-if)# no shutdown

N7K-4(config)# interface e3/29


N7K-4(config-if)# no shutdown

NX5k-2(config)# interface e1/23,e1/29


NX5k-2(config-if-range)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:查看vPC状态(N7K)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:查看port-channel状态(N5K)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:一致性检查(全局)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:一致性检查(接口)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:配置IP,测试vPC
R2(config)#interface fa0/0
R2(config-if)#ip address 202.100.1.1 255.255.255.0
R2(config-if)#no shutdown

N7K-3(config)# feature interface-vlan


N7K-3(config)# interface vlan 10
N7K-3(config-if)# ip address 202.100.1.100/24
N7K-3(config-if)# no shutdown

N7K-4(config)# feature interface-vlan


N7K-4(config)# interface vlan 10
N7K-4(config-if)# ip address 202.100.1.101/24
N7K-4(config-if)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

vPC与FHRP( First Hop Redundancy Protocol)


• Traffic Destination for a vPC is forwarded on a
local vPC member port whenever possible
(去往vPC的流量,如果可能将会被本地的vPC
成员接口所转发)
• FHRP behavior is modified
(FHRP的行为被修改,所有的FHRP路由器都会
主动转发从vPC收到的流量)
- All FHRP routers actively forward traffic
received from a vPC
• Result: Traffic avoids peer link if possible,
which creates a scalable solution
(结果:流量如果可能避免使用Peer Link,这样
创建了一个可扩展的解决方案,Peer Link的容量
不需要随着vPC数量的增长而增长)
- Peer link capacity does not need to scale
linearly with the number of vPCs
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:配置HSRP
N7K-3(config)# feature hsrp
N7K-3(config)# interface vlan 10
N7K-3(config-if)# hsrp 1
N7K-3(config-if-hsrp)# preempt
N7K-3(config-if-hsrp)# priority 101
N7K-3(config-if-hsrp)# ip 202.100.1.200

N7K-4(config)# feature hsrp


N7K-4(config)# interface vlan 10
N7K-4(config-if)# hsrp 1
N7K-4(config-if-hsrp)# preempt
N7K-4(config-if-hsrp)# ip 202.100.1.200
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:查看HSRP状态(N7K-3)
N7K-3# show hsrp
Vlan10 - Group 1 (HSRP-V1) (IPv4)
Local state is Active, priority 101 (Cfged 101), may preempt
Forwarding threshold(for vPC), lower: 1 upper: 101
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 1.388000 sec(s)
Virtual IP address is 202.100.1.200 (Cfged)
Active router is local
Standby router is 202.100.1.101 , priority 100 expires in 7.956000 sec(s)
Authentication text "cisco"
Virtual mac address is 0000.0c07.ac01 (Default MAC)
2 state changes, last state change 00:01:01
IP redundancy name is hsrp-Vlan10-1 (default)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:查看HSRP状态(N7K-4)
N7K-4# show hsrp
Vlan10 - Group 1 (HSRP-V1) (IPv4)
Local state is Standby, priority 100 (Cfged 100), may preempt
Forwarding threshold(for vPC), lower: 1 upper: 100
Hellotime 3 sec, holdtime 10 sec
Next hello sent in 0.726000 sec(s)
Virtual IP address is 202.100.1.200 (Cfged)
Active router is 202.100.1.100, priority 101 expires in 8.996000 sec(s)
Standby router is local
Authentication text "cisco"
Virtual mac address is 0000.0c07.ac01 (Default MAC)
1 state changes, last state change 00:02:26
IP redundancy name is hsrp-Vlan10-1 (default)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:配置OSPF(N7K-1)
N7K-1(config)# feature ospf N7K-1(config)# interface e4/1
N7K-1(config)# router ospf 1 N7K-1(config-if)# no shutdown
N7K-1(config-router)# router-id 1.1.1.1 N7K-1(config-if)# no switchport
N7K-1(config-router)# exit N7K-1(config-if)# ip address 202.100.14.1/24
N7K-1(config-if)# ip router ospf 1 area 0
N7K-1(config)# interface e4/5 N7K-1(config-if)# exit
N7K-1(config-if)# no shutdown
N7K-1(config-if)# no switchport N7K-1(config)# interface loopback 0
N7K-1(config-if)# ip address 202.100.13.1/24 N7K-1(config-if)# ip address 61.128.1.1/24
N7K-1(config-if)# ip router ospf 1 area 0 N7K-1(config-if)# ip ospf network point-to-point
N7K-1(config-if)# ip router ospf 1 area 0

N7K-1(config)# interface loopback1


N7K-1(config-if)# ip address 128.6.7.6/24
N7K-1(config-if)# ip ospf network point-to-point
N7K-1(config-if)# ip router ospf 1 area 0
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:配置OSPF(N7K-3/N7K-4)
N7K-3(config)# feature ospf N7K-4(config)# feature ospf
N7K-3(config)# router ospf 1 N7K-4(config)# router ospf 1
N7K-3(config-router)# router-id 3.3.3.3 N7K-4(config-router)# router-id 4.4.4.4
t
N7K-3(config)# interface e4/20 N7K-4(config)# interface e4/29
N7K-3(config-if)# no shutdown N7K-4(config-if)# no shutdown
N7K-3(config-if)# ip address 202.100.13.3/24 N7K-4(config-if)# ip address 202.100.14.4/24
N7K-3(config-if)# ip router ospf 1 area 0 N7K-4(config-if)# ip router ospf 1 area 0

N7K-3(config-if)# interface e4/22 N7k-4(config-if)# interface e4/28


N7K-3(config-if)# no shutdown N7k-4(config-if)# no shutdown
N7K-3(config-if)# ip address 202.100.34.3/24 N7k-4(config-if)# ip address 202.100.34.4/24
N7K-3(config-if)# ip router ospf 1 area 0 N7k-4(config-if)# ip router ospf 1 area 0

N7K-3(config)# interface vlan 10 N7K-4(config)# interface vlan 10


N7K-3(config-if)# ip router ospf 1 area 0 N7K-4(config-if)# ip router ospf 1 area 0
N7K-3(config-if)# ip ospf passive-interface N7k-4(config-if)# ip ospf passive-interface
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:R2测试FHRP(1)
NX5k-2(config)# port-channel load-balance ethernet destination-ip

R2(config)#ip route 0.0.0.0 0.0.0.0 202.100.1.200

R2#ping 61.128.1.1 repeat 10000000 timeout 0


N7K-3在实际转发数据
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

实验五:R2测试FHRP(2)
R2#ping 128.6.7.6 repeat 999999 timeout 0
N7K-4在实际转发数据
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

Spanning Tree推荐
• Configure aggregation vPC peers as root and secondary root
(配置聚合的vPC对等体为Primary STP root和Secondary STP root)
— If the vPC peer-switch is
implemented, both vPC peers
will behave as a single STP root
(如果使用vPC peer-switch技术,两个vPC对等体会扮演为一个STP
root)
• Align STP primary root, HSRP active router, and PIM DR with vPC
primary peer
(应该通过调整让vPC Primary成为STP的Primary root,HSRP的
Active Router和PIM的DR)
• BA is enabled by default on vPC peer link
(桥接确保技术默认在vPC Peer Link上被激活)
• Do not enable Loop Guard and BA on vPC (disabled by default)
(不要在vPC上激活Loop Guard和BA)
• Enable STP port type “edge” and port type “edge trunk” on host
ports(在接主机vPC端口上激活STP端口类型“edge”或者“edge
trunk”
• Enable STP BPDU-guard globally
(全局激活 BPDU-Guard)
• Disable STP channel-misconfig guard if supported by access
switches(如果接入交换机支持,应该禁用STP channel-misconfig
技术)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

调整Spanning Tree配置
vPC的Primary调整STP优先级,成为STP的Primary ROOT
spanning-tree vlan 10 root primary
(应该考虑调整所有参与vPC的VLAN)

vPC的Secondary调整STP优先级,成为STP的Secondary ROOT
spanning-tree vlan 10 root secondary
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

vPC Peer Switch特性介绍


• A pair of Cisco Nexus 7000 Series devices
appears as a single STP root in the Layer 2
topology
(一对N7K设备在二层拓扑中呈现为一个STP Root)

• STP BPDUs are sent on both


the vPC legs to avoid issues related to
STP BPDU timeout on the downstream
switches, which can cause traffic
disruption(STP BPDU在所有vPC链路中被发送,
避免由于下游设备上的STP BPDU超时,造成的流量
中断)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

配置vPC Peer Switch特性(1)

配置特
性之前
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

配置vPC Peer Switch特性(2)

注意:不能预先调整STP优先级
N7K-3(config)# vpc domain 7
N7K-3(config-vpc-domain)# peer-switch

N7k-4(config)# vpc domain 7


N7k-4(config-vpc-domain)# peer-switch
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

配置vPC Peer Switch特性(3)

配置特
性之后
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

Autorecovery
•If both vPC switches reload (DC outage), by default, all
vPCs are suspended until peer adjacency is reestablished
between vPC devices
(如果两个vPC交换机同时重启,默认在两个vPC设备的比邻
关系建立起来之前,所有的vPC都将被挂起)

•If only one vPC peer becomes operational, the local vPC
member ports will remain suspended
(如果仅仅只有一个vPC设备可以工作,本地的vPC成员端口
,依然处于挂起状态)

• On reload, if the peer link is down and three consecutive


peer-keepalive messages are lost, the secondary device
assumes the primary STP role and the primary LACP role.
The software reinitializes the vPCs, bringing up its local
ports.
(一旦启用Autorecovery技术,重启后如果Peer Link处于
“down ”的状态并且持续默认的超时时间240秒,软件会重新
初始化vPC,并且激活本地端口)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

配置Autorecovery

N7K-3(config)# vpc domain 7


N7K-3(config-vpc-domain)# auto-recovery reload-delay 300

N7k-4(config)# vpc domain 7


N7k-4(config-vpc-domain)# auto-recovery reload-delay 300
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

查看Autorecovery
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

Delay Restore
• After a vPC device reloads and comes back up,
routing protocol needs time to reconverge
(当一个vPC重启并且恢复后,路由协议需要时间
来收敛)

• vPCs may blackhole routed traffic from access


to core until Layer 3 connectivity is reestablished
(在三层连接重新建立之前,vPC将会成为访问层
访问核心层的路由黑洞)

• On system restart, delays bringing up the vPC


interfaces for "n" seconds
(当系统重新启动后,延时“n”秒激活vPC接口)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

配置Relay Restore

N7K-3(config)# vpc domain 7


N7K-3(config-vpc-domain)# delay restore 400

N7k-4(config)# vpc domain 7


N7k-4(config-vpc-domain)# delay restore 400
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

vPC Object Tracking


• Providing flexible behavior under failover
conditions
(提供在故障切换环境下更加灵活的行为)

• Tracking state of links of a vPC peer


device
(跟踪vPC设备链路的状态)

• Peer link and core interfaces can be


tracked as a list of Boolean objects
(Peer Link和连接核心的接口能够使用布尔
算法进行跟踪)

• vPC object tracking suspends vPCs on the


impaired device, so traffic can get diverted
over the remaining vPC peer
(vPC组件跟踪,挂起受影响设备的vPC,这
样流量就能够被转移到剩余的vPC上去)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

vPC Object Tracking (Cont.)

Without object tracking! With object tracking!


马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

配置Object Tracking

track 1 interface Ethernet4/20 line-protocol


track 2 interface Ethernet3/19 line-protocol
track 3 interface Ethernet3/20 line-protocol
track 66 list boolean or
object 1
object 2
object 3

vpc domain 7
track 66
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

ARP Synchronization
• Improve convergence for Layer 3 flows
(提升三层流量的收敛时间)

• Need to enable the feature on both the


vPC devices
(需要在两个vPC设备上同时激活此特性)

• After the peer link comes up perform an


ARP bulk sync over CFSoE to the peer
switch
(当Peer Link恢复时,通过CFSoE执行一
个成块的ARP同步)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第三部分:配置N7K vPC

配置ARP Synchronization

N7K-3(config)# vpc domain 7


N7K-3(config-vpc-domain)# ip arp synchronize

N7k-4(config-if)# vpc domain 7


N7k-4(config-vpc-domain)# ip arp synchronize
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第四部分:配置N7K N5k vPC

第四部分
配置 N7K N5K vPC
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第四部分:配置N7K N5k vPC

实验六:N7K vs N5K vPC(拓扑介绍)


马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第四部分:配置N7K N5k vPC

实验六:修改和配置N7K-3/N7K-4接口
N7K-3(config)# interface e3/21-22
N7K-3(config-if-range)# shutdown
N7K-3(config-if-range)# switchport mode trunk
N7K-3(config-if-range)# channel-group 30 mode active

N7K-3(config)# interface e3/23


N7K-3(config-if)# shutdown

N7K-4(config)# interface e3/30-31


N7K-4(config-if-range)# shutdown
N7K-4(config-if-range)# switchport mode trunk
N7K-4(config-if-range)# channel-group 30 mode active

N7K-4(config)# interface e3/29


N7K-4(config-if)# shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第四部分:配置N7K N5k vPC

实验六:配置N5K-1/N5K-2的Peer Keepalive Link


NX5K-1(config)# feature vpc
NX5K-1(config)# vpc domain 5
NX5K-1(config-vpc-domain)# role priority 111
NX5K-1(config-vpc-domain)# peer-keepalive destination 137.60.3.52 source
137.60.3.51 vrf management

NX5K-2(config)# feature vpc


NX5K-2(config)# vpc domain 5
NX5K-2(config-vpc-domain)# role priority 222
NX5K-2(config-vpc-domain)# peer-keepalive destination 137.60.3.51 source
137.60.3.52 vrf management
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第四部分:配置N7K N5k vPC

实验六:配置N5K-1的Peer Link
NX5K-1(config)# feature lacp
NX5K-1(config)# vlan 10
NX5K-1(config-vlan)# no shutdown
NX5K-1(config-vlan)# interface e1/10-11
NX5K-1(config-if-range)# shutdown
NX5K-1(config-if-range)# switchport mode trunk
NX5K-1(config-if-range)# spanning-tree port type network
NX5K-1(config-if-range)# channel-group 40 mode active

NX5K-1(config)# interface port-channel 40


NX5K-1(config-if)# no shutdown
NX5K-1(config-if)# vpc peer-link

NX5K-1(config-if)# interface e1/10-11


NX5K-1(config-if-range)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第四部分:配置N7K N5k vPC

实验六:配置N5K-2的Peer Link
NX5K-2(config)# feature lacp
NX5K-2(config)# vlan 10
NX5K-2(config-vlan)# no shutdown
NX5K-2(config-vlan)# interface e1/10-11
NX5K-2(config-if-range)# shutdown
NX5K-2(config-if-range)# switchport mode trunk
NX5K-2(config-if-range)# spanning-tree port type network
NX5K-2(config-if-range)# channel-group 40 mode active

NX5K-2(config)# interface port-channel 40


NX5K-2(config-if)# no shutdown
NX5K-2(config-if)# vpc peer-link

NX5K-2(config-if)# interface e1/10-11


NX5K-2(config-if-range)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第四部分:配置N7K N5k vPC

实验六:配置N5K-1/N5K-2的背对背vPC
NX5K-1(config)# interface e1/21,e1/22,e1/31
NX5K-1(config-if-range)# shutdown
NX5K-1(config-if-range)# switchport mode trunk
NX5K-1(config-if-range)# channel-group 30 mode active

NX5K-1(config)# interface port-channel 30


NX5K-1(config-if)# no shutdown
NX5K-1(config-if)# vpc 30

NX5K-2(config)# interface e1/23,e1/29,e1/30


NX5K-2(config-if-range)# shutdown
NX5K-2(config-if-range)# switchport mode trunk
NX5K-2(config-if-range)# channel-group 30 mode active

NX5K-2(config)# interface port-channel 30


NX5K-2(config-if)# no shutdown
NX5K-2(config-if)# vpc 30
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第四部分:配置N7K N5k vPC

实验六:打开N5K与N7K之间的背对背vPC的端口
N7K-3(config)# interface e3/21-23
N7K-3(config-if-range)# no shutdown

N7k-4(config)# interface e3/29-31


N7k-4(config-if-range)# no shutdown

NX5K-1(config)# interface e1/21,e1/22,e1/31


NX5K-1(config-if-range)# no shutdown

NX5k-2(config)# interface e1/23,e1/29,e1/30


NX5k-2(config-if-range)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第四部分:配置N7K N5k vPC

实验六:配置N5K-1连接ASA的vPC
NX5K-1(config)# interface e1/25
NX5K-1(config-if)# shutdown
NX5K-1(config-if)# speed 1000
NX5K-1(config-if)# switchport mode access
NX5K-1(config-if)# switchport acc vlan 10
NX5K-1(config-if)# channel-group 50 mode active

NX5K-1(config)# interface port-channel 50


NX5K-1(config-if)# no shutdown
NX5K-1(config-if)# vpc 50
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第四部分:配置N7K N5k vPC

实验六:配置N5K-2连接ASA的vPC
NX5K-2(config)# interface e1/25
NX5K-2(config-if)# shutdown
NX5K-2(config-if)# speed 1000
NX5K-2(config-if)# switchport mode access
NX5K-2(config-if)# switchport acc vlan 10
NX5K-2(config-if)# channel-group 50 mode active

NX5K-2(config)# interface port-channel 50


NX5K-2(config-if)# no shutdown
NX5K-2(config-if)# vpc 50
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第四部分:配置N7K N5k vPC

实验六:配置ASA的Port Channel
ASA(config-if)# interface e0/0
ASA(config-if)# speed 1000
ASA(config-if)# channel-group 1 mode active

ASA(config-if)# interface e0/1


ASA(config-if)# speed 1000
ASA(config-if)# channel-group 1 mode active

ASA(config)# interface port-channel 1


ASA(config-if)# nameif Outside
ASA(config-if)# ip address 202.100.1.1 255.255.255.0
ASA(config-if)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第四部分:配置N7K N5k vPC

实验六:打开N5K与ASA之间的vPC端口
NX5K-1(config)# interface e1/25
NX5K-1(config-if)# no shutdown

NX5K-2(config)# interface e1/25


NX5K-2(config-if)# no shutdown

ASA(config-if)# interface e0/0


ASA(config-if)# no shutdown

ASA(config-if)# interface e0/1


ASA(config-if)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

第五部分
配置EvPC
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

EvPC拓扑图
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

配置vPC Domain
配置N5K-1的vPC Domain:
N5K-1(config)# feature vpc
N5K-1(config)# vpc domain 5
N5K-1(config-vpc-domain)# role priority 101
N5K-1(config-vpc-domain)# peer-keepalive destination 137.60.3.52 source
137.60.3.51 vrf management
N5K-1(config-vpc-domain)# exit

配置N5K-2的vPC Domain:
N5K-2(config)# feature vpc
N5K-2(config)# vpc domain 5
N5K-2(config-vpc-domain)# role priority 102
N5K-2(config-vpc-domain)# peer-keepalive destination 137.60.3.51 source
137.60.3.52 vrf management
N5K-2(config-vpc-domain)# exit
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

配置N5K-1 Peer-Link
N5K-1(config)# feature lacp
N5K-1(config)# interface e1/10-11
N5K-1(config-if-range)# switchport mode trunk
N5K-1(config-if-range)# channel-group 100 mode active
N5K-1(config-if-range)# no shutdown
N5K-1(config-if-range)# exit
N5K-1(config)# interface port-channel 100
N5K-1(config-if)# vpc peer-link
N5K-1(config-if)# exit
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

配置N5K-2 Peer-Link
N5K-2(config)# feature lacp
N5K-2(config)# interface e1/10-11
N5K-2(config-if-range)# switchport mode trunk
N5K-2(config-if-range)# channel-group 100 mode active
N5K-2(config-if-range)# no shutdown
N5K-2(config-if-range)# exit
N5K-2(config)# interface port-channel 100
N5K-2(config-if)# vpc peer-link
N5K-2(config-if)# exit
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

配置N5K-1 FEX
N5K-1(config)# feature fex
N5K-1(config)# interface e1/1-2
N5K-1(config-if-range)# switchport mode fex-fabric
N5K-1(config-if-range)# channel-group 101
N5K-1(config-if-range)# exit
N5K-1(config)# interface port-channel 101
N5K-1(config-if)# fex associate 101
N5K-1(config-if)# vpc 101
N5K-1(config-if)# exit
N5K-1(config)# interface e1/3-4
N5K-1(config-if-range)# switchport mode fex-fabric
N5K-1(config-if-range)# channel-group 102
N5K-1(config-if-range)# exit
N5K-1(config)# interface port-channel 102
N5K-1(config-if)# fex associate 102
N5K-1(config-if)# vpc 102
N5K-1(config-if)# exit
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

配置N5K-2 FEX
N5K-2(config)# feature fex
N5K-2(config)# interface e1/1-2
N5K-2(config-if-range)# switchport mode fex-fabric
N5K-2(config-if-range)# channel-group 102
N5K-2(config-if-range)# exit
N5K-2(config)# interface port-channel 102
N5K-2(config-if)# fex associate 102
N5K-2(config-if)# vpc 102
N5K-2(config-if)# exit
N5K-2(config)# interface e1/3-4
N5K-2(config-if-range)# switchport mode fex-fabric
N5K-2(config-if-range)# channel-group 101
N5K-2(config-if-range)# exit
N5K-2(config)# interface port-channel 101
N5K-2(config-if)# fex associate 101
N5K-2(config-if)# vpc 101
N5K-2(config-if)# exit
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

查看FEX状态
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

配置N5K-1把R1放入VLAN10
N5K-1(config)# interface e1/5
N5K-1(config-if)# shutdown
N5K-1(config-if)# speed 1000
N5K-1(config-if)# switchport access vlan 10
N5K-1(config-if)# spanning-tree port type edge
N5K-1(config-if)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

配置ASA port-channel
ASA(config)# interface e0/0
ASA(config-if)# channel-group 1 mode active
ASA(config-if)# no shutdown
ASA(config-if)# interface e0/1
ASA(config-if)# channel-group 1 mode active
ASA(config-if)# no shutdown
ASA(config-if)# exit
ASA(config)# interface port-channel 1
ASA(config-if)# nameif Outside
ASA(config-if)# ip address 202.100.1.1 255.255.255.0
ASA(config-if)# no shutdown
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

配置N5K-2的Configure Sync
N5K-2(config)# cfs ipv4 distribute
N5K-2(config)# configure sync
N5K-1(config-sync)# switch-profile MingJiao-Sync
N5K-2(config-sync-sp)# sync-peers destination 137.60.3.51
N5K-2(config-sync-sp)# end
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

配置N5K-1的Configure Sync
N5K-1(config)# cfs ipv4 distribute
N5K-1(config)# configure sync
N5K-1(config-sync)# switch-profile MingJiao-Sync
N5K-1(config-sync-sp)# sync-peers destination 137.60.3.52
N5K-1(config-sync-sp)# vlan 10
N5K-1(config-sync-sp-vlan)# exit
N5K-1(config-sync-sp)# interface e101/1/25,e102/1/25
N5K-1(config-sync-sp-if)# shutdown
N5K-1(config-sync-sp-if)# speed 1000
N5K-1(config-sync-sp-if)# channel-group 1 mode active
N5K-1(config-sync-sp-if)# no shutdown
N5K-1(config-sync-sp-if)# exit
N5K-1(config-sync-sp)# interface port-channel1
N5K-1(config-sync-sp)# switchport access vlan 10
N5K-1(config-sync-sp-if)# verify
Verification Successful
N5K-1(config-sync-sp)# commit
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

查看Switch-Profile(1)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

查看Switch-Profile(2)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:配置EvPC

查看Port-Channel状态
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

第五部分
vPC最佳实践
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

vPC Domain

• vPC Domain定义参与vPC的一组交换机
• 定义了全局vPC系统参数
• vPC对等体设备使用vPC Domain ID自动
指派一个唯一的vPC系统MAC地址
• 在比邻的二层区域的所有vPC对,必须使
用唯一的Domain ID。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

System MAC(1)
• LACP邻居看到两个vPC对等体有相同的System ID
• vPC的“System MAC”被两个vPC对等体使用
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

System MAC(2)
• vPC对等体对于邻居而言呈现为一个独立的设备
• 本地“System-MAC”用于所有的非vPC PDUs(LACP,STP,…)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

vPC Role
• vPC根据Priority(优先级)选举Primary
交换机。
• 低优先级的交换机会胜出,如果优先级
一样,低的system mac会胜出。
• Role(角色)是不能抢占的,因此应该
关注Operational Role(操作角色)。
• 操作角色可能与在Domain(域)下配置
的优先级有所不同。
• vPC的角色决定了具体是那个vPC对等体
来处理BPDUs。
• 角色会影响当Peer Link失效后的行为。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

vPC Peer Link介绍


• 基本特性介绍:
 标准的802.1Q Trunk
 能够承载vPC和非vPC的VLAN
 承载CFS信息(为了保障可靠的通讯,设置标签为CoS=4)
 承载来自于vPC对等体的泛洪流量
 承载 STP BPDUs,HSRP Hellos和IGMP updates等等流量
• 需求:
 vPC Peer Link的成员端口必须是10GE接口
 vPC Peer Link是点对点链路,在vPC对等体之间不能插入
其它设备
• 推荐: 最好分离vPC和非
 为了冗余,至少需要两个分布在不同接口卡上的10GE接口 vPC VLANs在不同
 使用(Dedicated)专用10GE端口(不要使用共享端口) 的交换机之间的Port
Channel上
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

vPC Peer Keepalive Link介绍


• 基本特性介绍:
 在vPC对等体间发送心跳信息
 在Peer-Link失效的情况下,检查vPC是否Active/Active
 信息发送间隔为1秒
 当Peer-Link失效后,有3秒的Hold超时时间,超时时间默认
为5秒
• 包结构:
 UDP/3200,长度为96字节(32字节负载长度),包括版本
,时间戳,本地和远端IP地址,和domain ID。
 Keepalive信息可以通过板载的Wireshark工具进行捕获和显
示。
• 推荐:
 应该是一条专用链路(1Gb就足够了)
 千万不要通过Peer-Link进行转发
 可以使用mgmt0接口(和管理流量走在一起)
 作为最后的方案,可以通过三层架构进行路由
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

vPC Peer Keepalive Link注意事项


• 当使用引擎的管理接口来承载vPC Peer Keepalive信息时,不要在两个交换机之间直
接进行连接。
• 因为同一时间只能有一个管理接口处于active状态,如果引擎出现故障切换,就会阻
断Keep-alive连接。
• 当存在带外网管网络时,才可以考虑管理接口作为Peer Keepalive Link(在vPC对等
体之间存在管理交换机)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

vPC Peer Link故障检测


当vPC Peer-Link故障(连接丢失)
• 通过vPC Peer-Keepalive Link的心跳
信息,检查远端vPC对等体的状态。
• 如果两个对等体都处于“Active”状
态,Secondary(次要)vPC对等体
会禁用所有的vPC来避免双Active的
状况
• 数据依然能够通过剩余的Port
Channel的Active端口来转发数据。
• 当CFS信息故障或者UDLD连接状态
检查失效时,产生故障切换。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

vPC Member Port介绍


• 基本特性介绍:
 vPC对等体的Port-channel成员
• 需求:
 两个vPC对等体的成员端口的配置需要匹配
 不一致的VLAN或者整个Port-Channel将会
被挂起(例如不匹配的MTU)
 两个vPC对等体的成员端口的数量不需要一

 在两个vPC对等体间最多能够有8个active
的成员端口(如果使用多层的vPC最多可以
支持16路的Port-Channel)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

vPC 与 VDC
• vPC与VDC:
 vPC可以工作在VDC环境
 每一个VDC只能够支持一个vPC Domain
 在每一个VDC部署中,依然需要使用分离的Peer-Link和
Peer-Keepalive Link

• vPC是否能够运行在一个交换机内的两个VDC之间?
 在技术上是可以支持的,但是并不被官方支持
 可以作为实验和练习使用,但是强烈不推荐在工作环境使用
,因为这样就人为造成了单点故障。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

唯一的一个原则
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

连接方法一
如果使用vPC技术,总是尝试dual attach设
备(不适用于三层路由链路)
• 优势:
 在vPC Peer-Link出现故障切换和vPC
出现Dual-Active的情况下,确保最小
的网络中断。确保通过vPC实现完全的
冗余和active/active路径。
• 劣势:
 没有
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

连接方法二
如果不能Dual Attach,连接设备到一个
连接vPC的访问交换机(可以使用VDC
创建虚拟访问交换机)
• 优势:
 在vPC Peer-Link出现故障切换和
vPC出现Dual-Active的情况下,确
保最小的网络中断。当访问交换机
出现故障高可用性就失效。
• 劣势:
 需要额外的访问交换机或者使用一
个VDC,增加了管理和配置这个物
理或者虚拟交换机的负担。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

连接方法三
如果不能Dual Attach,直接连接设备到
vPC对等体(Primary)的非vPC VLAN
,并且提供一个在两个vPC对等体间分
离的互联Port-Channel。
• 优势:
 在vPC Peer-Link出现故障时,转
移流量到次要路径上。
• 劣势:
 需要在N7K上,配置和管理额外的
端口(例如:port-channel)。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

连接方法四
如果不能Dual Attach,直接连接设备到
vPC对等体(Primary)的vPC VLAN。
• 优势:
 容易部署。
• 劣势:
 非常差的连接方法,受限于vPC的
角色(在vPC中没有角色抢占的功
能),如果Peer-Link出现故障,
vPC切换到备用vPC角色时,这个
设备将会完全被隔离。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

三层和vPC的相互影响(1)

R可能是任何的路由器,三层 Port-channel看上去就 三层使用ECMP(等价


交换机。 像一条单一的管道,散 多路径)来转发流量
列计算决定选择哪条链
路来转发流量。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

转发过程详细介绍(1)
1. 去往目的地址S的数据包抵达R
2. R查询路由表,看到两个等价路径(去往7K1
和7K2)
3. 假设通过ECMP的选择,最终选择了7k1
4. R现在为了把数据发送到选择的路由器,重写
二层信息(7k1的mac地址或者7k2)
5. L2查询开始,并且判断出接口为Port-
channel1
6. 散列算法决定用哪个Port-channel的成员端口
来转发流量(假设选择了去往7k2的链路)
7. 数据包被发送到了7k2
8. 7k2发现这个包需要通过peer-link发送到7k1
的mac地址
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

转发过程详细介绍(2)
9. 7k1查询应该怎么转发这个数据包到S
10. 7k1执行检查,发现这个数据包来自于Peer
Link并且希望从一个vPC发出
11. 只有在如下情况下这个数据包才会被发送:
a) 出接口不是一个vPC接口
b) 出接口的vPC在远端对等体没有active的
成员端口。
注意:解决此问题可以采用Peer-Gateway技术
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

vPC Peer-Gateway
• 允许一个vPC交换机,为那些去
往对端路由器MAC的数据包扮演
一个active网关。
• 保持使用本地vPC节点,在本地
转发流量。避免使用Peer-Link。
• 不会影响流量和现有架构。
• 允许和一些NAS和负载均衡器的
特性进行互操作。

推荐激活这个特性
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

三层和vPC的设计
• 在一个vPC域内的对等体,使用三层链路挂接到路由器上。
• 不用使用二层port channel来连接路由器和vPC域,除非你
使用静态路由指向HSRP地址。
• 如果路由和桥接流量都需要,为路由流量使用独立的三层
链路,为桥接流量使用二层port-channel。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

三层和vPC支持的设计(1)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

三层和vPC支持的设计(2)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

三层和vPC支持的设计(3)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

三层和vPC支持的设计(4)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

STP和vPC的互操作
• STP的使用:
 在vPC失效的时候防止环路
 非vPC的连接设备
 当添加和删除vPC时,进行环路管理
• 需求:
 需要保持激活状态,但是并不会控制vPC成员端
口的状态
 逻辑的接口也应该激活STP
• 最佳实践:
 确保在二层域中的所有的交换都运行Rapid-
PVST或者MST(默认IOS是non-rapid PVST+),
这样就避免了慢速的STP收敛。
 推荐在面向主机的端口上配置端口快速(port
type edge),这样避免了慢速的STP收敛。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

STP的推荐设计
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

多层vPC和数据中心互联
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

FHRP与vPC(1)

• 在Active/Active模式的vPC
环境,支持所有的FHRP协
议。
• 不需要额外的配置。
• 配置有FHRP的SVI接口为
路由的Passive-interface,
这样避免通过vPC Peer-
Link来建立路由的比邻。
• 推荐使用默认HSRP计时器
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

FHRP与vPC(2)
• 在vPC对等体之间建立点对点的路由协议邻居关系,这样当上行链路出现故
障的时候,可以使用这条三层备用路径来连接到核心网络。
• 使用在vPC对等体之间的三层点对点链路,来建立一个当上行链路失效后的
备用链路。
• 一个点对点VLAN/SVI,也可以用来连接三层邻居关系。
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

Orphan-Port Suspend
• vPC Orphan Port是一个处于vPC
VLAN内的非vPC端口。
• 在混合服务器的拓扑环境,vPC
Orphan Port存在问题。
• 在5.0(3)N2的N5k和5.2的N7K之
前,Orphan Port不会被shutdown,
当vPC Peer-Link丢失的时候。
• 最新的NX-OS支持通过配置实现,
当Peer-Link失效后挂起Orphan
Port,这样就能够实现服务器上的
NIC Teaming的切换。
• 配置只适用于物理接口
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

vPC与FEX的设计(1)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

vPC与FEX的设计(2)
马海波/现任明教教主
Port Channel与vPC Nexus交换机系列

第五部分:vPC最佳实践

vPC与FEX不支持的设计

You might also like