Monday, July 13, 2020

Changing default protocol to IPV4 vs IPV6 in Linux

Even though IPv6 is default on most systems now and has been for a number of years, it still seems to be more problematic than using IPV4.  It is interesting that a new router I bought had IPV6 disabled by default and the settings buried for turning it on.  That is why I prefer to have my web browser default to ipv4 first with the fallback to ipv6 within a second.

To configure this on Linux edit the /etc/gai.conf file using root priviledges, scroll down to where you see the following text and uncomment the precedence line.  Save the file and reboot.

#    For sites which prefer IPv4 connections change the last line to
#
precedence ::ffff:0:0/96  100

To test that its working properly go to https://ipv6-test.com/

It will show the default protocol and the fallback to ipv6 time.  The score should be 14/20 typically.

Thats it, now using a more proven and reliable protocol first with the newer and less proven protocol as backup.