VPC(Virtual Port-Channel)是Cisco Nexus系列交換機中的一個特性。它支持一個跨機箱的二層Port-Channel。對於第三方設備來說(交換機或服務器)物理上是連接到了兩台交換機,但邏輯上是一台交換機。
VPC的優勢:
1.消除STP阻塞端口;
2.使用所有可用的鏈路帶寬;
3.允許服務器雙主上連;
4.當鏈路或設備失效后提供了快速的收斂;
5.為服務器提供了雙active的網關;
VPC防環方式:
VPC執行一個數據層面的防環來代替控制層面的STP。vPC peer-link被使用在兩台vPC設備之間同步mac地址、vPC成員狀態信息和IGMP。從vPC member port進來的流量,穿越vpc peer-link之后,不會再被允許從任何vPC Member port發出,但可以從其實接口(L3 Port或孤立端口轉發)。vPC基於這樣的機制來進行防環。
VPC術語:
vPC Peer:啟用vPC的交換機被稱為vPC的Peer
vPC domain:兩台啟用vPC的交換機所有的邏輯域,VPC domain包含2個VPC peer設備(2台N7K),一個VPC domain最多有2台peer設備。VPC對等體配置的VPC Domain必須相同
vPC Peer Keepalive Link:Peer Keepalive link是一個三層鏈路,用於在Peer-link失效后檢測vPC Peer是否存活
vPC Peer Link:用於傳輸vPC控制層面的流量 ,包括同步mac地址表、vpc成員信息、IGMP信息。Peer Liink必須是10GE鏈路,一般是2層的portchannel,trunk鏈路,透傳VPC的VLAN
vPC VLAN:在VPC peer link上透傳的VLAN,即在peer link的trunk鏈路上trunk allow的VLAN。VPC VLAN用於與第三方設備通信,比如用於做為下游設備連接的PC的SVI網關
non-vPC VLAN:不屬於VPC,也沒有在peer link上透傳的VLAN
Orphan Device:孤立設備,即此台接入層交換機只上連一台N7K的設備(沒有雙上連到2台N7K)
Orphan Port:孤立端口,沒有加入vpc的端口
Cisco Fabric Services(CFS) protocol:CFS協議,運行在vPC peer link之間,用於提供信息同步和配置一致性檢查(比如vPC端口配置的MTU是否一致等)
vPC Member Port:加入vpc的端口,是一個Port-Channel接口
VPC各鏈路失效狀態:
1、VPC成員端口失效
如果一個vPC member port失效,和普通的Port-channel機制一樣,另一個端口會繼續轉發數據。
2、VPC Peer Link失效
當Peer link失效以后,vpc設備會通過peer keepalive link來檢測Primary交換機是否存活,如果Secondary交換機能夠繼續收到Primary交換機發過來的信息,表示Primary交換機未宕機,則Secondary Peer會shutdown所有vpc member port,Primary交換機繼續轉發流量。
3、VPC Primary Switch 失效
如果Primary交換機失效,Secondary交換機會變成Primary,繼續轉發流量。vPC role不支持搶占,Priority越小越優先。
4、VPC Peer keepalive link和 Peer link同時失效
當Peer keepalive linke和Peer Link同時失效以后,Secondary交換機也會運行在Priamry模式下,兩台交換機都會轉發流量。
5、VPC Peer keepalive失效
只有Peer keepalive link失效並不會影響vpc的工作。
VPC和FHRP
如果兩台交換機是匯聚或核心交換機的話,一定會使用FHRP(First Hot Redundant Protocol)來保障三層的冗余。當啟用了vPC之后,在兩台vPC交換機上開啟HSRP或VRRP,這時HSRP/VRRP是控制層面一個是Active,一個是Standby,由Active的交換機來響應ARP的請求;在數據轉發層面,兩台交換機都是Active,都在轉發數據。
When running HSRP/VRRP in active-active mode (data plane standpoint), aggressive timers can be
relaxed: use the default HSRP/VRRP timers.
● Define the SVI associated with FHRP/VRRP as passive routing interface in order to avoid forming routing adjacency over vPC peer-link.
● Define vPC primary peer device as the active HSRP/VRRP instance and vPC secondary peer device as
standby HSRP/VRRP (from control plane standpoint) for ease of operations.
● Disable ip redirect on the interface VLAN where HSRP/VRRP is configured (command is no ip redirect).
This is a general best practice related to HSRP/VRRP
VPC成功啟動的條件
1、peer-link起來之前一定要把peer-keepalive同步成功,必須被對端識別,peer-keepalive識別是peer-link起來的必要條件。
2、所有vpc控制層面的報文都是承載在CFS報文里面通過peer-link傳到對端。
3、只有做完一致性檢查之后,vpc才能起來
VPC的配置
1、啟用VPC特性
n7k(config)# feature vpc
n7k(config)# feature lacp
2、配置VPC Domain
n7k(config)# vpc domain 1
3、配置Peer-keepalive
對於管理接口:
n7k(config-vpc-domain)# peer-keepalive destination 172.28.230.85
對於SVI接口:
n7k(config)# show vrf management/default interface
n7k(config-vpc-domain)# peer-keepalive destination 172.28.1.100 source 172.28.1.120 vrf default
4、配置系統優先級
n7k(config-vpc-domain)# system-priority 4000
5、配置角色優先級
n7k(config-vpc-domain)# role priority 2000
6、當在配置了VPC的設備上啟用三層轉發時(啟用SVI接口)必需配置peer-gateway(Peer-Gateway使VPC對端(peer)設備轉發目的MAC地址為對端路由器的本地mac地址的流量)
n7k(config-vpc-domain)# peer-gateway
7、VPC對等體之間更快地收斂arp表,減少因對等鏈路端口信道振盪或vPC對等體重新聯機時ARP表恢復所涉及的延遲
n7k(config-vpc-domain)# ip arp synchronize
8、配置VPC peer-link
n7k(config)#interface e1/47-48
n7k(config-if-range)# switchport mode trunk
n7k(config-if-range)# channel-group 10 mode active
n7k(config)# interface port-channel 10
n7k(config-if)# vpc peer-link
9、將port-channel加入VPC
n7k(config)#interface e1/1-2
n7k(config-if-range)# switchport mode trunk
n7k(config-if-range)# channel-group 20 mode active
n7k(config)# interface port-channel 20
n7k(config-if)# vpc 20 #vpn號建議和channel號相同以便記憶
VPC reload restore和Auto-Recovery應用場景:
vpc reload restore:(只處理以下情況)
如果在2台vpc重啟的過程中,如果其中一台設備起不來,會導致整個vpc都起不來(keepalive同步不了,peer-link起不了,一致性做不了)。這樣導致會下聯業務中斷。
為了解決這種情況,可以啟用vpc reload restore。
啟用了reload restore之后,會等240s,對端還是起不了的話,會把stp和lacp的active接管過來,保證數據的傳輸。
vpc auto-recovery:
在nx-os5.2.1之后用auto-recovery替代reload restore。reload restore只能處理以上情況, auto-recovery可以處理更多的情況。
處理的情景:
1 peer-link鏈路斷開,緊接着主vpc交換機down
2 2個vpc重啟,只有一個起來
官網鏈接:;
https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus6000/sw/interfaces/7x/b_6k_Interfaces_Config_Guide_Release_7x/config_vpc.html
https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus6000/sw/layer2/7x/b_6k_Layer2_Config_7x/config_the_fabric_extender.html #cisco Fabric Extender 配置
https://blog.csdn.net/kkffii19621012/article/details/50729527
http://blog.51cto.com/thely/1570781