As most of you know, most Ethernet (and other) network cards these days have drivers that support IPv6, even though there are very few real, live IPv6 infrastructures around to test. I’ve found with Vista and Win 7 that ‘ping’ and other utilities routinely report IPv6 information on intranets. This is troublesome because it actually broke one of my programs and I’ve had to fix it. It also makes things hard to diagnose.
Here are the results of a ping from my Vista laptop my wife’s:
>ping bonniehp
Pinging BonnieHP [fe80::f058:d36e:9a4:8145%10] from fe80::b035:5a09:7a3f:d16d%10 with 32 bytes of data:
Reply from fe80::f058:d36e:9a4:8145%10: time=1ms
Reply from fe80::f058:d36e:9a4:8145%10: time=1ms
Reply from fe80::f058:d36e:9a4:8145%10: time<1ms
Reply from fe80::f058:d36e:9a4:8145%10: time<1ms
Ping statistics for fe80::f058:d36e:9a4:8145%10:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
The long IPv6 addresses are not too useful, at least to me. However, if I add the ‘-4’ flag to the command line, I get what I was expecting:
>ping bonniehp -4
Pinging BonnieHP [192.168.1.102] with 32 bytes of data:
Reply from 192.168.1.102: bytes=32 time=1ms TTL=128
Reply from 192.168.1.102: bytes=32 time<1ms TTL=128
Reply from 192.168.1.102: bytes=32 time<1ms TTL=128
Reply from 192.168.1.102: bytes=32 time<1ms TTL=128
Ping statistics for 192.168.1.102:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
Back when I wanted to disable IPv6 on my Vista machine, I found this web page, which explains it clearly. The problem is this: If you disable IPv6, you ALSO BREAK NORMAL PINGING. My Vista machine could no longer ping Bonnie’s, although everyone could ping me and I could ping all down-level machines.
In other words, Microsoft, in its wisdom, made some subtle but necessary feature of IPv4 networking part of IPv6—lose IPv6 and you lose pinging to same-level machines. Barf.
Anyway, if you read the fine print at the bottom of the linked web page, you’ll see a Registry hack involving a value called ‘DisabledComponents’. What’s interesting is the line:
Prefer IPv4 over IPv6 0×20
This little trick appears to work. If you set the DisabledComponents value (usually 0x0) to 0x20, the ping command (and other programs that do pings) will see the IPv4 address FIRST in the collection of returned addresses. It also causes the .Net runtime to return IPv4 addresses first from GetHostEntry(). This makes life much simpler for me.