High-Redundancy Cisco NX-OS Edge Design in 50 FIB Routes (BGP, OSPF & EEM)

In this design case study, I document a high-redundancy dual-switch edge architecture originally designed and deployed for a colocation customer whose switches had severely constrained hardware FIB capacity. Since the customer contract has long expired, I am sharing the full lab reproduction, design constraints, and automated failover mechanics.

Because the lab emulator does not support cross-chassis LACP/vPC, the topology omits Port-Channel/vPC configuration between the NX-OS pair and the access switch, using independent links with HSRP instead. In production, the downlink to the blade access switch should run as a standard NX-OS vPC Port-Channel.

Lab Topology & Three-Uplink Edge Architecture

High-redundancy dual-NXOS edge topology operating within a 50-route FIB budget across two Hurricane Electric BGP uplinks and a tertiary LittleWolf-Backbone AS 65000 transit path
Figure 1: Three-uplink redundant edge lab topology keeping switch FIB entries under 50 prefixes (CLI prompts NXOS-Left / NXOS-Right correspond to NXOS-1 / NXOS-2).

Requirements, FIB Constraints & Protocol Stack

Customer Requirements

  • Switch-Only Edge Layer: Implement full multi-homed redundancy using only two L3 switches (NXOS-1 / NXOS-2)—no dedicated edge routers at the customer tier;
  • Strict Primary/Secondary Preference: The left switch uplink serves strictly as backup. Under healthy conditions, all traffic must forward through NXOS-2 (NXOS-Right in CLI); if NXOS-2 or its uplink fails, traffic must fail over rapidly to NXOS-1;
  • Three-Tier Transit Redundancy: While either primary Hurricane Electric (HE) link is healthy, the LittleWolf-Backbone (AS 65000) link must carry zero traffic. Only when both HE uplinks fail simultaneously should LittleWolf’s backbone take over.

Core Design Challenge: Tiny Hardware FIB

  • The switches have minimal TCAM/FIB capacity and cannot ingest full DFZ tables or large BGP prefix feeds from upstream providers;
  • Relying solely on default routes (0.0.0.0/0) across two L3 switches introduces a classic risk of mutual default-route forwarding loops or asymmetric suboptimal transit during partial failures.

Protocol Toolkit

  • OSPFv2: Runs across the inter-switch link (VLAN 999) and toward LittleWolf-Backbone to propagate conditional backup default routes;
  • BGP: Maintains eBGP sessions with both Hurricane Electric peers and LittleWolf’s backbone for default origination;
  • IP SLA + Track: Actively probes end-to-end upstream reachability—catching silent ISP internal blackholes even when interfaces remain UP/UP—to drive HSRP priority decrements;
  • Static Route + Cisco EEM: Pins IP SLA probes strictly out the local upstream port and uses Embedded Event Manager (EEM) to dynamically lower OSPF Administrative Distance from 110 to 19 (beating eBGP AD 20) during dual-upstream outages.

Baseline Verification Before Failover Configuration

Before adding automated failover, establish the eBGP sessions with both HE routers, configure inter-switch VLAN 999 (100.70.0.0/31), and bring up VLAN 100 HSRP (VIP 192.0.2.1/24) toward Blade-server-L2-Bridge. Inspect the initial routing tables and HSRP state on both NX-OS switches:

NXOS-Left# show ip route
IP Route Table for VRF "default"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>

0.0.0.0/0, ubest/mbest: 1/0
    *via 60.0.0.0, [20/0], 00:40:56, bgp-65001, external, tag 6939
8.8.8.8/32, ubest/mbest: 1/0
    *via 60.0.0.0, [20/0], 00:40:56, bgp-65001, external, tag 6939
60.0.0.0/31, ubest/mbest: 1/0, attached
    *via 60.0.0.1, Eth1/2, [0/0], 00:41:12, direct
60.0.0.1/32, ubest/mbest: 1/0, attached
    *via 60.0.0.1, Eth1/2, [0/0], 00:41:12, local
100.70.0.0/31, ubest/mbest: 1/0, attached
    *via 100.70.0.0, Vlan999, [0/0], 00:41:12, direct
100.70.0.0/32, ubest/mbest: 1/0, attached
    *via 100.70.0.0, Vlan999, [0/0], 00:41:12, local
192.0.2.0/24, ubest/mbest: 1/0, attached
    *via 192.0.2.2, Vlan100, [0/0], 00:41:12, direct
192.0.2.1/32, ubest/mbest: 1/0, attached
    *via 192.0.2.1, Vlan100, [0/0], 00:41:12, hsrp
