Context
I installed Debian 12 in my machine a couple of days ago, and since then I have been facing some issues with (outbound) IPv6 networking. From my investigation so far (having gone through infinitely many related posts on this and other Linux forums, none of which have been particularly helpful), it seems to me the default gateway for IPv6 is misconfigured, but I'm currently at my wit's end on how to proceed from here.
Reproducing the issue
A simple ping suffices to illustrate it:
$ ping -6 example.org
PING example.org(2606:2800:220:1:248:1893:25c8:1946 (2606:2800:220:1:248:1893:25c8:1946)) 56 data bytes
^C
--- example.org ping statistics ---
18 packets transmitted, 0 received, 100% packet loss, time 17394ms
whereas it works with regular IPv4:
$ ping -4 example.org
PING (93.184.216.34) 56(84) bytes of data.
64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=1 ttl=52 time=116 ms
64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=2 ttl=52 time=194 ms
^C
--- ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 116.459/155.372/194.285/38.913 ms
The issue is not limited to ICMP packets, wget and curl also fail to establish connection if targeting an IPv6 address. This also shows DNS is not the problem here, since the IPv6 address is succesfully resolved.
Setup
As mentioned, my setup is a recent installation of Debian 12 with GNOME. This means networking is handled by Network Manager, where the IPv6 method is set to auto and ip6-privacy is enabled (I already tried disabling it to no avail).
Output from relevant commands:
$ sudo dmesg | grep IPv6
[10528.771325] IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0: link becomes ready
[10559.614635] IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0: link becomes ready
[18402.308519] IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0: link becomes ready
[18406.196405] IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0: link becomes ready
[18444.190916] IPv6: ADDRCONF(NETDEV_CHANGE): wlp2s0: link becomes ready
So it looks like IPv6 is enabled at the kernel level (?).
$ ip -6 route
2a00:d100:18e2:9f00::/64 dev wlp2s0 proto ra metric 600 pref medium
fe80::/64 dev wlp2s0 proto kernel metric 1024 pref medium
default via fe80::1 dev wlp2s0 proto ra metric 600 pref medium
From what I can tell, fe80:: is meant for local networking so it should not be where requests are routed to by default. On the other hand, 2a00:d100:18e2:9f00::/56 is the value my router claims for prefix delegation, but I am not entirely sure what that means. I tried to set it as the default gateway (with sudo route add -A inet6 default gw 2a00:d100:18e2:9f00::), but that didn't do the trick either.
$ sudo route -A inet6
Kernel IPv6 routing table
Destination Next Hop Flag Met Ref Use If
2a00:d100:18e2:9f00::/64 [::] U 600 1 0 wlp2s0
fe80::/64 [::] U 1024 1 0 wlp2s0
[::]/0 _gateway UG 600 5 0 wlp2s0
localhost/128 [::] Un 0 7 0 lo
zenbook/128 [::] Un 0 3 0 wlp2s0
zenbook/128 [::] Un 0 2 0 wlp2s0
zenbook/128 [::] Un 0 3 0 wlp2s0
ff00::/8 [::] U 256 6 0 wlp2s0
[::]/0 [::] !n -1 1 0 lo
$ traceroute -6 google.com
traceroute to google.com (2a00:1450:4003:80f::200e), 30 hops max, 80 byte packets
1 * * *
2 * * *
3 * * *
[continues ...]
28 * * *
29 * * *
30 * * *
If any other command output is required in order to make progress, please let me know in the comments. Any help with this is appreciated.
fe80::1might possibly be right. You might want to try enabling "stateful addressing" on the router which sets up a dhcp6 server. This isn't enabled by default on all routers.2a00:d100:18e2:9f00:although the last two 0s could conceivably be different.fe80::1: invalid address.fe80::1%wlp2s0: valid address. Even with ping (but using-I wlp2s0instead in ping gets the same effect).