Hurricane Electric's IPv6 Tunnel Broker Forums

General IPv6 Topics => IPv6 Basics & Questions & General Chatter => Topic started by: tjj70302 on January 10, 2010, 06:53:17 AM

Title: IPv6, IPv4 address priority question
Post by: tjj70302 on January 10, 2010, 06:53:17 AM
hi, all

i am completely new to the world of ipv6, just successfully set up a tunnel thru HE. please bear with me if the question is noob.

for some reasons, i didn't use the "Anycasted IPv6 Caching Nameserver" and i can still browse http://ipv6.google.com, so i suppose the original DNS server i use, which is opendns.com is capable of resolving the IPv6 address.

here comes the question, i know ipv6.google.com only has a IPv6 address, so i can't browse it before i setup a tunnel. but for some sites which have both IPv4 and IPv6 address, which IP address will be resolved at a higher priority? or if both addresses are resolved and returned to my computer, is there a mechanism to control which ip address my computer to choose?

thanks in advance

JJ
Title: Re: IPv6, IPv4 address priority question
Post by: cholzhauer on January 10, 2010, 03:26:59 PM
It's decided by the OS...what OS are you running?
Title: Re: IPv6, IPv4 address priority question
Post by: jimb on January 10, 2010, 03:38:05 PM
ipv6.google.com will return IPv6 addresses, where google.com normally will not, unless the name server is "whitelisted" by google, which he's anycasted server is.  So using ipv6.google.com will give you IPv6 regardless, and if you use the anycasted server, you'll get ipv6 where available just going to google.com or <xyz>.google.com

The application and OS make the decision on what address to use.  Unix Linux, there's the "ip addrlabel" and gai.conf file setups which determine how to preference things, along with anything the application may do.  Under windows it's the "netsh int ipv6 int show/set prefixpolicy" I believe, plus anything that application may do.

In general, both linux and windows in applications like web browsers will prefer an IPv6 address unless it's a 6to4 or Teredo address, in which case it will prefer IPv4.

Also, I should say I've tried to change the default preferences under windows while using Teredo for by modifying the "prefixpolicy" but it seemed not to make a difference (I must be doing something wrong or missing something, or it's simply hard coded into the OS or applications I tried).
Title: Re: IPv6, IPv4 address priority question
Post by: tjj70302 on January 10, 2010, 08:10:16 PM
thanks jimb, it's pretty clearly explained.

i mainly use the Mac OSX, and i tried a little bit yesterday after i posted this question, it seems that Safari would prefer ipv6 address without any configuration.

but still, it will be fun to check and play around with "ip addrlabel" and "gai.conf" you mentioned, it is a good startpoint.
Title: Re: IPv6, IPv4 address priority question
Post by: bombcar on January 25, 2010, 08:23:01 PM
If you install the "ShowIP" addon for Firefox, you get a green IPv6 address or a red IPv4 address in your status bar.
Title: Re: IPv6, IPv4 address priority question
Post by: kriteknetworks on January 26, 2010, 07:38:45 AM
As has been often stated, ShowIP is a dns tool, not a connectivity one. Its not an indicator you're actually connecting to a site via IPv6 :)
Title: Re: IPv6, IPv4 address priority question
Post by: bombcar on January 26, 2010, 08:13:53 AM
Is there any way to get Firefox to admit what IP address it obtained a page from?
Title: Re: IPv6, IPv4 address priority question
Post by: cholzhauer on January 26, 2010, 08:15:23 AM
"Netstat -a" will show you what connections your OS has made, but I don't know of a way to tie that to a specific program
Title: Re: IPv6, IPv4 address priority question
Post by: jimb on January 26, 2010, 03:12:28 PM
Quote from: kriteknetworks on January 26, 2010, 07:38:45 AM
As has been often stated, ShowIP is a dns tool, not a connectivity one. Its not an indicator you're actually connecting to a site via IPv6 :)
It does seem to make an effort to figure out which one you're actually connecting to.  At least with me it usually does a good job of it unless you pull the rug out from under it.  :P
Title: Re: IPv6, IPv4 address priority question
Post by: bombcar on January 26, 2010, 05:15:13 PM
This seems silly to me. Firefox knows what it connected to, doesn't it? It should be possible to make it spit that information out.
Title: Re: IPv6, IPv4 address priority question
Post by: jimb on January 26, 2010, 05:45:18 PM
Quote from: bombcar on January 26, 2010, 05:15:13 PM
This seems silly to me. Firefox knows what it connected to, doesn't it? It should be possible to make it spit that information out.
Yes.  But the question is, do plugins have access to this information?

Another problem would be, when you go to a web page, the page often opens a bunch of connections to load images, ads, whatever.  So the plugin would somehow have to differentiate between these and the URL connection.  This could likely be done by resolving the DNS of the URL and cross referencing it to the connection information (presuming it's available to the plugin).

It could also possibly call a system function to get a "netstat" style list and cross reference it with the FF PID & DNS answers, it would work, but it might be a bit slow.
Title: Re: IPv6, IPv4 address priority question
Post by: kriteknetworks on January 27, 2010, 07:47:30 AM
lsof, tcpdump are your friends.... :)
Title: Re: IPv6, IPv4 address priority question
Post by: Mytunelbrl on March 26, 2010, 09:09:07 AM
Hi 2 all

Please help me to setup ipv6 priority in windows 7.

in this page (http://"http://bgp.he.net/ipv6-progress-report.cgi") i see Top Websites Running IPv6,
for example , tribune.com 2002:a3c0:1712::a3c0:1712
i can ping it (by ipv6), but if i visit this site by dns name, in my dns cache i see ipv4.

how i can raise the priority to ipv6 using?


sorry for my english  ;)
Title: Re: IPv6, IPv4 address priority question
Post by: cholzhauer on March 26, 2010, 09:10:13 AM
If you do a "ping -6 sitename" does it resolve?

