VMmanager Knowledge Base

How to change the network used by Docker?

By default, Docker virtualization system uses 172.17.0.0/16 networks for its operation. If your equipment uses addresses from these networks, you can change the Docker settings. This will prevent possible network conflicts.

Performing actions from this article requires stopping the platform and rebooting the server with VMmanager.

Viewing the information about the networks used

To find out which networks are used by Docker:

  1. Request the list of networks:

    docker network list
    An example of response
    NETWORK ID     NAME            DRIVER    SCOPE
    d6d21035109b   bridge          bridge    local
    5ce30744fbb4   host            host      local
    d20b27b805a0   none            null      local
    21e7a8920b7f   vm_vm_box_net   bridge    local

     In the response to the command, the NAME column will show the names of the networks used.

  2. For each network request the information about the address space used:

    docker network inspect <network_name> | grep Subnet
    
    Comments to the command

Changing the network for Docker

To change the settings of networks used by Docker:

  1. Edit or create the /etc/docker/daemon.json file:

    An example of file
    {
    	"live-restore": true,
    	"bip": "10.10.0.1/16",
    	"default-address-pools": [{
    		"base": "10.0.0.0/8",
    		"size": 16
    	}]
    }
    Comments to the file format
  2.  Delete all running docker containers:

    docker rm -f `docker ps -q -a`
  3. Delete all unused Docker objects:

    docker system prune
    docker network prune
  4. Restart the Docker service: 

    systemctl restart docker
  5. Run VMmanager:

    vm start
  6. Reboot the server with VMmanager:

    reboot
  7. For each network request the information about the address space used:

    docker network inspect <network_name> | grep Subnet
    Comments to the command