I have got a server with IPv4 address and IPv6 /64 subnet (let's say 2001:db8::/64
), both public. Server itself has the following IPv6 address: 2001:db8::1/64
. The gateway is fe80::1
(which causes problems with docker/podman, because it's not in the same subnet).
My goal is to create docker/podman container (WWW server, for example) with its own public IPv6 (let's say 2001:db8::2/64
). From my understanding, such a setup needs macvlan network. So the setup would look as follows:
I managed to partially fulfill this setup using bridge network and the following command:
sudo podman network create --subnet 2001:db8::/64 --ipv6 mynet
Container within this network was accessiable from Internet via correct IP (2001:db8::2
), but its public IP (for http, ping etc.) was wrong - it was 2001:db8::1
, which is totally understandable when using bridge network.
Things get complicated when I tried using macvlan, first problem was the gateway which needs to be set to fe80::1
. docker
refused to create such network with error "no matching subnet for gateway fe80::1". podman
successfully create network using the following command:
sudo podman network create -d macvlan --subnet 2001:db8::/64 --gateway fe80::1 --ipv6 -o parent=eth0 mynet
Unfortunately, a container inside this network has no connectivity in any direction, even though it has correct IP and gateway specified.
Server is working on Ubuntu, with enabled IP routing in kernel.
Any ideas how this setup could be made would be much appreciated. Thanks.