Is your DNS server IPV6 capable?
Title: Re: IPv6, IPv4 address priority question
Post by: Mytunelbrl on March 26, 2010, 10:48:02 AM
i have written that if i do a "ping -6 sitename" it was pinged and resolved normally some times ago, but now it is down.
it was resolved only by ipv4... strange

Now I can normally ping some others sites, for example tokyotosho.info 2001:470:dc56:b00::25:1
C:\Windows\system32>ping tokyotosho.info

Pinging tokyotosho.info [2001:470:dc56:b00::25:1] with 32 bytes of data:
Reply from 2001:470:dc56:b00::25:1: time=77ms
Reply from 2001:470:dc56:b00::25:1: time=89ms
Reply from 2001:470:dc56:b00::25:1: time=78ms
Reply from 2001:470:dc56:b00::25:1: time=79ms


.. and it is resolve normally in ipv4 and ipv6, but how can i recognize, which protocol (ipv4 or ipv6) was used by my browser (ie or firefox), when i go to this sites by url? and where i can adjust priority of ip protocols using?


p.s. i do not know about my dns server, i use tunnel through HE
Title: Re: IPv6, IPv4 address priority question
Post by: cholzhauer on March 27, 2010, 01:16:41 PM
From http://msdn.microsoft.com/en-us/library/bb756941.aspx

Quote
The Windows Vista and Windows Server 2008 stack will always prefer using IPv6 when it can find an IPv6 address for the remote system it needs to talk to. Network communication will take place for any IPv6 compatible application or service if both systems in a session have IPv6 addresses (e.g. sharing files on a LAN will usually be done over IPv6).
Title: Re: IPv6, IPv4 address priority question
Post by: MrKoen on April 01, 2010, 05:54:07 AM
I've experienced the same problem where IPv4 would be prioritized over IPv6 on both Windows 7 as well as on Windows 2008R2. The host would have both an IPv4 address and an IPv6 address (either native or tunnelled). Only when I would explicitly specify ping -6 or tracert -6, it would use IPv6, otherwise it would always use IPv4 as the default. This means that no application using the default stack would be able to reach an IPv6 host (i.e. webbrowsing to http://ip6.me).

I've been messing with the netsh interface ipv6 show prefixpolicies in order to get it to work. With no avail. After a couple of hours of frustration I found out where the problem lies. Perhaps it may help others as well. The problem was caused by the fact that I was using a DNS server on my internal network on my internally bound NIC with an IPv4 address without a gateway. Even though this DNS server returned the IPv6 addresses first (or would only return an IPv6 address i.e. with ipv6.google.com), it would try to reach it over the IPv4 stack using the IPv6 bound NIC. This would obviously not work. Now I have removed the reference to the internal IPv4 DNS servers and have entered the IPv6 addresses of the DNS server of my ISP, it works without any problems. Strange, but true.
Title: Re: IPv6, IPv4 address priority question
Post by: MrKoen on April 01, 2010, 06:49:34 AM
I have another finding to add to my post above. It does work using the IPv4 DNS server on my internal network when I also enable IPv6 on the internal NIC. So now I have:

The internet facing NIC equipped with: a native IPv6 address and IPv6 gateway without any DNS server.
The internal NIC equipped with: an IPv4 address, an IPv6 address, the two IPv4 addresses of the internal DNS servers and the IPv4 address of the internal gateway.

The priority order of the two NICs as set in Windows under Advanced Settings is: first LAN followed by Internet.

I can now successfully reach both IPv6 hosts on the internet as well as IPv4 and IPv6 hosts on my internal network. When disabling IPv6 on the internal NIC, the problem returns. So make sure you have enabled IPv6 on all your NICs, even though you're not using it through all NICs. Another case of strange, but true.
Title: Re: IPv6, IPv4 address priority question
Post by: jimb on April 01, 2010, 01:13:56 PM
That sounds like a side affect "The Teredo Behavior".  I think that's a bug, because the behavior is supposed to only prefer IPv4 if you have only a Teredo address.  But it appears to require that a non-teredo IPv6 address appear on the interface that your DNS server lives on, even if you have a native IPv6 interface on a different interface.

I wonder what would happen if you put a connection specific DNS server entry pointing to your internal or external DNS server on the NIC which has the IPv6 address?  I bet it'd work then too, even if you didn't have an IPv6 on the LAN interface (I don't think windows has any idea what interface is LAN and which isn't).

Reminds me of the hoops one has to jump through to get Teredo to actually do IPv6 on Vista and Win7 with any application.  You basically have to put a fake IPv6 address which isn't in the Teredo range on the NIC your DNS server is set on, then add back in the IPv6 default route through teredo.  After you do that then suddenly it'll start using IPv6 addresses, otherwise only ping, and visiting IPv6 sites by address works.

This is 'cause the default behavior with Teredo requires that the application request to use Teredo, otherwise the DNS API only returns IPv4 addresses.  I also recently read something which leads me to believe that there may be a windows firewall setting (NAT Traversal) which if turned on might have the same effect.  But not sure about this.
Title: Re: IPv6, IPv4 address priority question
Post by: ALKATRAS on February 26, 2012, 05:18:57 PM
Hi
Script on PowerShell
Prioritet:
1) If available IPv4 & IPv6, priority IPv4;
2) If available IPv4 , priority IPv4 ;);
3) If available IPv6, priority IPv6 ;);

After the script may need to restart OS
Script testing: OS Windows 7
Download script http://oleg-faleev.ru (http://oleg-faleev.ru)

Testing priority: on my homepage: http://oleg-faleev.ru (http://oleg-faleev.ru)
(http://oleg-faleev.ru/1.jpg)