Hello everybody,
I(absolute IPv6 beginner) am having trouble setting up IPv6 addresses for my LXC containers on my VPS.
I think I must have routes configured wrong or something…
I have this VPS, with a single IPv4 and a /64 IPv6 network.
I’ve got LXC(the classical LXC, not LXD!) running, using the default network lxc-net bridge for IPv4 NAT, and that works great.
Now I’ve been trying to setup IPv6 for containers that might need it.
I’ve added a section like this to my /etc/network/interfaces
, to create a new bridge device called lxcbr0inet6
(It has nothing to do with the default lxcbr0
), and assign it a /80 sub-network :cccc
(mnemonic for container).
I’ve also setup ens3(WAN interface) on a different /80 sub-network :aaaa
, so my host can use IPv6 normally:
[pr:ef:ix:xx]
is obviously the /64 prefix assigned to my by my VPS provider
iface ens3 inet6 static
address [pr:ef:ix:xx]:aaaa::1
netmask 80
gateway fe80::1
auto lxcbr0inet6
iface lxcbr0inet6 inet6 static
address [pr:ef:ix:xx]:cccc::1
netmask 80
gateway [pr:ef:ix:xx]:aaaa::1
bridge_ports none
For the container I want to add IPv6 to, I’ve added a config section like this:
lxc.net.1.type = veth
lxc.net.1.link = lxcbr0inet6
lxc.net.1.flags = up
lxc.net.1.hwaddr = 00:16:3e:xx:xx:x6
lxc.net.1.ipv6.address = [pr:ef:ix:xx]:cccc::2/80
lxc.net.1.ipv6.gateway = [pr:ef:ix:xx]:cccc::1
This adds a new veth network interface in my container, connected to the newly created lxcbr0inet6, and should automatically configure it for the specified IP/GW.
I’ve also setup the sysctl’s like this:
net.ipv6.conf.default.accept_ra=0
net.ipv6.conf.default.autoconf=0
net.ipv6.conf.default.forwarding=1
net.ipv6.conf.all.accept_ra=0
net.ipv6.conf.all.autoconf=0
net.ipv6.conf.all.forwarding=1
If I now start the container, I get a sensible(?) network configuration(in the container, cut for brevity):
ip -6 a
7: eth1@if8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 [pr:ef:ix:xx]:cccc::2/80 scope global
valid_lft forever preferred_lft forever
ip -6 r
[pr:ef:ix:xx]:cccc::/80 dev eth1 proto kernel metric 256 pref medium
fe80::/64 dev eth1 proto kernel metric 256 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
default via [pr:ef:ix:xx]:cccc::1 dev eth1 metric 1024 pref medium
ip -6 n
[pr:ef:ix:xx]:cccc::1 dev eth1 lladdr fe:74:6e:56:a4:57 router REACHABLE
fe80::7c7c:e0ff:fec8:8fe8 dev eth1 lladdr fe:74:6e:56:a4:57 router STALE
I can even ping the various host IPs - I just can’t get outside of my own VPS.
Host that are reachable via ping:
[pr:ef:ix:xx]:cccc::2
(veth interface) → Ok
[pr:ef:ix:xx]:cccc::1
(lxcbr0inet6) → Ok
[pr:ef:ix:xx]:aaaa::1
(enp3s0 WAN) → Ok
But If I try e.g. ping -6 google.de
I get no replies
It’s not just ICMP, I’ve tried wget -6 https://google.com -O /dev/zero
as well, to no avail
It works perfectly fine on the host, just not in the containers.
It seems to me that I’m missing some routing information? I’m out of my depth…
Is this such an uncommon scenario? I thought this might be more common, does anybody know of a good tutorial/hints? My google-foo found some similar, but not same scenarios - trying a lot of parts from these lead to no success.
I’ve tried a lot of things already, but I’m basically just guessing:
I’ve set up a RADVD server to advertise routes(?), but I’m actually fairly certain that I don’t need to, and it didn’t work.
I’ve played with using the entire /64 on the bridge, but that also did not work.
Also the provider-given gateway of fe80::1
, does that make sense?
Am I missing firewall rules? Currently it’s just:
sudo ip6tables -L
Chain INPUT (policy ACCEPT)
Chain FORWARD (policy ACCEPT)
Chain OUTPUT (policy ACCEPT)
On the host, after starting a Container, I get this from ip -6 a
:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 [pr:ef:ix:xx]:aaaa::1/80 scope global
valid_lft forever preferred_lft forever
inet6 fe80::c89f:9eff:fe33:4b7c/64 scope link
valid_lft forever preferred_lft forever
3: lxcbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 fe80::216:3eff:fe00:0/64 scope link
valid_lft forever preferred_lft forever
4: lxcbr0inet6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 [pr:ef:ix:xx]:cccc::1/80 scope global
valid_lft forever preferred_lft forever
inet6 fe80::dcaa:56ff:feab:c2d7/64 scope link
valid_lft forever preferred_lft forever
8: vethTG6U7D@if7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 fe80::fc79:a9ff:fe95:f308/64 scope link
valid_lft forever preferred_lft forever
10: veth8PLSXL@if9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 fe80::fc45:e6ff:fe6f:a140/64 scope link
valid_lft forever preferred_lft forever
And this from ip -6 r
:
::1 dev lo proto kernel metric 256 pref medium
[pr:ef:ix:xx]:aaaa::/80 dev ens3 proto kernel metric 256 pref medium
[pr:ef:ix:xx]:cccc::/80 dev lxcbr0inet6 proto kernel metric 256 pref medium
fe80::/64 dev ens3 proto kernel metric 256 pref medium
fe80::/64 dev lxcbr0inet6 proto kernel metric 256 pref medium
fe80::/64 dev lxcbr0 proto kernel metric 256 pref medium
fe80::/64 dev veth8PLSXL proto kernel metric 256 pref medium
fe80::/64 dev vethTG6U7D proto kernel metric 256 pref medium
default via fe80::1 dev ens3 metric 1024 onlink pref medium
Any help would be appreciated, keep in mind that I’m very new to IPv6. Also I don’t have IPv6 at home.