192.0.2.2/32, ubest/mbest: 1/0, attached
    *via 192.0.2.2, Vlan100, [0/0], 00:41:12, local
NXOS-Right# show ip route
IP Route Table for VRF "default"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>

0.0.0.0/0, ubest/mbest: 1/0
    *via 60.1.0.0, [20/0], 00:42:04, bgp-65001, external, tag 6939
8.8.8.8/32, ubest/mbest: 1/0
    *via 60.1.0.0, [20/0], 00:42:04, bgp-65001, external, tag 6939
60.1.0.0/31, ubest/mbest: 1/0, attached
    *via 60.1.0.1, Eth1/2, [0/0], 00:44:09, direct
60.1.0.1/32, ubest/mbest: 1/0, attached
    *via 60.1.0.1, Eth1/2, [0/0], 00:44:09, local
100.64.0.0/31, ubest/mbest: 1/0, attached
    *via 100.64.0.1, Eth1/3, [0/0], 00:44:09, direct
100.64.0.1/32, ubest/mbest: 1/0, attached
    *via 100.64.0.1, Eth1/3, [0/0], 00:44:09, local
100.70.0.0/31, ubest/mbest: 1/0, attached
    *via 100.70.0.1, Vlan999, [0/0], 00:44:07, direct
100.70.0.1/32, ubest/mbest: 1/0, attached
    *via 100.70.0.1, Vlan999, [0/0], 00:44:07, local
192.0.2.0/24, ubest/mbest: 1/0, attached
    *via 192.0.2.3, Vlan100, [0/0], 00:44:06, direct
192.0.2.3/32, ubest/mbest: 1/0, attached
    *via 192.0.2.3, Vlan100, [0/0], 00:44:06, local

Confirm HSRP roles (NXOS-Right Active at priority 101, NXOS-Left Standby at priority 99) and baseline reachability from the blade server:

NXOS-Left# show hsrp brief
*:IPv6 group   #:group belongs to a bundle
                     P indicates configured to preempt.
                     |
Interface   Grp Prio P State    Active addr      Standby addr     Group addr
  Vlan100     100  99   P Standby  192.0.2.3        local            192.0.2.1
     (conf)

NXOS-Right# show hsrp brief
*:IPv6 group   #:group belongs to a bundle
                     P indicates configured to preempt.
                     |
Interface   Grp Prio P State    Active addr      Standby addr     Group addr
  Vlan100     100  101  P Active   local            192.0.2.2        192.0.2.1
     (conf)

[admin@Blade-server-device-bay] > ping 8.8.8.8
  SEQ HOST                                     SIZE TTL TIME  STATUS
    0 8.8.8.8                                    56 253 103ms
    1 8.8.8.8                                    56 253 36ms
    2 8.8.8.8                                    56 253 16ms
    3 8.8.8.8                                    56 253 16ms
    sent=4 received=4 packet-loss=0% min-rtt=16ms avg-rtt=42ms max-rtt=103ms

Step 1: Configure Conditional OSPF Default Origination & Cost Engineering

First, configure OSPF Area 0 and BGP on littlewolf-backbone. Crucially, omit the always keyword on default-information originate so the backup router only injects an OSPF default route when it actually holds a valid BGP default from its own upstream:

littlewolf-backbone#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
littlewolf-backbone(config)#router ospf 1
littlewolf-backbone(config-router)#
littlewolf-backbone(config-router)#default-information originate // Omit 'always' so OSPF injects 0.0.0.0/0 only when BGP default exists
littlewolf-backbone(config-router)#int g3
littlewolf-backbone(config-if)#ip os 1 a 0
littlewolf-backbone(config-if)#end

littlewolf-backbone#show run | sec bgp
router bgp 65000
 bgp log-neighbor-changes
 network 192.0.2.0 mask 255.255.255.0

Next, enable OSPF on NXOS-Right (and symmetrically on NXOS-Left) and filter BGP redistribution with a route-map matching route-type external and metric 0 (avoiding known NX-OS quirks with match source-protocol):

NXOS-Right(config-if)# int vlan 100
NXOS-Right(config-if)# ip router ospf cust area 0
NXOS-Right(config-if)# ip osp pa
NXOS-Right(config-if)# int vlan 999
NXOS-Right(config-if)# ip router ospf cust a 0
NXOS-Right(config)# route-map import-bgp permit 100
NXOS-Right(config-route-map)# match route-type external
NXOS-Right(config-route-map)# match metric 0
NXOS-Right(config-route-map)# exit
// Match external routes with metric 0 (eBGP default) instead of match source-protocol to avoid NX-OS redistribution bugs

