Recently I received error messages running apt update on one of my hosts connected to a network managed by an openwrt device:
Err:13 http://deb.debian.org/debian bullseye-updates InRelease
Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:8e::644). - connect (101: Network is unreachable)
My network setup consists of a VDSL Modem attached to the openwrt device. Apparently ipv6 communication from the host was not possible, so the first thing I checked was if ipv6 communication was possible on the openwrt device. I used the pingv6 feature of the luci web configuration interface and saw that the openwrt could not communicate over ipv6 either.
I then checked the Modem configuration and enabled ipv6 via PPP, which enabled me to ping ipv6 hosts from the modem. After that, I configured the WAN interface of the openwrt device with the luci web interface to use the global ipv6 address of the modem as the gateway and gave the openwrt device an address within the same address space. This change enabled me to ping ipv6 addresses from the openwrt device:
PING openwrt.org (2a03:b0c0:3:d0::1af1:1): 56 data bytes
64 bytes from 2a03:b0c0:3:d0::1af1:1: seq=0 ttl=56 time=45.774 ms
64 bytes from 2a03:b0c0:3:d0::1af1:1: seq=1 ttl=56 time=22.644 ms
64 bytes from 2a03:b0c0:3:d0::1af1:1: seq=2 ttl=56 time=22.901 ms
64 bytes from 2a03:b0c0:3:d0::1af1:1: seq=3 ttl=56 time=22.738 ms
64 bytes from 2a03:b0c0:3:d0::1af1:1: seq=4 ttl=56 time=22.595 ms
--- openwrt.org ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 22.595/27.330/45.774 ms
How do I need to configure the openwrt device to enable clients to communicate over ipv6?
On my host machine, in the interface dhcp settings, the ipv6 setting is set to auto. As a consequence, the interface has the following addresses:
sudo ifconfig enx047cafecafe
enx047caffecaffe: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.5.21 netmask 255.255.255.0 broadcast 192.168.5.255
inet6 fe80::d32b:cafe:cafe prefixlen 64 scopeid 0x20<link>
So the interface has an ipv6 address but when trying to ping an external ipv6 host I get the following error:
ping6 2a03:b0c0:3:d0::1af1:1
ping6: connect: Network is unreachable
I only have a very basic understanding of ipv6, but from my ipv4 knowledge I would assume that my host interface has something like a link local address which has been automatically assigned and it does not have a gateway to which it can route packets for external addresses.
I started wireshark to see if there were any router advertisements, and indeed there were, the openwrt device sends advertisements with a link local address fe80::8401:96ff:cafe:cafe.
How do I make my host respect that router advertisement?
What do I need to configure on the openwrt device to route packets coming from the link local address space to external addresses?
I tried assigning an address in the ipv6 address space of the modem to the lan interface of the openwrt device and use the ipv6 address of the WAN interface of the openwrt device as the ipv6 gateway of the LAN interface, to no avail.
What kind of address do I need to specify for the ipv6 configuration of the LAN interface of the openwrt device?
What do I need to input into the "IPv6 routed prefix" field of both the LAN and the WAN interfaces of the openwrt device?