Change the default network segment docker

# This document is intended to illustrate the points to note when creating a docker:
We use the LAN Docker, a confused most frequently encountered is sometimes the result of inter-network network appear unreasonable.
The reason is because the Docker generated by default gateway and LAN segment we sometimes are in conflict, such as the deployment of 172.16 Docker on the network of machines, the results generated docker0 bridge is 172.17 network segment, and then use the real environment network of machines conflict (ie 172.17 ping nowhere network of machines).
To avoid conflicts, the first thought is to change the gateway, the default 172.17 network segment.

1, the premise is already installed docker environment
can edit /etc/docker/daemon.json file, add content "bip": "ip / netmask " [ not with the host network segment]

{"bip":"192.168.0.1/16"}

2, restart the docker services

service docker restart

docker0 bridge information ifconfig view the modified

Guess you like

Origin www.cnblogs.com/dadonggg/p/11080548.html