Verify the Type-5 External OSPF LSA database across both switches—all three default-route originators (100.64.0.0, 100.70.0.0, and 100.70.0.1) are present:

NXOS-Left# show ip ospf database external
        OSPF Router with ID (192.0.2.2) (Process ID cust VRF default)

                Type-5 AS External Link States

Link ID         ADV Router      Age        Seq#       Checksum Tag
0.0.0.0         100.70.0.1      804        0x80000002 0x2bf9    0

// After mirroring redistribution config on NXOS-Left:
NXOS-Left# show ip ospf database external
        OSPF Router with ID (192.0.2.2) (Process ID cust VRF default)

                Type-5 AS External Link States

Link ID         ADV Router      Age        Seq#       Checksum Tag
0.0.0.0         100.64.0.0      1837       0x80000005 0xa960    1
0.0.0.0         100.70.0.0      1331       0x80000003 0x2ff5    0
0.0.0.0         100.70.0.1      1444       0x80000005 0x25fc    0

NXOS-Right# show ip ospf database external
        OSPF Router with ID (192.0.2.3) (Process ID cust VRF default)

                Type-5 AS External Link States

Link ID         ADV Router      Age        Seq#       Checksum Tag
0.0.0.0         100.64.0.0      1826       0x80000005 0xa960    1
0.0.0.0         100.70.0.0      1321       0x80000003 0x2ff5    0
0.0.0.0         100.70.0.1      1433       0x80000005 0x25fc    0

Enforcing Path Preference via OSPF Interface Cost

Raise the OSPF interface costs on NXOS-Right toward both LittleWolf-Backbone (Eth1/3 = 1000) and NXOS-Left (Vlan999 = 500). Because NXOS-Left has no direct link to LittleWolf’s backbone, tuning inbound OSPF metrics on NXOS-Right alone establishes deterministic priority—and keeping HSRP Active on NXOS-Right eliminates suboptimal cross-switch hairpinning:

NXOS-Right(config)# int e1/3
NXOS-Right(config-if)# ip ospf cost 1000
NXOS-Right(config-if)# int vlan 999
NXOS-Right(config-if)# ip ospf cost 500

NXOS-Left# show ip route 0.0.0.0/0
IP Route Table for VRF "default"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>

0.0.0.0/0, ubest/mbest: 1/0
    *via 60.0.0.0, [20/0], 01:20:00, bgp-65001, external, tag 6939
     via 100.70.0.1, Vlan999, [110/1], 01:19:45, ospf-cust, type-2

NXOS-Right(config-if)# show ip route 0.0.0.0/0
IP Route Table for VRF "default"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>

0.0.0.0/0, ubest/mbest: 1/0
    *via 60.1.0.0, [20/0], 01:09:29, bgp-65001, external, tag 6939
     via 100.70.0.0, Vlan999, [110/1], 00:01:15, ospf-cust, type-2

Step 2: Combining Track + IP SLA + HSRP to Catch Silent Blackholes

Three-stage failover state machine: Stage 1 primary via NXOS-2, Stage 2 IP SLA triggers HSRP failover to NXOS-1, Stage 3 Cisco EEM lowers OSPF AD to 19 to pre-empt eBGP during dual-HE outages
Figure 2: Three-stage failover state machine combining HSRP, Track/IP SLA, and Cisco EEM dynamic OSPF distance switching.

In real-world ISP operations, upstream failures occur in three distinct modes:

  • L1/L2 degradation: Interface remains UP/UP while an optical transceiver or transport circuit drops packets;
  • Silent upstream routing blackhole: Interface and eBGP peering remain up, yet packets die deeper inside the upstream ISP;
  • Hard link down: Local interface drops physically.

Tracking interface line-protocol alone misses modes 1 and 2. To detect all three reliably, we pin a /32 probe target (1.1.1.1/32) to the local upstream next-hop via track 99 (with a floating Null0 fallback at AD 100) and monitor reachability with IP SLA 100 driving HSRP decrement:

NXOS-Right(config)# track 99 interface ethernet 1/2 line-protocol
NXOS-Right(config)# ip route 1.1.1.1/32 60.1.0.0 track 99
NXOS-Right(config)# ip route 1.1.1.1/32 null 0 100
NXOS-Right(config)# feature sla responder
NXOS-Right(config)# feature sla sender
NXOS-Right(config)# ip sla 100
NXOS-Right(config-ip-sla)# icmp-echo 1.1.1.1 source-interface e1/2
NXOS-Right(config-ip-sla-echo)# threshold 50 // Tune threshold/timeout to match production RTT
NXOS-Right(config-ip-sla-echo)# timeout 100 // Typically ~3x RTT; lab values shown for reference
NXOS-Right(config-ip-sla-echo)# fre 1 // Probe interval in seconds
NXOS-Right(config)# ip sla schedule 100 start-time now life forever

Verify both Track objects and attach track 100 decrement 10 to HSRP group 100 on both switches:

NXOS-Left# show track
Track 99
  Interface Ethernet1/2 Line Protocol
  Line Protocol is UP
  1 changes, last change 00:10:07

Track 100
  IP SLA 100 Reachability
  Reachability is UP
  2 changes, last change 00:02:53
  Latest operation return code: OK
  Latest RTT (millisecs): 46

NXOS-Right# show track
Track 99
  Interface Ethernet1/2 Line Protocol
  Line Protocol is UP
  1 changes, last change 00:19:22

Track 100
  IP SLA 100 Reachability
  Reachability is UP
  2 changes, last change 00:05:38
  Latest operation return code: OK
  Latest RTT (millisecs): 7

NXOS-Left(config)# int vlan 100
NXOS-Left(config-if)# hsrp 100
NXOS-Left(config-if-hsrp)# track 100 decrement 10
NXOS-Left(config-if-hsrp)# end

NXOS-Right(config)# int vlan 100
NXOS-Right(config-if)# hsrp 100
NXOS-Right(config-if-hsrp)# track 100 decrement 10
NXOS-Right(config-if-hsrp)# end

Failover Test 1: Hard Interface Shutdowns

Shutting down the primary HurricaneRS-2 link causes NXOS-Right HSRP priority to drop from 101 to 91, handing Active forwarding immediately to NXOS-Left (99):

NXOS-Right# show ip route 0.0.0.0/0

0.0.0.0/0, ubest/mbest: 1/0
    *via 100.70.0.0, Vlan999, [110/1], 07:15:59, ospf-cust, type-2

NXOS-Right# show hsrp bri
*:IPv6 group   #:group belongs to a bundle
                     P indicates configured to preempt.
                     |
Interface   Grp Prio P State    Active addr      Standby addr     Group addr
  Vlan100     100  91   P Standby  192.0.2.2       local            192.0.2.1

Shutting down HurricaneRS (RS1) as well removes both eBGP defaults. NXOS-Right installs the OSPF default toward Eth1/3 (100.64.0.0) and NXOS-Left routes via Vlan999 (100.70.0.1) to LittleWolf’s backbone with zero packet loss from the blade server:

NXOS-Left# show ip ro 0.0.0.0/0

0.0.0.0/0, ubest/mbest: 1/0
    *via 100.70.0.1, Vlan999, [110/1], 00:00:04, ospf-cust, type-2, tag 1

NXOS-Right# show ip route 0.0.0.0/0

0.0.0.0/0, ubest/mbest: 1/0
    *via 100.64.0.0, Eth1/3, [110/1], 00:00:14, ospf-cust, type-2, tag 1

[admin@Blade-server-device-bay] > ping 8.8.8.8
  SEQ HOST                                     SIZE TTL TIME  STATUS
    0 8.8.8.8                                    56 252 19ms
    1 8.8.8.8                                    56 252 50ms
    2 8.8.8.8                                    56 252 28ms
    sent=3 received=3 packet-loss=0% min-rtt=19ms avg-rtt=32ms max-rtt=50ms

Failover Test 2: Silent Upstream Blackholes & Cisco EEM Remediation

Now consider the harder failure mode: both physical interfaces remain UP and eBGP stays established, yet upstream routing inside both ISPs fails. First, failing RS2’s upstream causes Track 100 to fall and shifts HSRP Active to NXOS-Left:

NXOS-Right# show ip ro 0.0.0.0/0
IP Route Table for VRF "default"
'*' denotes best ucast next-hop
'**' denotes best mcast next-hop
'[x/y]' denotes [preference/metric]
'%<string>' in via output denotes VRF <string>

0.0.0.0/0, ubest/mbest: 1/0
    *via 60.1.0.0, [20/0], 00:00:33, bgp-65001, external, tag 6939
     via 100.70.0.0, Vlan999, [110/1], 00:00:04, ospf-cust, type-2

NXOS-Right# show hsrp bri
*:IPv6 group   #:group belongs to a bundle
                     P indicates configured to preempt.
                     |
Interface   Grp Prio P State    Active addr      Standby addr     Group addr
  Vlan100     100  91   P Standby  192.0.2.2       local            192.0.2.1

NXOS-Right# show track 100
Track 100
  IP SLA 100 Reachability
  Reachability is DOWN
  7 changes, last change 00:24:10
  Latest operation return code: Timeout
  Tracked by:
    HSRP Vlan100 100

