A load balancer can answer on IPv4, on IPv6, or on both. A new load balancer answers on IPv6 too when
its subnet has a ::/0 route to the Network Gateway, unless you turn IPv6 off. On IPv6 a load
balancer has one public address, which ipv6Address shows. Clients connect to it as they do to the
IPv4 one, and every listener serves both.
Before you start
On IPv6, a load balancer’s subnet needs a ::/0 route to the VPC’s
Network Gateway, beside the 0.0.0.0/0 route IPv4 needs.
Your targets don’t need IPv6. A load balancer reaches them on their private IPv4 addresses, whatever family the client used.
Create one
| You want | Console | CLI |
|---|---|---|
| IPv4 and IPv6 | Choose an IPv4 address, leave IPv6 on | --ipv4-address pip_…, or with --ipv6 to require IPv6 |
| IPv4 only | Choose an IPv4 address, turn IPv6 off | --ipv4-address pip_… --no-ipv6 |
| IPv6 only | Leave IPv6 on, then choose None: IPv6 only as the IPv4 address | --ipv6, without --ipv4-address |
ezgh lb load-balancers create edge --subnet sbn_2m9x0a7qpe4k --ipv6 --waitIn the API, CreateLoadBalancer takes ipv6 and an optional
ipv4Address:
ipv6left out: IPv6 when the subnet has a::/0route to its Network Gateway, or when there’s noipv4Address. If IPv6 can’t be given to a load balancer that has an IPv4 address, it’s made with IPv4 only.ipv6: true: the subnet needs the::/0route (409 subnet_has_no_gateway_routeotherwise), and the create fails with409 ipv6_unavailableif IPv6 can’t be given.ipv6: falseneeds anipv4Address.
An IPv6-only load balancer’s ipv4Address is null. If your code reads load balancers with a strict
schema, let it be null.
Turn IPv6 on or off
On an active load balancer:
ezgh lb load-balancers update lbr_4k2m9x0a7qpe --ipv6
ezgh lb load-balancers update lbr_4k2m9x0a7qpe --no-ipv6In the console, open the load balancer and choose Turn on IPv6 or Turn off IPv6. In the API,
send {"ipv6": true} or {"ipv6": false} to UpdateLoadBalancer.
- Turning it on gives the load balancer an IPv6 address.
ipv6Addressshows it once it’s assigned, and it answers there oncelastChangeisapplied. If it can’t be turned on,ipv6goes back tofalseandlastChangesays why. - Turning it off stops new IPv6 connections. Open ones get each listener’s idle timeout to finish, then it stops answering on IPv6. IPv4 isn’t touched.
- Turning IPv6 off again and back on gives the same address back.
- A load balancer with no IPv4 address can’t turn IPv6 off.
- While it’s
provisioning, a change to IPv6 is409 load_balancer_provisioning.
Load balancers made before IPv6 was available answer on IPv4 only until you turn IPv6 on.
Allowed sources
A listener’s allowedSourceCidrs holds IPv4 and IPv6 ranges in one list. Each family admits only the
clients its own ranges cover:
["0.0.0.0/0", "::/0"]admits everyone, on both families. It’s the default for a new listener.["203.0.113.0/24"]admits that IPv4 range, and no IPv6 client at all. A list with no IPv6 range never lets IPv6 clients in.["2001:db8::/32"]admits that IPv6 range and no IPv4 client.
Listeners whose list was exactly ["0.0.0.0/0"] when IPv6 became available got "::/0" added, since
that list meant everyone. Any other list is as you left it: add IPv6 ranges to admit IPv6 clients.
At most 20 ranges across both families.
PROXY protocol
With PROXY protocol v2 on, a target gets each client’s own address, which is an IPv6 address for a client that connected over IPv6. A target that reads PROXY protocol must accept IPv6 addresses in its header, even though the connection itself reaches the target over IPv4.
Firewalls
A rule whose peer is the load balancer admits it whatever family the client used, since the load balancer always reaches targets on IPv4. See Firewalls.