Skip to main content

How to set up failover for a Direct Connect connection

A Direct Connect connection sends the static routes of a VNet to one firewall on your side: the primary peer. Failover gives those routes other paths, in a fixed order: a backup peer (a second firewall on the same link) and, as the last level, an IPsec VPN of the same VNet. The platform monitors every path and, if the one carrying the traffic stops answering or degrades, moves all the routes to the next healthy path by itself; the IPsec only takes over when every Direct Connect peer is down. Going back to a preferred path is always your decision: you get a notice when it is stable again.

This page covers the failover in general and the backup peer. The IPsec has a guide of its own: How to use an IPsec as the last level of failover.

Where the failover is​

Each connection (a VNet bound to a Direct Connect) has its own page. To open it, go to Customer Connect → Direct Connect, click the Direct Connect and, in Active Connections, click the row of the VNet. Set up failover, in the Failover column of a connection without failover, opens the same page.

Active Connections table with the row of the vnet-app VNet highlighted

The page is called after the VNet and the Direct Connect, such as vnet-app on dc-recife. At the top, Summary shows the VNet (a link to its page), the addressing, the MAC Address, the status, the failover state and when the VNet was bound (Bound on), with the Health Check, Firewall rules and Unbind VNet buttons. Firewall rules opens the Firewall Rules tab of the VNet. Below it there are three tabs: Failover, with the failover order and the settings, Static routes and History.

Connection page with the Summary, the Failover, Static routes and History tabs and the Failover order with the primary peer active, the backup peer on standby and the IPsec not configured

How failover works​

Failover order shows the levels, in order of preference:

LevelPathRequired
1Primary peer: your firewall on the linkYes
2Backup peer: a second firewall on the same linkNo
3IPsec: a VPN of the same VNetNo

Failover needs at least one path besides the primary: the backup peer, the IPsec, or both. Each level card shows whether it is ACTIVE or STANDBY, its health, and buttons to switch to it and to test it.

  • Monitoring. The VNet router pings each peer from its own Local IP, at the interval of the detection profile. When a peer has a Monitor IP, the router pings that address through the peer instead, so you know whether the network behind the firewall is up, not only the firewall. The IPsec is monitored all the time through the tunnel, as its guide explains.
  • Health of each path. A path is Down after a number of losses in a row that depends on the profile, and Up again after 3 replies in a row. With degradation thresholds set, a path that still answers but crosses them is Degraded.
  • Automatic failover. When the path carrying the traffic is down or degraded, all the routes of the connection move to the most preferred path that is up (healthy and not degraded). If the primary fails and the backup is healthy, the traffic goes to the backup. Between the peers it works both ways: if the traffic is on the backup and the backup fails while the primary is healthy, the traffic goes to the primary. The IPsec is the last resort: it only takes over when every Direct Connect peer (the primary and, if there is one, the backup) is down. Degradation only switches between the Direct Connect peers, never to the IPsec.
  • No flip-flop. After a switch caused by degradation, a new switch caused only by degradation waits at least 1 minute. A path that is down is always left right away.
  • Path down and only degraded paths left (optional). By default, when the path carrying the traffic goes down and the others are only degraded, the traffic waits on the path that went down until another one is healthy. With If the active path goes down, use a degraded one turned on, it goes right away to the next path that still answers, in the failover order. The IPsec keeps its rule: it only takes over when every Direct Connect peer is down.
  • All paths down. Nothing moves: the traffic stays on the current path until one of them recovers.
  • Recovered. While the traffic is on a lower level, when a preferred peer stays up for the recovery time of the profile, the platform marks it as recovered (Primary recovered or Backup recovered) and notifies you. The traffic stays where it is until you switch it.
  • Timing. The switch is made by the router itself, in seconds. The portal and the notices show it within about half a minute.

Before you start​

  • A VNet bound to a Direct Connect, with the status BOUND. See How to bind a VNet to a Direct Connect.
  • For the backup peer, a second firewall or router on your side, connected to the same Direct Connect link.
  • The customer-connect:direct_connect:manage permission. Without it, the Failover tab is read-only and says so at the top.
  • If the Failover tab shows a notice that the virtual router of this VNet needs an update, its options stay disabled: ask support to update the router.

Choose the backup network​

Before filling in the backup, decide which network the backup firewall will sit in. There are two options:

Left, the Separate network option: the VDC router has 172.16.1.1/30 for the primary and 172.16.2.1/30 for the backup. Right, the Same network as primary option: the router has 172.16.1.1/29 and both firewalls sit in that same network

  • Separate network (default): the backup gets a network of its own. You choose a new Local IP (CIDR), which the platform adds to the VDC router, and enter the backup firewall IP inside that network. Use it when the backup already has another IP range or when the primary network is a /30.
  • Same network as primary: the backup sits in the primary network. You enter only the backup firewall IP. The primary network must be /29 or larger, because a /30 only has two addresses: the router's and the primary's.

Why must the backup IP be inside that network?​

The VDC router hands traffic to your firewall directly, over the Direct Connect link, with no router in between. For that, both sides must be in the same network:

  • the router only finds the firewall if its IP is in a network configured on the interface;
  • the firewall only answers the router if the router IP is in its network.

It is the same rule as for the primary peer. What is not required is for the backup to be in the primary network: with Separate network, it gets a network of its own.

Examples, with the primary at 172.16.1.2 and the router at 172.16.1.1/30:

ModeLocal IP (CIDR)Backup remote IPResult
Separate network172.16.2.1/30172.16.2.2Accepted
Separate network172.16.2.1/30172.16.3.2Refused: the IP is outside 172.16.2.0/30
Separate network172.16.1.5/30172.16.1.6Accepted: 172.16.1.4/30 does not overlap the primary network
Separate network172.16.1.1/29172.16.1.3Refused: the network overlaps the primary's. Use Same network as primary
Same network as primary(the primary's)172.16.1.3Refused with the primary on a /30. Accepted if the primary is 172.16.1.1/29

The backup network also cannot overlap the VNet network, nor the networks of the other connections of the same Direct Connect. The backup Remote IP must be different from the primary's.

Add the backup peer​

  1. Open the page of the connection, as shown in Where the failover is.

  2. On the Failover tab, under Peers, choose the backup network and fill in the fields:

    • Separate network: enter the Local IP (CIDR) on our side (for example 172.16.2.1/30) and the Backup remote IP of your backup firewall inside that network (for example 172.16.2.2).

      Peers section with Separate network selected, Local IP 172.16.2.1/30 and Backup remote IP 172.16.2.2 filled in

    • Same network as primary: enter only the Backup remote IP of the backup firewall. It must be inside the primary network and different from the primary.

      Peers section with Same network as primary selected and Backup remote IP 172.16.1.3 filled in

  3. (Optional) Set a Monitor IP for each peer, such as a server behind each firewall. Leave it empty to ping the peer itself.

  4. Keep Automatic failover on and choose a Detection profile:

    ProfileCheckSwitches afterCounts as recovered after
    Fastevery 1 s, down after 5 losses~5 s1 min
    Balanced (default)every 3 s, down after 5 losses~15 s3 min
    Conservativeevery 5 s, down after 9 losses~45 s10 min
  5. (Optional) Under Degradation, turn on Packet loss above (%) or Avg latency above (ms) and set the threshold. The platform suggests 20% and 150 ms; the limits are 1 to 100% and 1 to 60000 ms. Quality is measured over the last 30 pings, and a degraded path is only left for one that is healthy and not degraded. Below them, turn on If the active path goes down, use a degraded one if a degraded path is better for you than waiting on one that is down; the option needs a threshold turned on and the router of the VNet on release 1.0.6.

    Detection section with Automatic failover on, the Balanced profile selected and the Degradation thresholds

  6. Click Save Changes, at the bottom of the tab.

After saving, Failover order and the Failover column of Active Connections show Protected, and the Addressing column shows the standby path and its health on a second line.

Active Connections table with the Failover column showing Protected and the standby peer under the addressing

Add the backup while binding the VNet​

The Bind VNet to Direct Connect dialog has the same Backup peer section. Fill in the backup network and the Remote IP of the backup firewall: Automatic failover comes on with the Balanced profile. Click the Automatic failover line to choose another profile and the monitor IPs. The degradation thresholds are set later, on the page of the connection.

Bind VNet to Direct Connect dialog with the Backup peer section filled in and the Automatic failover options open

If the backup peer cannot be started when the connection is created, the connection still comes up with the primary only, and the Failover column shows Not configured. Add the backup again on the page of the connection.

Add an IPsec as the last level​

Under the peers, the IPsec failover section adds an IPsec VPN of the same VNet as the last level: if no Direct Connect peer answers, all the static routes go into the tunnel. Before saving, the platform runs a health test through the IPsec, and your router must be ready to send the replies back through it. The steps are in How to use an IPsec as the last level of failover.

Follow the failover​

The state shows in Failover order, in the Summary and in the Failover column of Active Connections.

StateWhat it means
ProtectedThe traffic is on the primary and the other paths are ready.
On backupThe traffic is on the backup peer, since the time shown.
On IPsecThe traffic is on the IPsec, since the time shown.
Primary recoveredThe traffic is still on the backup or on the IPsec, and the primary has been stable for the recovery time of the profile.
Backup recoveredThe traffic is still on the IPsec, and the backup peer has been stable for the recovery time of the profile.
Both peers downNeither peer answers and there is no IPsec; no switch is possible.
All paths downWith an IPsec configured: no path answers; no switch is possible.
PausedAutomatic failover is paused until the time shown, or until you resume it.
OffThe other paths are configured and monitored, but automatic failover is turned off.
Not configuredThe connection has no path besides the primary.

Under Peers, each peer card shows whether it is ACTIVE or STANDBY, its health (Up, Degraded, Down or Checking), the Avg latency, the Packet loss and the Last check, plus a line saying what is being pinged and from which address.

What happens on a failover​

The notices below show above the Active Connections table and at the top of the page of the connection.

  • The routes move to the backup and the state becomes On backup. A yellow notice says which peer is carrying the traffic and since when. When the primary is up again, the notice offers Switch to primary; otherwise it offers View details.

    Yellow notice about traffic on the backup above the table and the Failover column showing On backup

  • When the primary stays stable for the recovery time of the profile, the state becomes Primary recovered and a blue notice appears, with View history and Switch to primary. The traffic stays on the backup until you switch it.

    Primary recovered notice above the table, with the View history and Switch to primary buttons

  • If no path answers, the state becomes Both peers down (or All paths down) and a red notice offers Run health check.

When the traffic moves to the IPsec, the notice and what to check on your router are in What happens when the traffic goes to the IPsec.

Notices by bell and e-mail​

These events send a notice in the portal bell and an e-mail: an automatic failover, the primary recovered, the backup recovered (with the traffic on the IPsec), all paths down, and the connection back after all paths were down. Manual switches, pauses and setting changes do not send notices; they are in the history.

When all paths are down, the e-mail asks you to contact support if you haven't changed anything on this connection recently. The notice that the connection is back comes when the path that was carrying the traffic answers again. If another path comes back first and Automatic failover is on, the traffic moves to it and the notice you get is the failover one.

The notices go to the users of the VDC with customer-connect:direct_connect:view, customer-connect:view or network:view. Each e-mail comes in the language of the user, names the Direct Connect, the VNet and the VDC, shows the paths, the active one, the reason and the detection profile, and has a button to open the Direct Connect page. The titles are Traffic moved to the backup peer (or to the primary peer), Traffic moved to the IPsec VPN, Primary peer recovered, Backup peer recovered, Both peers are down (or All paths are down, with an IPsec), and The connection is back.

Switch paths manually​

  1. Choose where to start:

    • on the page of the connection, each standby card of Failover order has its own switch button (Switch to primary, Switch to backup, Switch to IPsec);
    • on the notices, the same action shows as Switch to primary or Switch to backup.
  2. The dialog shows where the traffic comes from and where it goes, each path with its health, and the static routes whose gateway will change.

    Switch to primary dialog, with the source peer, the target peer and the routes whose gateway will change

  3. Click Switch to primary (or the button of the path you chose).

A manual switch works even with automatic failover off or paused. When the target path is not Up, the dialog warns that the traffic may be interrupted or slow, and the button becomes Switch anyway. If you switch to a path that is down while automatic failover is on, the traffic goes to the most preferred healthy path automatically. If the traffic moves by itself while the dialog is open, the dialog says so and does not let you confirm: close it and check the current state.

Pause and resume automatic failover​

Use the pause during maintenance on your firewalls, so that a planned reboot does not move the traffic.

  1. On the page of the connection, click Pause failover, next to the state in Failover order.

  2. In Pause automatic failover, choose 1 hour, 4 hours, 24 hours or Until I resume. Each option shows when the failover resumes.

    Pause automatic failover dialog with the duration options

  3. Click Pause failover.

Monitoring continues and manual switches still work, but nothing switches on its own. The state shows Paused and a grey notice has the Resume button, and Failover order has Resume failover. A timed pause ends by itself.

To turn automatic failover off with no end time, turn off Automatic failover on the Failover tab and click Save Changes. The other paths stay configured and monitored, the state shows Off, and you can still switch paths manually.

History​

The History tab of the page of the connection keeps 90 days of events: automatic failovers, manual switches, paths going down, degrading and coming back up, recovered peers, pauses, resumes and setting changes. Filter them with All, Failovers, Manual switches, Peer health and Pause & settings, and click Load more to see older events. Each event shows when it happened, the addresses involved, the reason, and who did it (System for the automatic ones).

History tab with the list of events

The View history button of the notices opens this tab directly.

Test each path​

The Health Check tests the primary, the backup and the IPsec separately, and testing a standby path does not touch the traffic of the VMs. The Test buttons of Failover order open it with that path already chosen. See How to check the health of a Direct Connect connection.

Change addresses​

  • Primary peer: change its Remote IP under Peers. See How to change the remote IP of a Direct Connect connection.
  • Backup peer: the backup network, its Local IP (CIDR) and its Remote IP can only be changed while the traffic is not on the backup. Switch to another path first if needed.
  • Monitor IP, profile and thresholds can be changed at any time.

Remove the backup peer​

  1. If the traffic is on the backup, switch it to another path first. While the traffic is on the backup, the card shows Remove backup peer · switch traffic to the primary first instead of the button.

  2. On the Failover tab, under Peers, click Remove backup peer. Click again to confirm.

    Remove backup peer button asking for confirmation

Without an IPsec, this turns automatic failover off and the connection goes back to using only the primary. With an IPsec, the confirmation says Click again to remove the backup peer; the IPsec stays as failover, and the failover goes on with the primary and the IPsec. With Separate network, the platform also removes from the router the address it had added for the backup.