How Do I Control Which IP Addresses are Used By Docker and AC-Hunter?

Here’s how to control the networks Docker assigns to the containers used by AC-Hunter and other tools.

First, stop the Docker daemon.

sudo systemctl stop docker

Next, make a backup of your current Docker daemon configuration file.

sudo cp /etc/docker/daemon.json /etc/docker/daemon.json.bak

If the file does not exist, please create it as root. Then, open /etc/docker/daemon.json in your preferred text editor.

To change how Docker allocates networks to containers, edit the “default-address-pools” configuration. By default, Docker allocates /24 subnets from the following networks:

  • 172.80.0.0/16
  • 172.90.0.0/16

For example, to tell the Docker daemon to allocate /24 networks out of 10.100.0.0/16 , delete the default “default-address-pools” configuration if it exists and add the following to the file:

{
  "default-address-pools": [
    {
      "base": "10.100.0.0/16",
      "size": 24
    },
  ],
}

Finally, restart the Docker daemon.

sudo systemctl start docker

For more information, please see the official Docker documentation at https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file

 

Direct Link to this FAQ Item: https://portal.activecountermeasures.com/support/faq/?Display_FAQ=3350

Category: Server Configurations & Functionality
Tags: