Skip to content

Commit 4112ce3

Browse files
authored
Merge pull request docker#10353 from arueth/master
[ee/ucp/admin/install/plan-installation] Adding additional information to the 'Avoid IP range conflicts' section
2 parents f6b590c + 017b955 commit 4112ce3

File tree

1 file changed

+123
-30
lines changed

1 file changed

+123
-30
lines changed

ee/ucp/admin/install/plan-installation.md

Lines changed: 123 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,62 +46,155 @@ this.
4646

4747
The following table lists recommendations to avoid IP range conflicts.
4848

49-
| Component | Subnet | Range | Default IP address |
50-
|------------|----------------------------|------------------------------------------|----------------|
51-
| Engine | `fixed-cidr` | CIDR range for `docker0` interface and local containers | 172.17.0.0/16 |
52-
| Engine | `default-address-pools` | CIDR range for `docker_gwbridge` interface and bridge networks | 172.18.0.0/16 |
53-
| Swarm | `default-addr-pool` | CIDR range for Swarm overlay networks | 10.0.0.0/8 |
54-
| Kubernetes | `pod-cidr` | CIDR range for Kubernetes pods | 192.168.0.0/16 |
55-
| Kubernetes | `service-cluster-ip-range` | CIDR range for Kubernetes services | 10.96.0.0/16 |
49+
| Component | Subnet | Range | Default IP address |
50+
| ---------- | -------------------------- | -------------------------------------------- | --------------------------------------------- |
51+
| Engine | `default-address-pools` | CIDR range for interface and bridge networks | 172.17.0.0/16 - 172.30.0.0/16, 192.168.0.0/16 |
52+
| Swarm | `default-addr-pool` | CIDR range for Swarm overlay networks | 10.0.0.0/8 |
53+
| Kubernetes | `pod-cidr` | CIDR range for Kubernetes pods | 192.168.0.0/16 |
54+
| Kubernetes | `service-cluster-ip-range` | CIDR range for Kubernetes services | 10.96.0.0/16 |
5655

5756
### Engine
5857

5958
There are two IP ranges used by the engine for the `docker0` and `docker_gwbridge` interface:
6059

60+
#### default-address-pools
61+
62+
`default-address-pools` defines a pool of CIDR ranges that are used to allocated subnets for local bridge networks. By default the first available subnet(`172.17.0.0/16`) is assigned to `docker0` and the next available subnet(`172.18.0.0/16`) is assigned to `docker_gwbridge`. Both the `docker0` and `docker_gwbridge` subnet can be modified by changing the `default-address-pools` value or as described in their individual sections below.
63+
64+
The default value for `default-address-pools` is:
65+
66+
```json
67+
{
68+
"default-address-pools": [
69+
{"base":"172.17.0.0/16","size":16}, <-- docker0
70+
{"base":"172.18.0.0/16","size":16}, <-- docker_gwbridge
71+
{"base":"172.19.0.0/16","size":16},
72+
{"base":"172.20.0.0/16","size":16},
73+
{"base":"172.21.0.0/16","size":16},
74+
{"base":"172.22.0.0/16","size":16},
75+
{"base":"172.23.0.0/16","size":16},
76+
{"base":"172.24.0.0/16","size":16},
77+
{"base":"172.25.0.0/16","size":16},
78+
{"base":"172.26.0.0/16","size":16},
79+
{"base":"172.27.0.0/16","size":16},
80+
{"base":"172.28.0.0/16","size":16},
81+
{"base":"172.29.0.0/16","size":16},
82+
{"base":"172.30.0.0/16","size":16},
83+
{"base":"192.168.0.0/16","size":20}
84+
]
85+
}
86+
```
87+
88+
`default-address-pools`: A list of IP address pools for local bridge networks. Each entry in the list contain the following:
89+
90+
`base`: CIDR range to be allocated for bridge networks.
91+
92+
`size`: CIDR netmask that determines the subnet size to allocate from the `base` pool
93+
94+
As an example, `{"base":"192.168.0.0/16","size":20}` will allocate `/20` subnets from `192.168.0.0/16` yielding the following subnets for bridge networks:\
95+
`192.168.0.0/20` (`192.168.0.0` - `192.168.15.255`)\
96+
`192.168.16.0/20` (`192.168.16.0` - `192.168.31.255`)\
97+
`192.168.32.0/20` (`192.168.32.0` - `192.168.47.255`)\
98+
`192.168.48.0/20` (`192.168.32.0` - `192.168.63.255`)\
99+
`192.168.64.0/20` (`192.168.64.0` - `192.168.79.255`)\
100+
...\
101+
`192.168.240.0/20` (`192.168.240.0` - `192.168.255.255`)
102+
103+
> Note
104+
>
105+
> If the `size` matches the netmask of the `base`, then that pool only containers one subnet.
106+
>
107+
> For example, `{"base":"172.17.0.0/16","size":16}` will only yield one subnet `172.17.0.0/16` (`172.17.0.0` - `172.17.255.255`).
108+
61109
#### docker0
62110

63-
By default, the Docker engine creates and configures the host system with a network interface called `docker0`, which is an ethernet bridge device. If you don't specify a different network when starting a container, the container is connected to the bridge and all traffic coming from and going to the container flows over the bridge to the Docker engine, which handles routing on behalf of the container.
111+
By default, the Docker engine creates and configures the host system with a virtual network interface called `docker0`, which is an ethernet bridge device. If you don't specify a different network when starting a container, the container is connected to the bridge and all traffic coming from and going to the container flows over the bridge to the Docker engine, which handles routing on behalf of the container.
112+
113+
Docker engine creates `docker0` with a configurable IP range. Containers which are connected to the default bridge are allocated IP addresses within this range. Certain default settings apply to `docker0` unless you specify otherwise. The default subnet for `docker0` is the first pool in `default-address-pools` which is `172.17.0.0/16`.
114+
115+
The recommended way to configure the `docker0` settings is to use the `daemon.json` file.
116+
117+
If only the subnet needs to be customized, it can be changed by modifying the first pool of `default-address-pools` in the `daemon.json` file.
118+
119+
```json
120+
{
121+
"default-address-pools": [
122+
{"base":"172.17.0.0/16","size":16}, <-- Modify this value
123+
{"base":"172.18.0.0/16","size":16},
124+
{"base":"172.19.0.0/16","size":16},
125+
{"base":"172.20.0.0/16","size":16},
126+
{"base":"172.21.0.0/16","size":16},
127+
{"base":"172.22.0.0/16","size":16},
128+
{"base":"172.23.0.0/16","size":16},
129+
{"base":"172.24.0.0/16","size":16},
130+
{"base":"172.25.0.0/16","size":16},
131+
{"base":"172.26.0.0/16","size":16},
132+
{"base":"172.27.0.0/16","size":16},
133+
{"base":"172.28.0.0/16","size":16},
134+
{"base":"172.29.0.0/16","size":16},
135+
{"base":"172.30.0.0/16","size":16},
136+
{"base":"192.168.0.0/16","size":20}
137+
]
138+
}
139+
```
64140

65-
Docker engine creates `docker0` with a configurable IP range. Containers which are connected to the default bridge are allocated IP addresses within this range. Certain default settings apply to `docker` unless you specify otherwise. The default subnet for `docker0` is `172.17.0.0/16`.
141+
> Note
142+
>
143+
> Modifying this value can also affect the `docker_gwbridge` if the `size` doesn't match the netmask of the `base`.
66144
67-
The recommended way to configure the `docker0` settings is to use the `daemon.json` file. You can specify one or more of the following settings to configure the `docker0` interface:
145+
To configure a CIDR range and not rely on `default-address-pools`, the `fixed-cidr` setting can used:
68146

69147
```json
70148
{
71-
"bip": "172.17.0.1/16",
72149
"fixed-cidr": "172.17.0.0/16",
73150
}
74151
```
75152

76-
`bip`: Supply a specific bridge IP range for the `docker0` interface, using standard CIDR notation. Default is `172.17.0.1/16`.
153+
`fixed-cidr`: Specify the subnet for `docker0`, using standard CIDR notation. Default is `172.17.0.0/16`, the network gateway will be `172.17.0.1` and IPs for your containers will be allocated from (`172.17.0.2` - `172.17.255.254`).
154+
155+
To configure a gateway IP and CIDR range while not relying on `default-address-pools`, the `bip` setting can used:
156+
157+
```json
158+
{
159+
"bip": "172.17.0.1/16",
160+
}
161+
```
77162

78-
`fixed-cidr`: Restrict the IP range for `docker0`, using standard CIDR notation. Default is `172.17.0.0/16`.
79-
This range must be an IPv4 range for fixed IPs, and must be a subset of the bridge IP range (`bip` in `daemon.json`). For example, with `172.17.0.0/17`, IPs for your containers will be chosen from the first half of addresses(`172.17.0.1` - `172.17.127.254`) included in the `bip`(`172.17.0.0/16`) subnet.
163+
`bip`: Specific a gateway IP address and CIDR netmask of the `docker0` network. The notation is `<gateway IP>/<CIDR netmask>` and the default is `172.17.0.1/16` which will make the `docker0` network gateway `172.17.0.1` and subnet `172.17.0.0/16`.
80164

81165
#### docker_gwbridge
82166

83-
The `docker_gwbridge` is a virtual bridge that connects the overlay networks (including the `ingress` network) to an individual Docker engine's physical network. Docker creates it automatically when you initialize a swarm or join a Docker host to a swarm, but it is not a Docker device. It exists in the kernel of the Docker host. The default subnet for `docker_gwbridge` is `172.18.0.0/16`.
167+
The `docker_gwbridge` is a virtual network interface that connects the overlay networks (including the `ingress` network) to an individual Docker engine's physical network. Docker creates it automatically when you initialize a swarm or join a Docker host to a swarm, but it is not a Docker device. It exists in the kernel of the Docker host. The default subnet for `docker_gwbridge` is the next available subnet in `default-address-pools` which with defaults is `172.18.0.0/16`.
84168

85-
> Note
86-
>
87-
> If you need to customize the `docker_gwbridge` settings, you must do so before joining the host to the swarm, or after temporarily removing the host from the swarm.
169+
> Note
170+
>
171+
> If you need to customize the `docker_gwbridge` settings, you must do so before joining the host to the swarm, or after temporarily removing the host from the swarm.
88172
89-
The recommended way to configure the `docker_gwbridge` settings is to use the `daemon.json` file. You can specify one or more of the following settings to configure the interface:
173+
The recommended way to configure the `docker_gwbridge` settings is to use the `daemon.json` file.
90174

91-
```json
175+
For `docker_gwbridge`, the second available subnet will be allocated from `default-address-pools`. If any customizations where made to the `docker0` interface it could affect which subnet is allocated. With the default `default-address-pools` settings you would modify the second pool.
176+
177+
```json
92178
{
93179
"default-address-pools": [
94-
{"base":"172.18.0.0/16","size":24},
95-
{"base":"###.###.###.###/##","size":##}
180+
{"base":"172.17.0.0/16","size":16},
181+
{"base":"172.18.0.0/16","size":16}, <-- Modify this value
182+
{"base":"172.19.0.0/16","size":16},
183+
{"base":"172.20.0.0/16","size":16},
184+
{"base":"172.21.0.0/16","size":16},
185+
{"base":"172.22.0.0/16","size":16},
186+
{"base":"172.23.0.0/16","size":16},
187+
{"base":"172.24.0.0/16","size":16},
188+
{"base":"172.25.0.0/16","size":16},
189+
{"base":"172.26.0.0/16","size":16},
190+
{"base":"172.27.0.0/16","size":16},
191+
{"base":"172.28.0.0/16","size":16},
192+
{"base":"172.29.0.0/16","size":16},
193+
{"base":"172.30.0.0/16","size":16},
194+
{"base":"192.168.0.0/16","size":20}
96195
]
97196
}
98-
```
99-
100-
`default-address-pools`: A list of IP address pools for local bridge networks, the default is a single pool `{"base":"172.18.0.0/16","size":24}`. This allocates `/24` network from the `172.18.0.0/16` CIDR range for local bridge networks. Each entry in the list contain the following:
101-
102-
`base`: CIDR range to be divided up for bridge networks, the default is `172.18.0.0/16`
103-
104-
`size`: CIDR netmask that determines the default network size to allocate from the `base` pool, the default is `24`
197+
```
105198

106199
### Swarm
107200

@@ -112,7 +205,7 @@ Swarm uses a default address pool of `10.0.0.0/8` for its overlay networks. If t
112205
> The Swarm `default-addr-pool` setting is separate from the Docker engine `default-address-pools` setting. They are two separate ranges that are used for different purposes.
113206
114207
> Note
115-
>
208+
>
116209
> Currently, the UCP installation process does not support this flag. To deploy with a custom IP pool, Swarm must first be initialized using this flag and UCP must be installed on top of it.
117210
118211
### Kubernetes

0 commit comments

Comments
 (0)