You are not logged in.

#1 2020-12-29 02:09:32

weirddan455
Member
Registered: 2012-04-15
Posts: 199

How does Linux choose between IPv4 and IPv6?

I just ran into a bug with my router where it's not routing IPv6 internet traffic.  I realized this when Lutris started stalling out for about 3 minutes when it was trying to connect to the internet (presumably trying to connect to an IPv6 address before finally giving up and resorting to IPv4) and a game I was trying to run through Lutris couldn't get online at all.  Doing a "ping" command in the terminal to, say archlinux.org resolved to an IPv6 address and then failed all the pings (but I could still ping IPv4 addresses if I typed them in manually.)

However, every other program I tried (like Firefox and Pacman) didn't have any issues.  I know that Firefox will use IPv6 when it is available because I can see an IPv6 address when I go to "what is my ip" websites but it seemed to "seamlessly" fail over to IPv4 in this case.

The issue with my router is likely solved by a reboot (it's a buggy ISP provided one...) but I was also able to work around this by passing "ipv6.disable=1" to the kernel.  Anyway, this just got me curious as to how Linux (or maybe individual programs?) decides what protocol to use.  Is there a setting somewhere or a default "time out" before it decides to switch to IPv4?

Offline

#2 2020-12-29 07:52:13

seth
Member
Registered: 2012-09-03
Posts: 18,969

Re: How does Linux choose between IPv4 and IPv6?

You're ptobably looking for https://serverfault.com/questions/93717 … -over-ipv6 ?
(Also https://wiki.archlinux.org/index.php/IP … _over_IPv6 but see objection there and the answer at serverfault)

Offline

Board footer

Powered by FluxBB