Ipv6 for Docker Container?


Recommended Posts

Hello

 

I tryed to set up Nextcloud and I have the problem that the container doesn't get an Ipv6 Adress.

Network is set to bridge and that's works fine for a Windows 10 VM. And of course the Server gets an Ipv4 and Ipv6 Adress.

If I type "docker inspect nextcloud" in the command line, no Ipv6 Adress shows up.

What setting could be wrong, where should I try to search?

I don't have a public Ipv4, only Ipv6. So if I want connect from outside, nextcloud needs an Ipv6 Adress.

Sorry for my bad english

 

Greetings

Ronny

 

Gesendet von meinem EML-L29 mit Tapatalk

 

 

Link to comment

Thanks, that's not what I want. Putting the hole server on the internet is easy. The server gets an Ipv6.

I want to use nextcloud and of course I need access from outside to connect my phone to the nextcloud docker. So I only want that docker on the internet. If that's a huge security issue, then nextcloud is worthless.

Same with OpenVPN as an example. The container must be reachable from the outside to connect to.

I thought the container is by design not able to talk to the host. For security reasons.

If I had a public Ipv4 it would be easy to open a port for the Nextcloud docker, but I only have a public Ipv6 and the container don't get an Ipv6.

So, where I am wrong?

 

Gesendet von meinem EML-L29 mit Tapatalk

 

 

 

 

Link to comment

Disclaimer: I don't have IPv6. My comments are how I would solve it (but I'm probably missing some key info as we don't have IPv6 here)

Do you have /64 assigned to you by your ISP? does your router allow you to route the /64 into your LAN? If not you'll need to look into Nat6 (yuck)

 

This requires you to assign the containers their own ipv4 and ipv6 address. not shared with the Unraid (the ipv4 only of course as Unraid doesn't have ipv6)

Make sure the docker network (eth0/br0) has Ipv4 and Ipv6 enabled - you'll need to stop docker engine and the array to make these changes 

Assign the docker network the Ipv6 /64 (and the necessary ip ranges)

restart the docker engine.

Modify the container to use the custom docker network

your containers should now have an ipv6 address

 

Edited by ken-ji
Link to comment

You can just add extra parameter in docker config, then docker container can get IPV6 automaticly.

--mac-address xx:xx:xx:xx:xx:xx --sysctl net.ipv6.conf.all.disable_ipv6=0

Give container a unique mac-address then container should get a SLACC IPV6 address.

There is no need to set up ipv6 on Unraid Server

  • Thanks 1
Link to comment

Containers that are in bridge network mode are connected to an internal bridge that cannot be accessed from outside (ipv4 or ipv6) unless ports are forwarded. you cannot forward ports thru unraid to and ipv6 address unless unraid itself is using ipv6.

You need to put the container on a custom docker network, which will be exposed to the LAN (as a 1st class memeber of the LAN, responding to ARP etc) and which would allow you to set/gain an ipv6 address, that the router can reach/forward packets too.

i don't think docker works with SLAAC, but documentation points to making sure the docker daemon /or network by extension should have a ipv6 prefix assigned to get ipv6 addresses from else only link local addresses get assigned.

Edited by ken-ji
Link to comment
2 minutes ago, ken-ji said:

this would assign an internal IPv6 address unless I am mistaken. containers that are in bridge network mode are connected to an internal bridge that cannot be accessed from outside (ipv4 or ipv6) unless ports are forwarded. you cannot forward ports thru unraid to and ipv6 address unless unraid itself is using ipv6.

you need to put the container on a custom docker network, which will be exposed to the LAN (as a 1st class memeber of the LAN, responding to ARP etc) and which would allow you to set/gain an ipv6 address, that the router can reach/forward packets too.

 

Yes, there has to use bridge lan instead of internal bridge.

The docker has dedilcate ip in your subnet, the router can send packets to the docker.

This is very usefule for me which I only have dynamic prefix from ISP and I can caculate the IPV6 that specific docker used so I can use DDNS too

Link to comment
  • 1 year later...
On 8/20/2019 at 4:37 AM, Leoyzen said:

You can just add extra parameter in docker config, then docker container can get IPV6 automaticly.


--mac-address xx:xx:xx:xx:xx:xx --sysctl net.ipv6.conf.all.disable_ipv6=0

Give container a unique mac-address then container should get a SLACC IPV6 address.

There is no need to set up ipv6 on Unraid Server

Hi Leoyzen,

can you please describe the steps for unraid dummies who are still in trial phase 😬

Link to comment
  • 10 months later...

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.