1. 程式人生 > >Cisco N3K VPC+HSRP+ospf 配置

Cisco N3K VPC+HSRP+ospf 配置

esc out orm des ber red -c bili number

一、背景需求

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

  技術分享

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

二、配置詳解

  N3K_1和 N3K2 配置保持一致

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

feature vpc
feature hsrp
feature ospf

    2、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

    3、下聯接口配置

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)
。。。。。。

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

Cisco N3K VPC+HSRP+ospf 配置