Skip to content

IPv6 Prefix Failover

Let’s say we have a single web server with addresses from two IPv6 prefixes:

  • Primary prefix: 2001:db8:cafe:/64 with upstream router upstream1.example.com
  • Secondary prefix: 2001:db8:feed/64 with upstream router upstream1.example.com

The addresses it self-assigns from those prefixes are 2001:db8:cafe::80 and 2001:db8:feed::80 respectively.

The secondary address should only be used if upstream connectivity for the primary prefix is lost (i.e. if the primary prefix’s upstream router is unreachable).

Diagram
  1. Create a Plain resource records with an AAAA record type
  2. Choose a Bitmask function kind with the following settings:
ParameterValue
Operationor
MasksConditional that healthchecks upstream1, returning 2001:db8:cafe:: if it’s up, and 2001:db8:feed:: if not
InnerConstant returning ::80

Rather than have the Bitmask’s Masks parameter be a Conditional with simple Constant functions, have it change to yet a third prefix (2001:db8:dead::) if both upstream1 and upstream2 are down.

Diagram

To do this, set the Conditional’s If False parameter to another Conditional that healthchecks upstream2 and returns 2001:db8:dead:: if the healthcheck fails.