how do i convince Alpine Linux that it doesn't have IPv4 connectivity? when i run e.g. "ping bbc.co.uk", it picks the IPv4 address first, even though it doesn't have a default route.

i can't disable IPv4 because i need it for Wireguard.

i can't use /etc/gai.conf because musl libc doesn't support that.

this makes e.g. apk very slow because it waits for IPv4 to time out before it tries IPv6. i don't understand why it doesn't immediately get "no route to host" over IPv4...

any ideas?

#ipv6 #alpinelinux

@lw
You could also have the interface which WG needs to connect in its own namespace and move the wg interface out into whatever NS you need it to be, see https://www.wireguard.com/netns/#ordinary-containerization
Routing & Network Namespaces - WireGuard

@adrian_blx thanks, but, i'd rather not do that since there's no need for namespaces here: wg only uses IPv4 and the network connectivity is only IPv6 (over wg). so i'd rather work out why wg-quick is breaking it.

@lw
Understood, but namespaces would IMO be much cleaner here: you would create a NS with IPv4 - so your main NS could stay IPv6 only.

But yes: its a tad more complex and not supported by wg-quick