Docker Community Forums

Share and learn in the Docker community.

How to create an IPV6/IPV4 macvlan for public access with dynamic external IP address?

hi everyone, i want to use a openwrt docker image on my rpi as my sencondary router…

it needs a macvlan network…

i view examples from official doc is

docker network create -d macvlan
--subnet=192.168.216.0/24
--gateway=192.168.216.1
--subnet=2001:db8:abc8::/64 --gateway=2001:db8:abc8::10
-o parent=eth0.218
-o macvlan_mode=bridge macvlan216

but my IPV6 is dynamic offered by ASUS router IPV6 native method,like 240e:345:c1b:a101::/56 it will changed when i restart router…240e:345:c1b:a201::/56 240e:345:c11:a000::/56
so how to create a macvlan with both IPV4 and IPV6?

Doesn’t something like ifconfig show two IPv6 addresses, one temporary and another for internal use only? (There may be better ways to set up IPv6 in Docker; not my cup of tea.)

(Aside: it’s great that IPv6 addresses change as otherwise they would be some super cookie.)

oh,there is no eternal IPV6 address in China, it’s PPPOE to get new ipv6 every time

But this is a private IP address for an internal network, so I assumed you’re looking for IPv6 access only over the internal network as well? In that case, it doesn’t matter that your external IP addresses change, you just want something that is stable in your own network, right? Or do you want to expose it to the internet?

(I am mainly asking for the other readers; I’m sure I won’t have the solution for you in either case. Sorry if I am creating confusion.)

oh i want it to be exposed by IPV4/public IPV6 at the same time using macvlan mode