Back to Blog
Tutorial••7 min

Test BGP Failover With Two ISPs Before You Build It (Cisco, Juniper)

One prompt described a dual-ISP internet edge: a Cisco edge to ISP A, a Juniper edge to ISP B, an Arista core. NetPilot built it on real network operating systems, failed ISP A with the link still up, and measured a 174-second outage set by the BGP hold timer. BFD brought it to 1.24 seconds.

S
Sarah Chen
Network Engineer
BGP Failover Tested Before the Build: Cisco, Juniper, Two ISPs · Watch on YouTube

To test BGP failover with two ISPs before deployment, build the edge on the real network operating systems with routers standing in for both providers, check both eBGP sessions and the preferred path, then fail the primary ISP while a host pings a server behind them, and read the gap. Fail it the way circuits usually fail: the link stays up and nothing passes. This post runs that test from one prompt. NetPilot built a Cisco edge to ISP A, a Juniper edge to ISP B and an Arista core, and the design held, but the users lost the internet for 174 seconds before it moved to ISP B. BFD brought that to 1.24 seconds.

A dual-ISP design usually reaches the review as a diagram and a sentence: ISP A is primary, ISP B takes over if it fails. The diagram is right. The sentence has no number in it, and the number is what the business asks for after the first outage.

The design

Dual-ISP internet edge: a Cisco IOL edge to ISP A, a Juniper vJunos edge to ISP B, an Arista cEOS core with a host, FRR for both ISPs and the internetDual-ISP internet edge: a Cisco IOL edge to ISP A, a Juniper vJunos edge to ISP B, an Arista cEOS core with a host, FRR for both ISPs and the internet. PC1: 192.0.2.10. CORE: Arista cEOS, AS 65010. EDGE-CSCO: Cisco IOL, local pref 200. EDGE-JNPR: Juniper vJunos, prepend x3. ISPA: FRR, AS 64500. ISPB: FRR, AS 64510. INET: FRR, AS 64999. SRV: 198.51.100.10. PC1 connects to CORE. CORE connects to EDGE-CSCO. CORE connects to EDGE-JNPR. EDGE-CSCO connects to EDGE-JNPR, iBGP. EDGE-CSCO connects to ISPA, ISP A. EDGE-JNPR connects to ISPB, ISP B. ISPA connects to INET. ISPB connects to INET. INET connects to SRV.iBGPISP AISP BPC1192.0.2.10COREArista cEOSAS 65010EDGE-CSCOCisco IOLlocal pref 200EDGE-JNPRJuniper vJunosprepend x3ISPAFRRAS 64500ISPBFRRAS 64510INETFRRAS 64999SRV198.51.100.10
eBGP to each ISP, iBGP and OSPF inside AS 65010. Local preference 200 on routes from ISP A, our prefix prepended three times toward ISP B.
ItemValue
Cisco edgeEDGE-CSCO, Cisco IOL 17.12.1, eBGP to ISP A (AS 64500), local preference 200 on its routes
Juniper edgeEDGE-JNPR, Juniper vJunos router 26.2R1.7, eBGP to ISP B (AS 64510), 192.0.2.0/24 prepended three times
CoreCORE, Arista cEOS 4.36.1F, OSPF and iBGP to both edges, the user host PC1 on 192.0.2.0/24
The internetINET, FRR in AS 64999, peering with both ISPs, the test server SRV at 198.51.100.10
TimersBGP keepalive 60 s, hold 180 s (then BFD 300 ms × 3 on both ISP sessions)

The prompt gave none of these numbers. The agent chose the AS numbers, the addressing, the OSPF inside and the policy that makes ISP A primary in both directions.

The prompt

This is the prompt from the recording, typed as written:

Here's our internet edge design. Two ISPs on FRR, with a test server on the internet behind both. A Cisco edge router peers eBGP with ISP A, a Juniper edge router peers eBGP with ISP B, iBGP between the two edges, and an Arista core switch behind them with a Linux host for our users. ISP A is the primary path both ways, ISP B is the backup. Build it, show me on each device's CLI that both ISP sessions are up and that traffic takes ISP A. Then fail ISP A the way circuits usually fail, the link stays up but nothing gets through, and time how long the host loses the server.
The design prompt as sent in NetPilot: two ISPs on FRR, a Cisco edge to ISP A, a Juniper edge to ISP B, iBGP, an Arista core with a Linux host, ISP A primary, then fail ISP A with the link up and time the outage

Open the prompt prefilled in NetPilot and swap in your own edge.

Both ISP sessions up, ISP A preferred

The agent read each vendor's device guide, wrote the configurations in four syntaxes and deployed the lab with containerlab. It picked vJunos for the Juniper edge on its own, because cRPD cannot run BGP without a licence. One host came up with no link on the first two deploys: containerlab reserves the name host, so the agent renamed it PC1 and deployed again.

The running lab in the NetPilot lab viewer: PC1, CORE, EDGE-CSCO and EDGE-JNPR, ISPA and ISPB, INET and SRV, with the ISP A circuit between EDGE-CSCO and ISPA marked

Then it checked every claim on the devices, and these were typed by hand afterwards in the lab viewer's terminals. On the Cisco edge the session to ISP A is up and the server's prefix points at ISP A:

Cisco IOL EDGE-CSCO terminal: show ip bgp summary with 100.64.1.1 in AS 64500 up, show bfd neighbors with 100.64.1.1 Up on Et0/1, and show ip route 198.51.100.0 via 100.64.1.1

On the Juniper edge the session to ISP B is up, but the active route to the server has local preference 200 and goes through the Cisco edge. ISP B's path waits at 100:

Juniper vJunos EDGE-JNPR terminal: show bgp summary with three peers Established, show bfd session with 100.64.2.1 Up and 0.900 s detection, and show route 198.51.100.0/24 active via 10.255.0.1 at localpref 200 with the ISP B path at 100

And the host's traceroute leaves through 100.64.1.1, ISP A. The design does what the diagram says.

The silent failure: 174 seconds

Most circuits do not fail with the link going down. The light stays on and traffic stops. So the agent failed ISP A that way: 100% loss on both ends of the circuit, both links still up, while the host pinged the server five times a second.

The host lost the server for 174.08 seconds (836 of 989 probes). Neither router saw anything wrong on the interface, so both kept the session up until the 180 second BGP hold timer ran out. Outbound traffic moved to ISP B when the Cisco edge's timer expired, inbound about 1.8 seconds later when ISP A's own timer did. When ISP A came back, failback lost 0 of 141 probes.

NetPilot's result card: PC1 to SRV outage 174.08 s, 836 of 989 probes lost at 5 per second, failback loss 0 of 141, and the note that the gray failure is detected only by the 180 s BGP hold timer

"Failover is automatic" was true. It took almost three minutes.

That is the number a design review needs before the circuits are ordered, and no config check gives it to you: it only exists when the routers run.

BFD, tested again

A follow-up in the same chat:

Add BFD to both ISP sessions and run the same failure again. How long is the outage now?

Open it prefilled after the first prompt has built the lab.

The agent added BFD at 300 ms × 3 on both ISP sessions, both ends, without resetting a BGP session, and found one catch on the way. Cisco IOL turns BFD echo mode on by default, and against the FRR peer it slowed the control packets ISP A relies on: ISP A would have needed 3 seconds to notice the failure instead of 0.9. The agent set no bfd echo on that port.

The same failure took 1.24 seconds (5 of 695 probes). ISP A dropped the session 0.78 seconds after the cut, the Cisco edge 0.91 seconds after, and the first reply over ISP B came 0.5 seconds later. Failback lost 0 of 177.

NetPilot's result card after BFD: outage 1.24 s with BFD against 174.08 s before, 5 of 695 probes lost, failback loss 0 of 177

What it would take by hand

The same proof by hand starts with an image for each vendor and a host to run them, then the cabling, three configuration languages, routing policy in both directions, a way to fail a circuit without taking the interface down, and a stopwatch. That is days of an engineer's time, or a consultant's engagement, for one design. Here it was one prompt and one follow-up, under an hour, and the evidence is the routers' own output.

Run your own edge

Copy-paste ready: the prompt is in the lab library as the dual-ISP BGP edge failover test, with variations to try next, and the topology, startup files and failure script from this run are the public lab. FRR is built in. The Cisco IOL, Juniper vJunos and Arista cEOS nodes run your own images, uploaded once to your lab VM, as the supported devices page describes.

For how BGP picks the path, see the BGP path selection walkthrough. The data center version of this test, a spine failure in an EVPN fabric, is validate an EVPN VXLAN fabric design before you build it. For a network team that reviews designs and changes before they ship, network change and design validation covers the same workflow for your own topology.

FAQ

How do I test BGP failover with two ISPs before deployment?

Build the edge design on the real network operating systems in a lab, with routers standing in for both ISPs and a server behind them, check both eBGP sessions and the preferred path, then fail the primary ISP while a host pings the server and read the gap. Fail it the way circuits usually fail, with the link up and nothing passing, because an interface going down is the easy case. In the run on this page NetPilot built a Cisco IOL edge to ISP A, a Juniper vJunos edge to ISP B and an Arista cEOS core from one prompt, and timed the outage at 174.08 seconds with default timers.

How long does BGP failover take without BFD?

When the link stays up, as long as the BGP hold timer has left to run. In this lab the hold timer was 180 seconds and the host lost the server for 174.08 seconds (836 of 989 probes at five a second). Outbound traffic recovered when the Cisco edge's hold timer expired, inbound traffic about 1.8 seconds later on the ISP's side.

Do Cisco and FRR interoperate for BFD on an ISP session?

Yes, with one setting to check. Cisco IOL turns BFD echo mode on by default, and in this run it slowed the control packets the FRR peer relies on, so the ISP side would have taken 3 seconds to detect the failure instead of 0.9. With no bfd echo on the Cisco port both ends dropped the session within 0.91 seconds and the outage measured 1.24 seconds.

What does it take to prove a dual-ISP design by hand?

Images for each vendor, a host to run them, the cabling, three configuration languages, routing policy for both directions, a failure test and a stopwatch, usually days of lab time or a consultant's engagement. In the run on this page the design, both failure tests and the fix took under an hour from one prompt and a follow-up.

What network lab do you want to build?

NetPilot takes you from one prompt to a runnable network lab with CLI access.

Running this for a team? See NetPilot for teams