思科vPC技術和配置


思科VPC技術和配置

VPC概念

vpc (Virtual Port Channel),vPC 是一種實現跨設備鏈路聚合的機制,基於 LACP(單台設備鏈路聚合的標准) 進行了擴展,能夠實現多台設備間的鏈路聚合,從而把鏈路可靠性從單板級提高到了設備級。

VPC可以實現==跨物理設備的端口聚合==,目前只在Cisco Nexus系列交換機支持,目前據我所知在CISCO的Nexus 5000以上的型號都可以使用該功能。

VPC中包含VPC domain、VPC peer-link、VPC peer keepalive link、VPC peer switch以及port-channel端口等元素。

一定牢記,VPC是一組端口的概念,而不是一組設備的概念。

實現方式:

2nexus設備關聯到VPC domain。兩台設備通過2條特殊鏈路實現信息交換:

vpc的緣由

如上圖所示,在傳統的網絡拓撲中要實現網絡的冗余,一般都會使用雙鏈路上連的方式,而這種方式明顯有一個環路,在這種拓撲下都會開起生成樹協議,這時就會有一種鏈路是block狀態的。所以這種方式實現冗余,並不會增加網絡帶寬。如果想用鏈路聚合方式來做雙鏈路上連到兩台不同的設備,port-channel功能又不支持跨設備聚合。所以在這種背景下就出現了vPC的概念,和port-channel功能相比區別是:vPC功能解決了傳統聚合端口不能跨設備的問題。和傳統跨設備方案相比的區別是:即增強網絡冗余又能增加網絡帶寬。

VPC的部署拓撲

 

VPC優勢

vPC 為第二層網絡提供大量重要優勢,並借助第二層功能提供的優勢,對第三層互聯進行一系列改進。

  1. 實現跨設備的端口聚合
  2. 實現無環網絡架構
  3. 消除了因為生成樹協議而產生的阻塞端口
  4. 可以使用所有可用的上行鏈路,成倍增加鏈路帶寬
  5. 當有鏈路或者設備失效的時候實現快速收斂
  6. 雙活工作機制
  7. 增強鏈路的高可用性和可擴展性

此外,還支持以下重要的三層特性:

  • 通過 HSRP 配置進行主用-主用第三層轉發
  • 通過主用-主用 HSRP 進行完全第三層帶寬訪問
  • 通過主用-主用 PIM 指定路由器進行第三層迅速組播融合

注意:VPC只能用於二層,VPC端口不能運行路由協議。

VPC術語名詞

1.  vPC domain

vPC domain定義了一個vPC分組,分組中包含2台vPC peer devices,兩台vPC peer devices配置的domain ID必須一致,在同一個二層網絡中,vPC domain ID需要唯一存在。

2.  vPC peer link

用來在兩台peer devices之間同步狀態信息的鏈路。vPC peer link最少要是2個10G以太網接口。

3.  vPC peer keepalive link

可以使管理接口或者SVI接口,只承載心跳信息,用來檢查vPC對端設備是否active。

4.  vPC peer switch

構成vPC的其中一台交換機,vPC中兩台交換機一台被選舉為primary,另一台為secondary。

5.  vPC member port

vPC成員端口。

6.  vPC vlan

可以在vPC peer link上透傳的vlan,non-vPC vlan則反之。

7.  Orphan device

單鏈路上聯nexus交換機的設備稱之為孤立設備。

8.  Orphan port

用來連接nexus交換機和Orphan device的接口稱之為孤立接口。

9.  CFS(Cisco Fabric Service)

運行在vPC peer link上面用來實現vPC peer device狀態同步的協議。

配置vpc功能:

開啟VPC特性

Congo(config)# feature vpc
Egypt(config)# feature vpc

創建用於VPC的VRF

創建VRF

Congo(config)# vrf context vpc-keepalive
Egypt(config)# vrf context vpc-keepalive

創建VPC keeplive鏈路

Congo(config)# int ethernet 2/47
Congo(config-if)#   no switchport
Congo(config-if)#  vrf member vpc-keepalive
Congo(config-if)#  ip address 1.1.1.1 255.255.255.252

Egypt(config)# interface ethernet 2/48
Egypt(config-if)#  no switchport
Egypt(config-if)#  vrf member vpc-keepalive
Egypt(config-if)#  ip address 1.1.1.2 255.255.255.252

測試連通性:

Congo# ping 1.1.1.2 vrf vpc-keepalive

查看:

Congo# sho vpc

Legend:

(*) - local vPC is down, forwarding via vPC peer-link

vPC domain id                   : 1

Peer status                     : peer link not configured

vPC keep-alive status              : peer is alive

Configuration consistency status       : failed

Configuration consistency reason       : vPC peer-link does not exists

vPC role                       : none established

Number of vPCs configured            : 0

Peer Gateway                    : Disabled

Dual-active excluded VLANs           : -

可以看到keepalive已經OK,但vpc peer沒有起來

建立VPC-domain

