Skip to content

Commit 6ec12e0

Browse files
committed
Engine: document com.docker.network.host_ipv4 / host_ipv6
Signed-off-by: Rob Murray <[email protected]>
1 parent b0e9607 commit 6ec12e0

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

content/manuals/engine/network/drivers/bridge.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ The following table describes the driver-specific options that you can pass to
118118
|-------------------------------------------------------------------------------------------------|-----------------------------|-----------------------------------------------------------------------------------------------------|
119119
| `com.docker.network.bridge.name` | | Interface name to use when creating the Linux bridge. |
120120
| `com.docker.network.bridge.enable_ip_masquerade` | `true` | Enable IP masquerading. |
121+
| `com.docker.network.host_ipv4`<br/>`com.docker.network.host_ipv6` | | Address to use for source NAT. See [Packet filtering and firewalls](packet-filtering-firewalls.md). |
121122
| `com.docker.network.bridge.gateway_mode_ipv4`<br/>`com.docker.network.bridge.gateway_mode_ipv6` | `nat` | Control external connectivity. See [Packet filtering and firewalls](packet-filtering-firewalls.md). |
122123
| `com.docker.network.bridge.enable_icc` | `true` | Enable or Disable inter-container connectivity. |
123124
| `com.docker.network.bridge.host_binding_ipv4` | all IPv4 and IPv6 addresses | Default IP when binding container ports. |

content/manuals/engine/network/port-publishing.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,28 @@ For example:
289289
> Changing the default bind address doesn't have any effect on Swarm services.
290290
> Swarm services are always exposed on the `0.0.0.0` network interface.
291291
292+
### Masquerade or SNAT for outgoing packets
293+
294+
By default, if NAT is enabled for a bridge network, outgoing packets from
295+
containers are masqueraded. This means the source address of packets
296+
leaving the Docker host is changed to an address on the host interface
297+
the packet is sent on.
298+
299+
Masquerading can be disabled for a user-defined bridge network by using
300+
the `com.docker.network.bridge.enable_ip_masquerade` driver option when
301+
creating the network. For example:
302+
```console
303+
$ docker network create mybridge \
304+
-o com.docker.network.bridge.enable_ip_masquerade=false ...
305+
```
306+
307+
To use a specific source address for outgoing packets for a user-defined
308+
network, instead of letting masquerading select an address, use options
309+
`com.docker.network.host_ipv4` and `com.docker.network.host_ipv6` to
310+
specify the Source NAT (SNAT) address to use. The
311+
`com.docker.network.bridge.enable_ip_masquerade` option must
312+
be `true`, the default, for these options to have any effect.
313+
292314
### Default bridge
293315

294316
To set the default binding for the default bridge network, configure the `"ip"`

0 commit comments

Comments
 (0)