linux – Change default address used by Docker (172.17.0.1)

Question:

I would like to change (or remove) the 172.17.0.1 address used by the docker networks, is there a way to do this?

I use docker for php development and I have a remote repository (git) configured through a VPN using the 172.17.XX IP range

Whenever my containers are up, the docker network uses this IP range and I am unable to make any requests to the remote repository.

Thanks.

NOTE: I use a Linux environment (Mint 19)


I managed to solve my problem by defining a subnet on the network used by my containers in the docker-compose.yml file. In this way:

networks:
  frontend:
    driver: bridge
    ipam:
      config:
        - subnet: 172.18.0.0/16
  backend:
    driver: bridge
    ipam:
      config:
        - subnet: 172.19.0.0/16

Answer:

Docker's default network ( bridge ) settings can be changed by editing the daemon.json file in the /etc/docker/ . Here is an example of the daemon.json file:

 {
  "bip": "192.168.1.5/24",
  "fixed-cidr": "192.168.1.5/25",
  "fixed-cidr-v6": "2001:db8::/64",
  "mtu": 1500,
  "default-gateway": "10.20.1.1",
  "default-gateway-v6": "2001:db8:abcd::89",
  "dns": ["10.20.1.2","10.20.1.3"]
}

One option would be to set up a new network, using docker network create ...

In the documentation you can see more information, about available network drivers , how to set up a new network, and how to change the default bridge settings .

Scroll to Top