1

I have a question regarding IPv6 and Swarm.
While I know Docker Swarm don't support IPv6 overlay networks, I was wondering if there was a way to access IPv6-only (no dual-stack so no IPv4 here) from a Docker Swarm cluster.

I a simple cluster with 3 nodes on a dual-stack network, and a secondary interface on an IPv6-only network (can't touch that one, so IPv4 is not an option there).

I tried to setup MacVlan and IpVlan without any luck. Docker compose won't allow me to use any IPv6 related parameters, and if I try to create the network directly on one of the host the IPv6-related parameters seems to disappear (but only when using scope=swarm):

> docker network create --driver macvlan --ipv6 --subnet fd2b:a315:a66f:75e7::/64 --attachable storagenet
> docker inspect storagenet
[
    {
        "Name": "storagenet",
        "Id": "acde8763026c8b83319f542bf056b1ae3aac1a1dda2918929f296ef83a86cc87",
        "Created": "2019-06-20T22:21:01.66099475+02:00",
        "Scope": "local",
        "Driver": "macvlan",
        "EnableIPv6": true,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "192.168.96.0/20",
                    "Gateway": "192.168.96.1"
                },
                {
                    "Subnet": "fd2b:a315:a66f:75e7::/64"
                }
            ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {},
        "Labels": {}
    }
]

> docker network rm storagenet
> docker network create --driver macvlan --scope=swarm --ipv6 --subnet fd2b:a315:a66f:75e7::/64 --attachable storagenet
> docker inspect storagenet
[
    {
        "Name": "storagenet",
        "Id": "zljkxaebgc54l9l8dbav6oz4k",
        "Created": "2019-06-20T20:22:18.596857196Z",
        "Scope": "swarm",
        "Driver": "macvlan",
        "EnableIPv6": true,
        "IPAM": {
            "Driver": "",
            "Options": null,
            "Config": []
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": null,
        "Options": null,
        "Labels": null
    }
]

Every container I'll try to attach to this network will throw me an error about not finding any IPv6 address to lease (which is expected since the subnet is not set).

Do you know any way to access an IPv6-only network from the container itself ?

Thanks a lot

Hakujou
  • 51
  • 1
  • 5

0 Answers0