I found a more simple way to use dynamic ipv6 prefix in container

Currently, all incus inbuilt network sharing solution require you to set a static ip address. Which is inconvenient if your v6 prefix ocassionally changes. That would require you to run some monitor thing to detetct the prefix change and reload container nic settings(ipvlan can not hot load is worse).
My master connection is a wifi interface so I can not use macvlan.

However I seems found a better solution(at least for me).

First you need to add a L2 ipvlan slave on the host, with this guide IPVLAN Driver HOWTO — The Linux Kernel documentation
Then you just attach the interface to a container using physical nictype.
Once you start the container or manually bring the interface up in the container, you will see that the interface already get your router ra address and default route is setup automatically. You just need to run dhclient on it(if router have dhcpv6) or manully choose a address in the subnet.

1 Like

L3(s) will also work,but require you to manually setup link-local and default route. Do not use this one unless you have enough skills and want to have a more controlled environment.