IPv6 Prefix Failover
Scenario
Section titled “Scenario”Let’s say we have a single web server with addresses from two IPv6 prefixes:
- Primary prefix:
2001:db8:cafe:/64with upstream routerupstream1.example.com - Secondary prefix:
2001:db8:feed/64with upstream routerupstream1.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).
How-To
Section titled “How-To”- Create a Plain resource records with an
AAAArecord type - Choose a Bitmask function kind with the following settings:
| Parameter | Value |
|---|---|
| Operation | or |
| Masks | Conditional that healthchecks upstream1, returning 2001:db8:cafe:: if it’s up, and 2001:db8:feed:: if not |
| Inner | Constant 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.
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.