|
|
Subscribe / Log in / New account

gai.conf

gai.conf

Posted Feb 2, 2011 14:30 UTC (Wed) by cesarb (subscriber, #6266)
In reply to: A Challenge: Put your static IP Linux systems on IPV6 right now! by BrucePerens
Parent article: The last IPv4 address blocks allocated

At least on recent Fedora, glibc gives priority to IPv4 over 6to4 or Teredo prefixes by default. The latest Ubuntu LTS also seems to do the same.

To check, go to http://whatismyv6.com/ and see if it gives you the IPv4 or IPv6 address.


to post comments

gai.conf

Posted Feb 2, 2011 17:13 UTC (Wed) by nybble41 (subscriber, #55106) [Link] (3 responses)

That's because 6to4/Toredo addresses have a different label than normal IPv6 addresses, and the address selection rules prefer addresses with the same label as your own. This behavior is easy to fix if you wish to prefer IPv6 over IPv4: just open up /etc/gai.conf (which controls the getaddrinfo() call) and comment out the line containing "label 2002::/16" (the 6to4/Toredo prefix). These addresses will then be assigned the same label as other public IPv6 addresses via the "label ::/0" rule.

gai.conf

Posted Feb 2, 2011 18:15 UTC (Wed) by cesarb (subscriber, #6266) [Link] (2 responses)

> just open up /etc/gai.conf

And if you do not have a /etc/gai.conf (for instance on recent Fedora), you should have an example somewhere within /usr/share/doc (on Fedora 14, it is at /usr/share/doc/glibc-common-2.12.90/gai.conf) which you can copy over to /etc/gai.conf.

gai.conf

Posted Feb 2, 2011 21:01 UTC (Wed) by nybble41 (subscriber, #55106) [Link] (1 responses)

Thanks for the correction; I did not realize that this file was optional.

For reference, I started with the default gai.conf provided by the Debian libc-bin package, version 2.11.2-8, and uncommented all the "label" lines *except* the one with the 6to4 prefix. The result should look something like this:

label ::1/128 0
label ::/0 1
#label 2002::/16 2
label ::/96 3
label ::ffff:0:0/96 4
label fec0::/10 5
label fc00::/7 6
label 2001:0::/32 7

This excerpt should work as a complete configuration should you happen to lack a default gai.conf file.

gai.conf

Posted Feb 3, 2011 2:27 UTC (Thu) by mtaht (subscriber, #11087) [Link]

Thank you! I'd been trying to figure out why my gai.conf wasn't forcing ipv6 for ages.

gai.conf

Posted Feb 4, 2011 11:22 UTC (Fri) by ariveira (guest, #57833) [Link]

I gives my ipv6 adress here

Using Ubuntu 10.04 LTS with a tunnel via freenet6 easy to
configure installing gw6c ( the package has a bug and i had
to disable key checking though )


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds