You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| 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 |
56
55
57
56
### Engine
58
57
59
58
There are two IP ranges used by the engine for the `docker0` and `docker_gwbridge` interface:
60
59
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.
`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:\
> 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
+
61
109
#### docker0
62
110
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
+
```
64
140
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`.
66
144
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:
68
146
69
147
```json
70
148
{
71
-
"bip": "172.17.0.1/16",
72
149
"fixed-cidr": "172.17.0.0/16",
73
150
}
74
151
```
75
152
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
+
```
77
162
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`.
80
164
81
165
#### docker_gwbridge
82
166
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`.
84
168
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.
88
172
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.
90
174
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
92
178
{
93
179
"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}
96
195
]
97
196
}
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
+
```
105
198
106
199
### Swarm
107
200
@@ -112,7 +205,7 @@ Swarm uses a default address pool of `10.0.0.0/8` for its overlay networks. If t
112
205
> 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.
113
206
114
207
> Note
115
-
>
208
+
>
116
209
> 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.
0 commit comments