cisco vpc

cisco-nexus系列交換-vpc

vpc簡介:

vpc概述

vpc(virtual PortChannel 虛擬鏈路聚合),技術允許將連接到兩個Nexus系列交換機的物理鏈路看作爲一條邏輯端口聚合鏈路。

可以連接的設備:nexus2000系列的Fabric Extender(交換機矩陣擴展器),交換機,服務器等其他任何網絡設備。

vpc技術可以提供二層多路徑選擇,讓用戶可以在有多條路徑的情況下增加網絡冗餘,提示帶寬,在多個節點之間實現多條並行路徑和對流量進行負載均衡。

vpc包括

啓用vpc功能之後,需要創建一個對等體保持活動連接(keepalive link),該連接將發送vpc對等體之間的心跳信息。

vpc域包括:vpc對等體設備(交換機)、vpc對等保持活動鏈路(心跳線)、vpc對等互聯鏈路和連接到下游設備等的vpc域中的所有PortChannels。每個設備上只能有一個vpc域ID。

vpc優勢

  • 允許一個設備跨兩個上游設備使用PortChannel
  • 消除生成樹協議阻塞端口
  • 提供無循環拓撲
  • 使用所有可用的上行帶寬
  • 提供快速收斂,比生成樹要快。
  • 提供鏈路級別的彈性。
  • 幫助確保高可用。

vpc案例

vpc不僅允許switch或者server連接到一對Nexus5000系列交換機創建PortChannel,還可以通過Nexus2000交換機來擴展交換機矩陣。如下圖1部署場景在兩個cisco上的兩個端口之間創建一個vpc。
cisco vpc

圖2中的vpc部署場景允許cisco nexus2000系列交換機連接到一對nexus5000系列交換機,並使所有連接處於活動狀態。
cisco vpc

除了圖1和圖2中的兩個拓撲之外,還可以在任何支撐PortChannel的設備上使用vpc,以便在設備上連接到一對nexus系列交換機實現彈性和高吞吐量。

VPC概念

  • VPC:vpc是指vpc對等體設備和下游設備之間的組合PortChannel。
  • vpc對等交換:就是組成vpc功能的兩個nexus系列交換機,一個設備爲主,一個爲備。
  • vpc對等連接:用於同步vpc對等設備之間狀態的連接。vpc對等鏈路在兩個vpc交換機之間攜帶控制通信量,還有組播、廣播數據通信量。在某些鏈路故障場景中,還攜帶單播通信量。對等鏈路至少是兩個10GE接口。
  • vpc域:該域包括vpc對等設備、vpc對等保持活動連接和連接到下游設備的vpc中的所有PortChannels。同時,所有關於vpc的全局配置都關聯到vpc域下。
  • vpc對等保持活動連接:對等保持活動連接監視vpc對等交換機的生命力。在vpc對等設備之間發送週期性的保持活動連接。vpc對等活動連接可以是管理接口(MGMT)或交換機虛擬接口(SVI)。沒有數據或同步流量在vpc登對保持活動連接上移動;該連接上的唯一通信量是表明交換機正在操作和運行vpc的消息。

vpc配置

  • 啓用vpc
  • 創建一個vpc域,並進入vpc-域模式。
  • 配置vpc等等保持活動連接。
  • (可選)配置系統優先級。
  • (可選)配置vp角色優先級
  • 創建vpc對等連接。
  • 將PortChannel加入vpc。

驗證vpc配置

Command command description
show feature 查看vpc功能是否啓用
show vpc brief 查看vpc簡短的信息
show vpc consistency-parameters 顯示所有vpc接口上必須一致的參數的狀態
show running-config vpc 查看vpc的運行配置信息
show port-channel capacity 顯示port-channel數量和有效的port-channel數量
show vpc statistics 查看vpc的統計信息
show vpc peer-keepalive 查看vpc保持活動消息的信息
show vpc role 顯示vpc對等設備的狀態,本地設備的角色,vpc系統的mac地址和系統優先級,和本地設備的mac地址和優先級

兩臺vpc設備必須相同的配置參數

  • portchannel模式:
    • on、off、active
  • 對等體port-channel鏈路速度
  • 對等體雙工模式
  • 對等體port-channeltrunk模式的本徵vlan
  • stp模式
  • stp的全局設置
    • 橋保護設置
    • 端口類型設置
    • 環路保護設置
  • stp接口設置
    • 端口類型設置
    • 環路保護
    • 根保護
  • qos配置
    • priority flow control(PFC)
    • 嚴格的優先排隊和赤字加權循環(DWRR)
    • 最大傳輸單元(mtu)

如果沒有在設備上啓用這些參數,則vpc一致性檢查將忽略這些參數。

應該相同的配置參數:

  • mac地址老化計時器
  • 靜態mac地址條目
  • 所有訪問控制列表acl配置和參數
  • 生成樹接口設置
    • 橋協議數據單元(BPDU)過濾器
    • BPDU保護
    • cost
    • 鏈路類型
    • 優先級
    • vlans(每個vlan的生成樹配置)
  • IGMP snooping

VPC配置案例

cisco vpc