Congo(config)# vpc domain 1
Congo(config-vpc-domain)#  peer-keepalive destination 1.1.1.2 source 1.1.1.1 vrf vpc-keepalive

Egypt(config)# vpc domain 1
Egypt(config-vpc-domain)#  peer-keepalive destination 1.1.1.1 source 1.1.1.2 vrf vpc-keepalive

配置VPC peer 鏈路(NEXUS交換機互聯)

必須使用10G端口,並且指定速率。

配置port-channel 100(省略)

Congo(config)# interface port-channel 100
Congo(config-if)#switchport mode trunk
Congo(config)# interface port-channel 100
Congo(config-if)#  vpc peer-link
 
Egypt(config)# interface port-channel 100
Egypt(config-if)#switchport mode trunk
Egypt(config)# interface port-channel 100
Egypt(config-if)#  vpc peer-link

配置后STP端口類型從network變為vPC peer-STP Bridge Assurance將會開啟,並且不能被關閉。

驗證:

Egypt# show vpc
Legend:
(*) - local vPC is down, forwarding via vPC peer-link
vPC domain id                  : 1
Peer status                   : peer adjacency formed ok
vPC keep-alive status                 : peer is alive
Configuration consistency status                : success
vPC role                    : secondary
Number of vPCs configured                 : 0
Peer Gateway                  : Disabled
Dual-active excluded VLANs           : -vPC Peer-link status
---------------id   Port   Status   Active
---------------1    Po100  up     1-20,100

如果Configuration consistency status狀態為any,可以通過下面命令檢查具體不一致的信息

Congo# show vpc consistency-parameters global
Legend: 
Type 1 : vPC will be suspended in case of mismatch
Name            Type  Local Value            Peer Value
------
STP Mode           1     Rapid-PVST             Rapid-PVST
STP Disabled         1     VLANs 91               VLANs 91
STP MST Region Name    1     customer               customer
STP MST Region Revision   1     1                      1
STP MST Region Instance to  1
VLAN Mapping
STP Loopguard        1     Disabled               Disabled
STP Bridge Assurance     1     Enabled                Enabled
STP Port Type, Edge     1     Normal, Disabled,          Normal,Disabled,
BPDUFilter, Edge BPDUGuard         Disabled                Disabled
STP MST Simulate PVST   1     Enabled                Enabled
Interface-vlan admin up   2     40-43,50,60,70-71,91,1 40-43,50,60,70-71,91,100-103                 00-103
Allowed VLANs        -     40-43,50,60,91,100-103 9,40-43,50,60,91,100-1,1000                  03,1000
Local suspended VLANs    -     -                      -

將port-channel加入VPC(連接下行端口)

Congo(config)# interface ethernet 2/1
Congo(config-if)#  channel-group 1 mode active
Congo(config)# interface port-channel 1
Congo(config-if)#  switchport
Congo(config-if)#  switchport mode trunk
Congo(config-if)#  vpc 1

Egypt(config)# int ethernet 2/2
Egypt(config-if)#  channel-group 1 mode active
Egypt(config)# int port-channel 1
Egypt(config-if)#  switchport
Egypt(config-if)#  switchport mode trunk
Egypt(config-if)#  vpc 1

下行交換機配置(不支持VPC設備)配置為普通ether-channel

Kenya(config)# interface ethernet 2/11-12
Kenya(config-if-range)# switchport
Kenya(config-if-range)# channel-group 1 mode active
Kenya(config-if-range)# no shutdown
Kenya(config)# int port-channel 1
Kenya(config-if)#  switchport
Kenya(config-if)#  switchport mode trunk

驗證VPC

Congo# show vpc
Legend:
(*) - local vPC is down, forwarding via vPC peer-link
vPC domain id                     : 1
Peer status                     : peer adjacency formed ok
vPC keep-alive status                  : peer is alive
Configuration consistency status          : success
vPC role                       : primary
Number of vPCs configured                  : 1
Peer Gateway                     : Disabled
Dual-active excluded VLANs                     : -vPC Peer-link status
---------------id   Port   Status   Active
---------------1    Po100  up     1-20,100

重復幀防護機制

vPC的一個重要轉發機制:vpc peer通過peer link發送過來的幀不會從vpc成員端口轉發出去,而發給非vpc vlanorphan port或者上聯鏈路的流量會正常轉發

Orphan port:不是通過vpc連接,但承載vpc vlan的端口

 

示例:單播——Mac_A  Mac_B

 

 

 

 說明:從Mac_A發送到MAC_B的包最初被泛洪到fabric中。它通過vPC1(這是一個端口通道,因此使用Sw3端口通道負載平衡算法來選擇一個路徑)選擇一條路徑,然后通過VLAN中的其他vPC以及vPC對等鏈接被泛洪。SW2不轉發包,它是本地vPC鏈接,因為它通過vPC對等鏈接接收包。只有在SW1vPC中沒有端口的情況下,它才會向下轉發它的本地vPC成員端口。

 

轉載自:https://blog.csdn.net/sisyphuss/article/details/102784756

    https://blog.csdn.net/qq_22193519/article/details/90038830


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM