Cisco N3K VPC+HSRP+ospf 配置

一、背景需求

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

此篇博客为本人个人工作总结,仅供参看。谢谢

时间: 2024-12-23 16:12:40

Cisco N3K VPC+HSRP+ospf 配置的相关文章

Cisco思科路由器HSRP配置和排障那些事儿~~

首先亮出必备命令来: 配置HSRP的成员: Router(config-if)#standby 备份组号 ip 备份组虚拟IP地址 配置HSRP优先级: Router(config-if)#standby 备份组号 priority 优先级级别 配置端口跟踪:活跃路由器上配置 Router(config-if)#standby 备份组号 track 跟踪接口 配置HSRP占先权:备份路由器上配置 Router(config-if)#standby 备份组号 preempt 查看HSRP信息: S

热备份路由选择协议(HSRP)配置命令及原理

热备份路由选择协议(HSRP)HSRP是Cisco私有协议HSRP组成员:(1)活跃路由器(2)备份路由器(3)虚拟路由器(4)其他路由器HSRP消息:HSRP中的所有路由器都发送或接收HSRP消息UDP端口号1985使用组播发送HSRP消息,组播地址224.0.0.2TTL=1HSRP状态:(1)初始状态(2)学习状态(3)监听状态(4)发言状态(5)备份状态(6)活跃状态HSRP计时器:Hello间隔(默认3s)保持时间(默认10s)HSRP与VRRP的区别:1.热备份路由协议HSRPCis

cisco(思科)交换机配置篇【二】

上一篇给大家讲到了cisco交换机的基本操作命令,趁端午节放假前,把cisco交换机的简单配置分享一下并预祝一下各位"端午节快乐"!Ok,要进行交换机的配置,首先就得进入交换机的全局配置模式,在成功连接交换机并且登陆成功进入特权模式下 1.输入进入全局配置模式: switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. switch(config)# switch(con

Cisco Packet Tracer 6.0 配置终端服务器

Cisco Packet Tracer 6.0 配置终端服务器方法: 先看一下我的拓扑结构 Server配置: 1.配置IP地址,与Client端在同一个网段 (config)#interface f0/0 (config-if)#ip address 192.168.1.1 255.255.255.0 (config-if)#no shutdown 2.设置登陆的用户名及密码 (config)#username cisco privilege 15 password 0 class 3.配置l

OSPF配置实例

配置ospf使得pc1和pc2能互通接口的基本配置 R1:R1(config)#int f0/0R1(config-if)#ip address 192.168.2.1 255.255.255.0 R1(config-if)#no shutdownR1(config)#int s1/0R1(config-if)#ip address 172.16.0.1 255.255.255.252R1(config-if)#clock rate 64000R1(config-if)#no shutdown

Cisco   HSRP 双机配置

Cisco HSRP配置 网络拓扑 配置命令 HA-A配置命令 HA-A>enable HA-A#conf terminal Enter configuration commands, one per line. End withCNTL/Z. HA-A(config)#int gigabitEthernet 0/2 HA-A(config-if)#no switchport[周书轩1] HA-A(config-if)#ip address 192.168.30.2 255.255.255.0[

Cisco Nexus vPC之Sticky Master

场景 生产环境里,我们经常把其中的一台Nexus交换机从vPC domain中独立出来,比如升级或灾备演练等情况.但是其中一个细节即Sticky Master的状态很少有人会注意到,因此这可能导致网络中断. 在vPC环境中,两台vPC会进行role选举,通过优先级配置,假设N7K-1为primary,N7K-2为secondary. 步骤一 当我们把N7K-2从vPC环境中独立出来,即断掉N7K-2的peer-link.keepalive以及所有上下行接口.这时候两台设备处于双活状态,N7K-1

20、OSPF配置实验之特殊区域stub

1.特殊区域stub解析 区域类型 作用 是否下发默认路由 备注 stub 过滤LSA4.LSA5 ABR默认下发3类默认路由,seed cost值为1 本区域所有路由器都必须配置成stub,否则邻居起不来,且不能包含ASBR 2.实验拓扑 3.实验配置 R1配置 interface Loopback0 ip address 1.1.1.1 255.255.255.0 interface Serial0/0 ip address 12.1.1.1 255.255.255.0 router osp

OSPF 配置

封装在IP层:协议号 89 hello时间是dead时间的1/4 ------------------------------------------------------------------------------------ 基本配置: 全局模式下; router ospf 100 router-id 1.1.1.1  //一旦选出路由ID,再该更时需要 clear ip ospf process或重启 network 172.16.1.1 0.0.0.0 area 0   //路由进