Cisco N3K VPC+HSRP+ospf 配置


 

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的消息。

 

 

一、背景需求

        Cisco 兩台交換機需要虛擬成一台交換機使用(類似 交換機堆疊),去鏈接二層接入交換機,提供網絡鏈路高可用。如下圖:

  

 

  對於二層交換 2960x  需要看到 上層的兩台 N3k 交換為一台設備,中間連接鏈路做鏈路聚合。

 二、配置詳解

   N3K_1和 N3K2  配置保持一致

     1、全局下開啟 VPC + HSRP+ospf  

feature vpc feature hsrp feature ospf

  2、配置 VPC 域ID

vpc domain 30 role priority 8192 # N3K_1:8192 N3K_2:16384 設置角色優先級 peer-keepalive destination 10.8.240.21 source 10.8.240.20 #IP 為MGMT地址 peer-gateway auto-recovery

 

   

   3、VPC peer-link 接口配置    

interface Ethernet1/49 switchport mode trunk channel-group 49 mode active interface Ethernet1/50 switchport mode trunk channel-group 49 mode active interface port-channel49 speed 40000 description vPc peer-link switchport mode trunk spanning-tree port type network  vpc peer-link

 

    4、下聯接口配置

interface Ethernet1/51/1 speed 10000 switchport mode trunk channel-group 50 mode active no shutdown interface port-channel50 speed 10000 switchport mode trunk vpc 50 #兩台N3K 的VPC ID 必須一致

 

  

  2960X交換機配置

 1:、接口配置(和普通鏈路聚合配置一樣)

interface TenGigabitEthernet1/0/1 switchport mode trunk channel-group 24 mode active interface TenGigabitEthernet1/0/2 switchport mode trunk channel-group 24 mode active interface Port-channel24 switchport mode trunk

 

三、hsrp+ospf 配置 

N3k_1: interface Vlan10 no shutdown ip address 192.168.0.2/24 ip router ospf 10 area 0.0.0.20 #ospf 路由發布 hsrp version 2 hsrp 10 preempt priority 105 ip 192.168.0.1 track 1 track 1 interface Ethernet1/48 line-protocol N3k_2: interface Vlan10 no shutdown ip address 192.168.0.3/24 ip router ospf 10 area 0.0.0.20 hsrp version 2 hsrp 10 ip 192.168.0.1 track 1 track 1 interface Ethernet1/48 line-protocol

 

四、查看配置

   

N3k-core-01# show vpc 
Legend:
                (*) - local vPC is down, forwarding via vPC peer-link

vPC domain id                     : 30  
Peer status                       : peer adjacency formed ok      
vPC keep-alive status             : peer is alive                 
Configuration consistency status  : success 
Per-vlan consistency status       : success                       
Type-2 consistency status         : success 
vPC role                          : primary, operational secondary
Number of vPCs configured         : 6   
Peer Gateway                      : Enabled
Peer gateway excluded VLANs     : -
Dual-active excluded VLANs        : -
Graceful Consistency Check        : Enabled
Auto-recovery status              : Enabled (timeout = 240 seconds)

vPC Peer-link status
---------------------------------------------------------------------
id   Port   Status Active vlans    
--   ----   ------ --------------------------------------------------
1    Po49   up     all                                      

vPC status
----------------------------------------------------------------------------
id     Port        Status Consistency Reason                     Active vlans
------ ----------- ------ ----------- -------------------------- -----------       
50     Po50        up     success     success                    all       
51     Po51        up     success     success                    all        
52     Po52        up     success     success                    all        
53     Po53        up     success     success                    all        
N3k-core-01# show vpc statistics peer-link 
port-channel49 is up
  Hardware: Port-Channel, address: 0062.ecef.8e5c (bia 0062.ecef.8e5c)
  Description: vPc peer-link
  MTU 9216 bytes, BW 80000000 Kbit, DLY 10 usec
  reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA
  Port mode is trunk
  full-duplex, 40 Gb/s
  Input flow-control is off, output flow-control is off
  Switchport monitor is off 
  EtherType is 0x8100 
  Members in this channel: Eth1/49, Eth1/50
  Last clearing of "show interface" counters never
  1 interface resets
  Load-Interval #1: 30 seconds
  30 seconds input rate 13194296 bits/sec, 5755 packets/sec
  30 seconds output rate 1558864 bits/sec, 802 packets/sec
  Load-Interval #2: 5 minute (300 seconds)
    input rate 11.66 Mbps, 5.24 Kpps; output rate 1.49 Mbps, 625 pps
  RX
    53092855268 unicast packets  943847523 multicast packets  37779519 broadcast packets
    54074482310 input packets  12067581932262 bytes
    3615421391 jumbo packets  0 storm suppression packets
    0 runts  0 giants  0 CRC  0 no buffer
    0 input error  0 short frame  0 overrun   0 underrun  0 ignored
    0 watchdog  0 bad etype drop  0 bad proto drop  0 if down drop
    0 input with dribble  0 input discard
    0 Rx pause
  TX
    27613649710 unicast packets  1107185465 multicast packets  48743817 broadcast packets
    28769578992 output packets  4953197509995 bytes
    1283510513 jumbo packets
    0 output errors  0 collision  0 deferred  0 late collision
    0 lost carrier  0 no carrier  0 babble 0 output discard
    0 Tx pause

 

N3k-core-01# show hsrp brief 
                     P indicates configured to preempt.
                     |
Interface   Grp Prio P State    Active addr      Standby addr     Group addr
Vlan10      10 105  P Active   local            192.168.0.3        192.168.0.1       (conf)
Vlan11      11 105  P Active   local            1921.68.1.3        192.168.1.1       (conf)
。。。。。。

 

 

 

此篇博客為本人個人工作總結,僅供參看。謝謝

 


免責聲明!

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



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