n9k-1配置

  1. 配置管理接口ip和默認路由

    n9k-1(config)# interface mgmt 0 
    n9k-1(config-if)# ip add 172.16.2.1/24
    n9k-1(config-if)# vrf context management 
    n9k-1(config-vrf)# ip route 0.0.0.0/0 172.16.2.254 (路由本實驗可以忽略)
    n9k-1(config-vrf)# exit
  2. 啓用vpc和lacp

    n9k-1(config)# feature vpc
    n9k-1(config)# feature lacp
  3. 創建一個vlan

    n9k-1(config)# vlan 101 
    n9k-1(config-vlan)# exit
  4. 創建vpc域

    n9k-1(config)# vpc domain 1 
  5. 配置vpc角色優先級

    n9k-1(config-vpc-domain)# role priority 100
    Warning: 
    !!:: vPCs will be flapped on current primary vPC switch while attempting role change ::!! 
    Note: 
    --------:: Change will take effect after user has re-initd the vPC peer-link  ::-------- 
  6. 配置對等保持活動鏈接

    n7k-1(config-vpc-domain)# peer-keepalive destination 172.16.2.2 
    Note: 
    --------:: Management VRF will be used as the default VRF ::--------
  7. 配置vpc對等鏈路。

    注意:在vpc對等體交換機之間的peer link爲trunk時,trunk必須允許所有vpc成員端口所屬的vlan。

    n9k-1(config-vpc-domain)# interface ethernet 1/1-2 
    n9k-1(config-if-range)# channel-group 1 mode active 
    n9k-1(config-if-range)# interface port-channel 1
    n9k-1(config-if)# vpc peer-link 
    2018 Nov 29 07:52:50 n9k-1 %$ VDC-1 %$ stp: Please note that spanning tree port type is changed to "network" port type on vPC peer-link. This will enable spanning tree Bridge Assurance on vPC peer-link provided the STP Bridge Assurance (which is enabled by default) is not disabled. 
    n9k-1(config-if)# switchport mode trunk 
    n9k-1(config-if)# switchport trunk allowed vlan 1,101
    n9k-1(config-if)# exit
  8. 配置連接n2k port-channel(這步本實驗忽略,因爲沒有下聯n2k,直接互聯了一個交換)

    激活fex:
    n9k-1(config)# install feature-set fex 
    n9k-1(config)# feature-set fex 
    n9k-1(config)# fex 101 
    n9k-1(config-fex)# pinning max-links 1
    n9k-1(config-fex)# exit
    
    n9k-1(config)# interface ethernet 1/3-4 
    n9k-1(config-if-range)# channel-group 100 
    n9k-1(config-if-range)# interface port-channel 100
    n9k-1(config-if)# switchport mode fex-fabric 
    n9k-1(config-if)# fex associate 101 
    n9k-1(config-if)# exit
  9. 將下聯接口加入vpc

    n9k-1(config)# interface ethernet 1/7
    n9k-1(config-if)# channel-group 10 
    n9k-1(config-if)# interface port-channel 10
    n9k-1(config-if)# vpc 10
    n9k-1(config-if)# switchport access vlan 101
    n9k-1(config-if)# exit

n9k-2配置

  1. 配置管理接口ip和默認路由

    n9k-2(config)# interface mgmt 0 
    n9k-2(config-if)# ip add 172.16.2.2/24
    n9k-2(config-if)# vrf context management 
    n9k-2(config-vrf)# ip route 0.0.0.0/0 172.16.2.254 (路由本實驗可以忽略)
    n9k-2(config-vrf)# exit
  2. 啓用vpc和lacp

    n9k-2(config)# feature vpc 
    n9k-2(config)# feature lacp 
  3. 創建一個vlan

    n9k-2(config)# vlan 101
    n9k-2(config-vlan)# exit
  4. 創建vpc域

    n9k-2(config)# vpc domain 1 
    2018 Nov 29 08:38:14 n9k-2 %$ VDC-1 %$ %STP-2-VPC_PEERSWITCH_CONFIG_DISABLED: vPC peer-switch configuration is disabled. Please make sure to change spanning tree "bridge" priority as per the recommended guidelines.
  5. 配置vpc角色優先級

    本部忽略,不用配置。
  6. 配置對等保持活動鏈接

    n9k-2(config-vpc-domain)# peer-keepalive destination 172.16.2.1 
  7. 配置vpc對等鏈路。

    注意:在vpc對等體交換機之間的peer link爲trunk時,trunk必須允許所有vpc成員端口所屬的vlan。

    n9k-2(config-vpc-domain)# interface ethernet 1/1-2
    n9k-2(config-if-range)# channel-group 1 mode active 
    n9k-2(config-if-range)# interface port-channel 1 
    n9k-2(config-if)# vpc peer-link 
    2018 Nov 29 08:40:31 n9k-2 %$ VDC-1 %$ stp: Please note that spanning tree port type is changed to "network" port type on vPC peer-link. This will enable spanning tree Bridge Assurance on vPC peer-link provided the STP Bridge Assurance (which is enabled by default) is not disabled. 
    n9k-2(config-if)# switchport mode trunk 
    n9k-2(config-if)# switchport trunk allowed vlan 1,101
    n9k-2(config-if)# exit
  8. 配置連接n2k port-channel (這步本實驗忽略,因爲沒有下聯n2k,直接互聯了一個交換)

    激活fex:
    n9k-2(config)# install feature-set fex 
    n9k-2(config)# feature-set fex 
    n9k-2(config)# fex 101 
    n9k-1(config-fex)# pinning max-links 1
    n9k-2(config-fex)# exit
    
    n9k-2(config)# interface ethernet 1/3-4 
    n9k-2(config-if-range)# channel-group 100 
    n9k-2(config-if-range)# interface port-channel 100
    n9k-2(config-if)# switchport mode fex-fabric 
    n9k-2(config-if)# fex associate 101 
    n9k-2(config-if)# exit
  9. 將下聯接口加入vpc

    n9k-2(config)# interface ethernet 1/7
    n9k-2(config-if)# channel-group 10 
    n9k-2(config-if)# interface port-channel 10
    n9k-2(config-if)# vpc 10
    n9k-2(config-if)# switchport access vlan 101
    n9k-2(config-if)# exit