However, if both RS1 and RS2 suffer silent upstream blackholes simultaneously, eBGP continues injecting 0.0.0.0/0 with AD 20 on both switches—beating OSPF (AD 110) from LittleWolf-Backbone and causing 100% packet loss regardless of HSRP state:

NXOS-Left# show ip ro 0.0.0.0/0

0.0.0.0/0, ubest/mbest: 1/0
    *via 60.0.0.0, [20/0], 00:00:14, bgp-65001, external, tag 6939
     via 100.70.0.1, Vlan999, [110/1], 00:00:17, ospf-cust, type-2

NXOS-Left# show hsrp bri
*:IPv6 group   #:group belongs to a bundle
                     P indicates configured to preempt.
                     |
Interface   Grp Prio P State    Active addr      Standby addr     Group addr
  Vlan100     100  89   P Standby  192.0.2.3       local            192.0.2.1

[admin@Blade-server-device-bay] > ping 8.8.8.8
  SEQ HOST                                     SIZE TTL TIME  STATUS
    0 8.8.8.8                                                 timeout
    1 8.8.8.8                                                 timeout
    2 8.8.8.8                                                 timeout
    sent=3 received=0 packet-loss=100%

Dynamic OSPF AD Pre-emption Using Cisco EEM

To solve this cleanly, configure two Cisco EEM applets that react instantaneously to track 100 state transitions: lowering router ospf cust distance to 19 when Track 100 goes down (pre-empting eBGP AD 20), and restoring distance 110 once upstream connectivity returns:

NXOS-Left(config)# event manager applet shut-he-peer
NXOS-Left(config-applet)# event track 100 state down
NXOS-Left(config-applet)# action 0 cli enable
NXOS-Left(config-applet)# action 1 cli conf t
NXOS-Left(config-applet)# action 2 cli router ospf cust
NXOS-Left(config-applet)# action 3 cli distance 19
NXOS-Left(config-applet)# action 4 cli end

NXOS-Left(config)# event manager applet restore-he-peer
NXOS-Left(config-applet)# event track 100 state up
NXOS-Left(config-applet)# action 0 cli enable
NXOS-Left(config-applet)# action 1 cli conf t
NXOS-Left(config-applet)# action 2 cli router ospf cust
NXOS-Left(config-applet)# action 3 cli distance 110
NXOS-Left(config-applet)# action 4 cli end

Re-testing the dual silent upstream outage confirms OSPF immediately assumes AD 19, pre-empting eBGP and restoring blade server connectivity—and automatically fails back to HE when Track 100 recovers:

NXOS-Left# show ip route 0.0.0.0/0

0.0.0.0/0, ubest/mbest: 1/0
    *via 100.70.0.1, Vlan999, [19/1], 00:00:16, ospf-cust, type-2, tag 1
     via 60.0.0.0, [20/0], 00:00:15, bgp-65001, external, tag 6939

NXOS-Right# show ip route 0.0.0.0/0

0.0.0.0/0, ubest/mbest: 1/0
    *via 100.64.0.0, Eth1/3, [19/1], 00:02:21, ospf-cust, type-2, tag 1
     via 60.1.0.0, [20/0], 00:02:19, bgp-65001, external, tag 6939

[admin@Blade-server-device-bay] > ping 8.8.8.8
  SEQ HOST                                     SIZE TTL TIME  STATUS
    0 8.8.8.8                                    56 252 42ms
    1 8.8.8.8                                    56 252 18ms
    2 8.8.8.8                                    56 252 20ms
    sent=3 received=3 packet-loss=0% min-rtt=18ms avg-rtt=26ms max-rtt=42ms

// After upstream recovery, EEM restore-he-peer reverts OSPF AD to 110:
NXOS-Left# show ip route 0.0.0.0/0

0.0.0.0/0, ubest/mbest: 1/0
    *via 60.0.0.0, [20/0], 00:05:45, bgp-65001, external, tag 6939
     via 100.70.0.1, Vlan999, [110/1], 00:00:08, ospf-cust, type-2

NXOS-Right# show ip route 0.0.0.0/0

0.0.0.0/0, ubest/mbest: 1/0
    *via 60.1.0.0, [20/0], 00:06:42, bgp-65001, external, tag 6939
     via 100.70.0.0, Vlan999, [110/1], 00:00:16, ospf-cust, type-2

With fewer than 50 prefixes in the hardware FIB, this dual-switch edge architecture achieves deterministic three-uplink redundancy, silent blackhole detection, and zero routing loops.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.