Skip to content

Commit 3154a93

Browse files
authored
Merge pull request docker#7776 from WeJie/patch-2
Get some miss content back from commit history
2 parents 401b865 + d63986a commit 3154a93

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

engine/swarm/swarm-mode.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,32 +70,37 @@ network that does not have a subnet specified will have a subnet sequentially al
7070
some circumstances it may be desirable to use a different default IP address pool for networks.
7171

7272
For example, if the default `10.0.0.0/8` range conflicts with already allocated address space in your network,
73-
then it is desireable to ensure that networks use a different range without requiring Swarm users to specify
73+
then it is desirable to ensure that networks use a different range without requiring Swarm users to specify
7474
each subnet with the `--subnet` command.
7575

7676
To configure custom default address pools, you must define pools at Swarm initialization using the
7777
`--default-addr-pool` command line option. This command line option uses CIDR notation for defining the subnet mask.
7878
To create the custom address pool for Swarm, you must define at least one default address pool, and an optional default address pool subnet mask. For example, for the `10.0.0.0/27`, use the value `27`.
7979

80-
Docker allocates subnet addresses from the address ranges specified by the `--default-addr-pool` command line option. For example, a command line option `--default-addr-pool 10.10.0.0/16` indicates that Docker will allocate subnets from that `/16` address range. If `--default-addr-pool-mask-len` were unspecified or set explicitly to 24, this would result in 256 `/24` networks of the form `10.10.X.0/24`.
81-
=======
82-
By default Docker Swarm uses a default address pool `10.0.0.0/8` for global scope (overlay) networks. Every network that does not have a subnet specified will have a subnet sequentially allocated from this pool. In some circumstances it may be desireable to use a different default IP address pool for networks. For example, if the default `10.0.0.0/8` range conflicts with already allocated address space in your network then it is desireable to ensure that networks use a different range without requiring Swarm users to specify each subnet with the `--subnet` command.
80+
Docker allocates subnet addresses from the address ranges specified by the `--default-addr-pool` option. For example, a command line option `--default-addr-pool 10.10.0.0/16` indicates that Docker will allocate subnets from that `/16` address range. If `--default-addr-pool-mask-len` were unspecified or set explicitly to 24, this would result in 256 `/24` networks of the form `10.10.X.0/24`.
8381

84-
To configure custom default address pools, you must define pools at Swarm initialization using the `--default-addr-pool` flag. To create the custom address pool for Swarm, you must define at least one default address pool, and an optional default address pool subnet mask. The default address pool uses CIDR notation.
82+
The subnet range comes from the `--default-addr-pool`, (such as `10.10.0.0/16`). The size of 16 there represents the number of networks one can create within that `default-addr-pool` range. The `--default-address-pool` option may occur multiple times with each option providing additional addresses for docker to use for overlay subnets.
8583

86-
Docker allocates subnet addresses from the address ranges specified by the --default-addr-pool options. For example, a command line option `--default-addr-pool 10.10.0.0/16` indicates that Docker will allocate subnets from that `/16` address range. If `--default-addr-pool-mask-len` were unspecified or set explicitly to 24, this would result in 256 `/24` networks of the form `10.10.X.0/24`.
84+
The format of the command is:
85+
```
86+
$ docker swarm init --default-address-pool <IP range in CIDR> [--default-address-pool <IP range in CIDR> --default-addr-pool-mask-length <CIDR value>]
87+
```
88+
To create a default IP address pool with a /16 (class B) for the 10.20.0.0 network looks like this:
89+
90+
```
91+
$ docker swarm init --default-addr-pool 10.20.0.0/16
92+
```
8793

8894
To create a default IP address pool with a `/16` (class B) for the `10.20.0.0` and `10.30.0.0` networks, and to
8995
create a subnet mask of `/26` for each network looks like this:
90-
=======
91-
To create a default IP address pool with a /16 (class B) for the 10.20.0.0 and 10.30.0.0 networks, and to create a subnet mask of /26 for each network looks like this:
9296

97+
```
98+
$ docker swarm init --default-addr-pool 10.20.0.0/16 --default-addr-pool 10.30.0.0/16 --default-addr-pool-mask-length 26
99+
```
93100

94-
In this example, `docker network create -d overlay net1` produces `10.20.0.0/26` as the allocated subnet for `net1`,
95-
and `docker network create -d overlay net2` produces `10.20.0.64/26` as the allocated subnet for `net2`. This continues until
101+
In this example, `docker network create -d overlay net1` will result in `10.20.0.0/26` as the allocated subnet for `net1`,
102+
and `docker network create -d overlay net2` will result in `10.20.0.64/26` as the allocated subnet for `net2`. This continues until
96103
all the subnets are exhausted.
97-
=======
98-
In this example, `docker network create -d overlay net1` will result in `10.20.0.0/26` as the allocated subnet for `net1`, and `docker network create -d overlay net2` will result in `10.20.0.64/26` as the allocated subnet for `net2`. This continues until all the subnets are exhausted.
99104

100105
Refer to the following pages for more information:
101106
- [Swarm networking](./networking.md) for more information about the default address pool usage

0 commit comments

Comments
 (0)