---
title: "IPv6"
description: "Load balancers that answer on IPv6, on both IPv4 and IPv6, or on IPv6 only, with allowed sources for each family."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IPv6

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](/private-networks/network-gateways), 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` |

```sh
ezgh lb load-balancers create edge --subnet sbn_2m9x0a7qpe4k --ipv6 --wait
```

In the API, [CreateLoadBalancer](/lb-api/CreateLoadBalancer/) takes `ipv6` and an optional
`ipv4Address`:

- `ipv6` left out: IPv6 when the subnet has a `::/0` route to its Network Gateway, or when there's no
  `ipv4Address`. 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 `::/0` route (`409 subnet_has_no_gateway_route` otherwise), and
  the create fails with `409 ipv6_unavailable` if IPv6 can't be given.
- `ipv6: false` needs an `ipv4Address`.

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:

```sh
ezgh lb load-balancers update lbr_4k2m9x0a7qpe --ipv6
ezgh lb load-balancers update lbr_4k2m9x0a7qpe --no-ipv6
```

In 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](/lb-api/UpdateLoadBalancer/).

- Turning it on gives the load balancer an IPv6 address. `ipv6Address` shows it once it's assigned,
  and it answers there once `lastChange` is `applied`. If it can't be turned on, `ipv6` goes back to
  `false` and `lastChange` says 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 is `409 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](/load-balancers/target-groups#what-a-target-sees) 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](/load-balancers/firewalls).

Source: https://docs.ezghcloud.com/load-balancers/ipv6/index.mdx
