Docker stuck in IPv4


Recommended Posts

I have an issue that docker doesn't have IPv6, this is one of my containers

 

# docker inspect 433692b3e691 | grep -i IPv6Gateway
            "IPv6Gateway": "",
                    "IPv6Gateway": "",
 

Looking at my docker networks, I see:

 

# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
224d0c66e092        bridge              bridge              local
bb9929d48bc0        host                host                local
19eea3a1aa0b        none                null                local

 

THE BRIDGE

# docker inspect  224d0c66e092 | grep -i IPv6
        "EnableIPv6": false,
                "IPv6Address": ""
                "IPv6Address": ""
                "IPv6Address": ""
                "IPv6Address": ""
 

THE HOST

# docker inspect bb9929d48bc0 | grep -i IPv6
        "EnableIPv6": false,
                "IPv6Address": ""
                "IPv6Address": ""
                "IPv6Address": ""

 

However on the GUI and the command line, the bridge is enabled and has IPv4+IPv6 and the tower itself has an IPv6 address

image.png.084c2d45e1795c3d2c05a7c3aba20dc6.png

 

image.thumb.png.fb18431cdebbfe93e09cbcc3e74930ae.png

 

 

Any help enabling docker to have IPv6 instead of "EnableIPv6": false will be appreciated

Link to comment

Thank you for your response, can you point me to a guide on how to set up macvlan on unraid.

 

Is it as simple as the one mentioned here?

 

For example:

$ docker network create -d macvlan \

--subnet=192.168.216.0/24 --subnet=192.168.218.0/24 \

--gateway=192.168.216.1 --gateway=192.168.218.1 \

--subnet=2001:db8:abc8::/64 --gateway=2001:db8:abc8::10 \

-o parent=eth0.218 \ -o macvlan_mode=bridge macvlan216

Edited by phoenixcoder
Link to comment

I had some success but ran into a different issue

 

Could not find a way to create the macvlan in the gui so I ran a slightly different version than the command above which is:

docker network create -d macvlan \
    --ipv6 \
    --subnet=192.168.11.0/24 \
    --subnet=2002:c0a8:0b00::/48 \
    --gateway=192.168.11.1 \
    -o parent=br0 \
    --ip-range 192.168.11.5/27 \
    -o macvlan_mode=bridge macvlan

 

The reason is my local LAN range is 192.168.11.0/24 and the gateway is 192.168.11.1. Since my DHCP server assigns IPs from 192.168.11.100 to 192.168.11.149 and since I didn't want any IP collisions with the docker network, I went with ip-range 192.168.11.5/27 which has a Start IP of 192.168.11.0 and End IP of 192.168.11.31

 

When I assign the docker containers that macvlan network, it works and the docker containers surprisingly have perfect IPv4 and IPv6, that also pass the IPv6 test at https://test-ipv6.com/

 

The Problem:

 

If I reboot the unraid, I lose the above network and have to re-run the command above and re-assign the docker containers that macvlan network

 

If there a way to make it persistent?

 

Thanks

Link to comment
2 minutes ago, bonienl said:

Use the GUI, see Settings --> Docker Settings.

 

With the Docker service disabled and in advanced view, you can assign the networks.

 

Tried that, all I see is this:

image.thumb.png.05ecd004e04a8662606200a5bc420267.png

 

The IPv4 looks fine but no way to bridge that network (macvlan) to IPv6

 

There is no way to add a network and even with those IPv4 and IPv6 selected, I only have bridge, host, none in my drop down for docker containers as seen below

 

image.thumb.png.294877b2fe08afdd79d9ff6be4706942.png

 

And per your original reply "Host and Bridge networks use IPv4 only."

 

There is something missing

Link to comment
5 minutes ago, bonienl said:

Disable the IPv6 DHCP pool.

Wow! I totally did not expect that would work

# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
6e05b4103d51        br0                 macvlan             local
4619d293ec0b        bridge              bridge              local
bb9929d48bc0        host                host                local
19eea3a1aa0b        none                null                local
 

image.png.7ce744dc037e384b3c3b20fa072248fb.png

 

 

THANK YOU!

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.