swi-1配置

swi-1(config)# interface range ethernet 0/0 to 0/1 
swi-1(config-if-range)# channel-group 1 
swi-1(config-if-range)# interface port-channel 1
swi-1(config-if)# switchport access vlan 101
swi-1(config-if)# exit

swi-1配置如下:
interface Port-channel1
 switchport access vlan 101
!
interface Ethernet0/0
 channel-group 1 mode on
!
interface Ethernet0/1
 channel-group 1 mode on

驗證vpc配置

N9k-1 的驗證

show vpc brief

cisco vpc

sh vpc peer-keepalive 

cisco vpc

sh vpc role 

cisco vpc

N9k-2 的驗證

cisco vpc

cisco vpc

vpc+HSRP 驗證冗餘

cisco vpc

配置hsrp

n9k

  1. 激活vlan接口和hsrp功能

    n9k-1(config)# feature interface-vlan 
    n9k-1(config)# feature hsrp 
  2. 配置hsrp

    激活track功能:

    n9k-1(config)# feature tacacs+ 

    配置track:

    n9k-1(config)# track 1 interface ethernet 1/7 line-protocol 
    n9k-1(config-if)# interface vlan 101
    n9k-1(config-if)# ip add 172.16.101.1 255.255.255.0
    n9k-1(config-if)# hsrp version 2
    n9k-1(config-if)# hsrp 101
    n9k-1(config-if-hsrp)# priority 120
    n9k-1(config-if-hsrp)# ip 172.16.101.3 
    n9k-1(config-if-hsrp)# track 1 decrement 11 
    n9k-1(config-if-hsrp)# exit
  3. 配置用於hsrp通信的接口

    n9k-1(config)# interface Ethernet1/4
    n9k-1(config-if)# switchport mode trunk
    n9k-1(config-if)# exit

n9k-2的配置

n9k-2(config)# feature interface-vlan 
n9k-2(config)# feature hsrp 
n9k-2(config)# feature tacacs+ 
n9k-2(config)# track 1 interface ethernet 1/3 line-protocol 
n9k-2(config-track)# exit
n9k-2(config)# interface vlan 101
n9k-2(config-if)# ip add 172.16.101.2 255.255.255.0
n9k-2(config-if)# hsrp version 2
n9k-2(config-if)# hsrp 101
n9k-2(config-if-hsrp)# priority 110
n9k-2(config-if-hsrp)# ip 172.16.101.3
n9k-2(config-if-hsrp)# track 1 decrement 11
n9k-2(config-if-hsrp)# exit
n9k-2(config)# interface Ethernet1/4
n9k-2(config-if)# switchport mode trunk
n9k-2(config-if)# exit

swi-1配置

interface vlan101
ip add 172.16.101.100 255.255.255.0

interface Port-channel1
 switchport access vlan 101
!
interface Ethernet0/0
 channel-group 1 mode on
!
interface Ethernet0/1
 channel-group 1 mode on

 ip route 0.0.0.0/0 172.16.101.3

驗證hsrp

n9k:

cisco vpc

cisco vpc

模擬鏈路中斷,網關自動切換,丟包1個

cisco vpc

cisco vpc

修改hsrp優先級,網關自動切換,不丟包

cisco vpc

cisco vpc

vpc+hsrp 生成樹,沒有block口!

cisco vpc

vpc+hsrp 和 單獨hsrp 對比

單獨的hsrp實驗,這裏不再敘述。

1、生成樹

hsrp的生成樹會阻塞端口,vpc+hsrp則不會。

cisco vpc

2、模擬鏈路中斷

hsrp模擬鏈路中斷,切換網關,丟包3個,比vpc+hsrp收斂慢。切回來的時候和vpc+hsrp是一樣的。
cisco vpc

cisco vpc

3、修改優先級

hsrp修改優先級,切換網關,丟包現象和vpc+hsrp收斂一樣。

4、鏈路帶寬

vpc+hsrp 實現下聯交換或者主機的上聯鏈路帶寬增加。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章