How to configure IP range for docker container in /etc/aziot/config.toml file

Nayan Khant 5 Reputation points
2023-11-30T16:21:22.2233333+00:00

Hi,

In IoT Edge device, I want to configure the IP range for all docker containers manage by IoT Edge Runtime (v1.4.20).

IoT Edge Runtime creates docker network with name "azure-iot-edge" and provide the default IP range like 172.19.0.0/16. But I need to change it to 192.168.0.0/16 range as it is conflicting with other network range.

This link explains the configuration in YAML file, but latest IoT Edge Runtime uses toml config and I did not able to find an option TOML configuration.

Many thanks in advance!

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
547 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Adrian Buenter 10 Reputation points
    2023-12-11T12:22:40.63+00:00

    We defined in the file /etc/docker/daemon.json our own default-address-pool like below:

    "default-address-pools": [
      {
        "base": "172.17.17.0/24",
        "size": 28
      }
    ]
    

    Then the "azure-iot-edge" network got the next pool from the default address pool (docker network inspect azure-iot-edge):

    "Name": "azure-iot-edge",
    "Scope": "local",
    "Driver": "bridge",
    "EnableIPv6": false,
    "IPAM": {
      "Driver": "default",
      "Options": null,
      "Config": [
        {
          "Subnet": "172.17.17.16/28",
          "Gateway": "172.17.17.17"
        }
      ]
    },
    

    There might also be another option: create your own network within docker and refer to it in the /etc/aziot/config.toml file as below:

    [moby_runtime]
    uri = "unix:///var/run/docker.sock"
    network = "<your-docker-network>"
    
    2 people found this answer helpful.
    0 comments No comments