sof
sof

Reputation: 9649

How to change docker default ip binding?

When Docker starts, it creates a virtual interface docker0 and binds it to private subnet 172.17.42.1/16. How to change this default to another ip block e.g. 192.168.42.1/24?

Upvotes: 0

Views: 422

Answers (1)

nitishagar
nitishagar

Reputation: 9403

It does not always assign 172.17.42.1/16, normally it chooses from a private range defined by RFC 1918 that are not in use on the host machine.

For changing it to a desired value you can use the following option:

--bip=CIDR — supply a specific IP address and netmask for the docker0 like "--bip=192.168.42.1/8"

More information can be seen for this on Advanced Networking with Docker.

Upvotes: 3

Related Questions