Files
weave/site/weave-docker-api/ipam-proxy.md
T
Ilya Dmitrichenko 293f1990bc Consisten spacing in Markdown headings
Jekyll doesn't tolerate this, and it's generally cosidered a cleaner
style, we've had a bit of mixed style and this makes it consistent.
2017-04-10 12:19:29 +01:00

1.5 KiB

title, menu_order
title menu_order
Automatic IP Allocation and the Weave Proxy 25

If automatic IP address allocation is enabled in Weave Net (by default IPAM is enabled), then containers started via the proxy are automatically assigned an IP address, without having to specify any special environment variables or any other options.

host1$ docker run -ti weaveworks/ubuntu

To use a specific subnet, you can pass a WEAVE_CIDR to the container, for example:

host1$ docker run -ti -e WEAVE_CIDR=net:10.32.2.0/24 weaveworks/ubuntu

To start a container without connecting it to the Weave network, pass WEAVE_CIDR=none, for example:

host1$ docker run -ti -e WEAVE_CIDR=none weaveworks/ubuntu

Disabling Automatic IP Address Allocation

If you do not want an IP to be assigned by default, the proxy needs to be passed the --no-default-ipalloc flag, for example:

host1$ weave launch-proxy --no-default-ipalloc

In this configuration, containers using no WEAVE_CIDR environment variable are not connected to the Weave network.

Containers started with a WEAVE_CIDR environment variable are handled as before. To automatically assign an address in this mode, start the container with a blank WEAVE_CIDR, for example:

host1$ docker run -ti -e WEAVE_CIDR="" weaveworks/ubuntu

See Also