Disclosure up front: I run IPYE, a company that leases IP space. Most of this article is practical how-to; IPYE appears where a free /48, LOA, or ROA helps you try the work, with a short call to action at the end.

System containers are at their best when each one has its own public address: no port mapping, no NAT tables, and firewall rules that name the container's address directly. With a routed /48, that is easy to do in Incus, the community fork of LXD. Every container can get a global address, or even its own /64. This article shows two ways to do it with a free IPv6 /48 from IPYE routed to an Incus host. The examples use 2001:db8:100::/48, with the host's uplink on a provider network and the /48 reaching the host over BGP or a static route. LXD uses the same keys, with lxc in place of incus.

Prepare the host

The host is now a router, so turn on forwarding. If the host also learns its own default route from router advertisements on the uplink, set accept_ra to 2 there. Otherwise, enabling forwarding stops the kernel from accepting RAs and the default route expires:

cat > /etc/sysctl.d/60-incus-v6.conf <<'X' net.ipv6.conf.all.forwarding = 1 net.ipv6.conf.eth0.accept_ra = 2 X sysctl --system 

Keep a blackhole route for the whole /48, so traffic to unassigned parts dies at the host instead of looping toward the upstream:

ip -6 route add blackhole 2001:db8:100::/48 

Make it persistent in your network configuration once it works.

Option one: a managed bridge with a /64

The simplest setup gives Incus one /64 from the /48 and lets it handle router advertisements:

incus network create br-pub \ ipv4.address=none \ ipv6.address=2001:db8:100:10::1/64 \ ipv6.nat=false \ ipv6.dhcp.stateful=false 

Incus runs dnsmasq on the bridge and sends RAs, so containers attached to it configure addresses with SLAAC. ipv6.nat=false is the important part. With NAT on, containers would leave through the host's address instead of their own.

incus launch images:debian/12 web1 --network br-pub incus list web1 

The IPv6 column should show an address inside 2001:db8:100:10::/64. SLAAC addresses derived from the MAC address change if the container is recreated. For services, pin an address with incus config device set web1 eth0 ipv6.address=2001:db8:100:10::10, which Incus applies through a dnsmasq reservation. That needs ipv6.dhcp.stateful=true on the bridge.

Option two: routed NICs with fixed addresses

A routed NIC skips the bridge entirely. Incus creates a veth pair, puts the address inside the container, and adds a host route pointing at the veth:

incus launch images:debian/12 db1 --no-profiles -s default incus config device add db1 eth0 nic nictype=routed \ ipv6.address=2001:db8:100:20::10 incus start db1 

Inside the container, the default gateway is a link-local address on the host side, set up automatically. Check from the host:

ip -6 route show 2001:db8:100:20::10 incus exec db1 -- ip -6 addr show eth0 

The parent option on routed NICs makes Incus answer neighbour discovery on the uplink for the container's address. That is only needed when the address comes from the provider's on-link /64. With your own /48 routed to the host, leave parent unset and let normal routing do the work.

Routed NICs make it easy to give a container a whole subnet as well. Add ipv6.routes=2001:db8:100:21::/64 to the device and the host routes that /64 to the container, which suits a container that runs its own VMs or nested containers.

Firewalling

Incus adds its own nftables rules for managed networks, but those are about DHCP and DNS, not about protecting your services. Filter forwarded traffic on the host with a policy you control:

table inet hostfw { chain forward { type filter hook forward priority 10; policy drop; ct state established,related accept meta l4proto ipv6-icmp accept oifname "br-pub" tcp dport { 80, 443 } accept ip6 daddr 2001:db8:100:20::10 tcp dport 5432 ip6 saddr 2001:db8:100:10::/64 accept iifname { "br-pub", "veth*" } accept } } 

The database container only accepts PostgreSQL from the web subnet, and everything else inbound is dropped.

Test from outside

From a machine on another network, ping -6 2001:db8:100:10::10 and curl -6 http://[2001:db8:100:10::10]/ confirm the full path. If ping works from the host but not from outside, check the upstream route and the forward chain before looking at the container.

Routing and paperwork

For the /48 to reach the host at all, it has to be announced. With a BGP-capable provider, that means an LOA from the IPYE portal and a ROA, which is created automatically while the prefix is on IPYE's ARIN or APNIC accounts.

Do this next

Request your free /48, route it to your Incus host, and start with one managed bridge on a single /64 before you move to routed NICs. Questions: ipye@turnel.com.

About IPYE

IPYE (https://ipye.com) leases IPv4, IPv6 and ASN space with instant setup. Your first IPv6 /48 is free for the first year, a real allocation you can announce on your own ASN, with a LOA from the portal and the ROA created automatically. ASN and region changes apply automatically. IPv4 /24 to /22 leases include LOA, ROA and per-/24 rDNS; WHOIS is editable on IPv6 /44 and larger. Locations: Los Angeles, New York, Ashburn, Salt Lake City, London, Amsterdam, Frankfurt. Claim your free /48: https://my.ipye.com/products/ipv6-rental. Questions: ipye@turnel.com.

Disclosure: I run IPYE