I understand that IPv6 is supposed to make NAT superfluous, but I’m running containers on VPS and I am still trying to get my head around IPv6.
According to this post from @tomp, it should be possible to use IPv6 with NAT by setting ipv6.dhcp.stateful="true"
in the lxc network config:
$ lxc network show lxdbr0
config:
ipv4.address: 10.23.21.1/24
ipv4.nat: "true"
ipv6.address: fd42:774b:2bac:da6::1/64
ipv6.dhcp.stateful: "true"
ipv6.nat: "true"
description: ""
name: lxdbr0
type: bridge
used_by:
- /1.0/instances/equal-parakeet
- /1.0/profiles/default
managed: true
status: Created
locations:
- none
eth0 on the host has a valid and working IPv6 address and tests performed on the host succeed.
Although I can make outbound IPv4 connections from the container to the outside world:
equal-parakeet ~ $ LANG=C ping -c 4 wikipedia.org
PING wikipedia.org (91.198.174.192) 56(84) bytes of data.
64 bytes from text-lb.esams.wikimedia.org (91.198.174.192): icmp_seq=1 ttl=58 time=16.7 ms
64 bytes from text-lb.esams.wikimedia.org (91.198.174.192): icmp_seq=2 ttl=58 time=16.4 ms
64 bytes from text-lb.esams.wikimedia.org (91.198.174.192): icmp_seq=3 ttl=58 time=16.3 ms
64 bytes from text-lb.esams.wikimedia.org (91.198.174.192): icmp_seq=4 ttl=58 time=16.3 ms
--- wikipedia.org ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 16.298/16.432/16.693/0.155 ms
That does not work for IPv6:
equal-parakeet ~ $ LANG=C ping6 -c 4 wikipedia.org
PING wikipedia.org(text-lb.esams.wikimedia.org (2620:0:862:ed1a::1)) 56 data bytes
From b03921hp (fe80::216:3eff:fe8a:916%eth0) icmp_seq=1 Destination unreachable: Beyond scope of source address
From b03921hp (fe80::216:3eff:fe8a:916%eth0) icmp_seq=2 Destination unreachable: Beyond scope of source address
From b03921hp (fe80::216:3eff:fe8a:916%eth0) icmp_seq=3 Destination unreachable: Beyond scope of source address
From b03921hp (fe80::216:3eff:fe8a:916%eth0) icmp_seq=4 Destination unreachable: Beyond scope of source address
--- wikipedia.org ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3004ms
What have I missed here?