Home Explore Blog Models CI



docker

5th chunk of `content/manuals/engine/network/drivers/bridge.md`
e169831e4419155f84a30ff687a4302382c4cfbe0509131d000000010000097f
the `my-nginx` container from the `my-net` network.

```console
$ docker network disconnect my-net my-nginx
```

## Use IPv6 in a user-defined bridge network

When you create your network, you can specify the `--ipv6` flag to enable IPv6.

```console
$ docker network create --ipv6 --subnet 2001:db8:1234::/64 my-net
```

If you do not provide a `--subnet` option, a Unique Local Address (ULA) prefix
will be chosen automatically.

## IPv6-only bridge networks

To skip IPv4 address configuration on the bridge and in its containers, create
the network with option `--ipv4=false`, and enable IPv6 using `--ipv6`.

```console
$ docker network create --ipv6 --ipv4=false v6net
```

IPv4 address configuration cannot be disabled in the default bridge network.

## Use the default bridge network

The default `bridge` network is considered a legacy detail of Docker and is not
recommended for production use. Configuring it is a manual operation, and it has
[technical shortcomings](#differences-between-user-defined-bridges-and-the-default-bridge).

### Connect a container to the default bridge network

If you do not specify a network using the `--network` flag, and you do specify a
network driver, your container is connected to the default `bridge` network by
default. Containers connected to the default `bridge` network can communicate,
but only by IP address, unless they're linked using the
[legacy `--link` flag](../links.md).

### Configure the default bridge network

To configure the default `bridge` network, you specify options in `daemon.json`.
Here is an example `daemon.json` with several options specified. Only specify
the settings you need to customize.

```json
{
  "bip": "192.168.1.1/24",
  "fixed-cidr": "192.168.1.0/25",
  "mtu": 1500,
  "default-gateway": "192.168.1.254",
  "dns": ["10.20.1.2","10.20.1.3"]
}
```

In this example:

- The bridge's address is "192.168.1.1/24" (from `bip`).
- The bridge network's subnet is "192.168.1.0/24" (from `bip`).
- Container addresses will be allocated from "192.168.1.0/25" (from `fixed-cidr`).


### Use IPv6 with the default bridge network

IPv6 can be enabled for the default bridge using the following options in
`daemon.json`, or their command line equivalents.

These three options only affect the default bridge, they are not used by
user-defined networks. The addresses in below are examples from the
IPv6 documentation range.

- Option `ipv6` is required.

Title: Configuring IPv6 and Default Bridge Networks in Docker
Summary
This section describes how to use IPv6 in user-defined and default bridge networks in Docker. It includes disconnecting containers from user-defined bridges, enabling IPv6 for networks, creating IPv6-only networks, and configuring the default bridge network, which is not recommended for production use, including enabling IPv6 and setting network options via `daemon.json`. It highlights that containers connected to the default bridge communicate by IP address and that IPv6 options only affect the default bridge.