Friday, October 02, 2009

Windows 7, .NET and IPv6

I'm still recovering from my recent Windows VM death at work and still learning the ropes with Windows 7. I stumbled across another one of those 'uggghh' moments today.

We have an application that does some impersonation if you are within our firewall and part of the same non-routable subnet blah blah... I noticed that from within my Windows 7 VM I could not hit a portion of our application. A nice little exception was occurring. From outside my VM I didn't have any issues.

After a quick look it was due to local connections to IIS defaulting to an IPv6 address, no 'localhost'. So I navigated through the windows to get to the network card settings and disabled the IPv6 protocol for the card. 'That should do it' I thought. Nope! It still used the IPv6 for loopback.

Awright Google, lead me towards the light. This post started out the same way. Disabling the IPv6 for the card, but towards the bottom there's a lovely registry, cringe, modification. Basically it's in 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters. Add a 32-bit DWORD item with the name of 'DisabledComponents' and a value of '1'. You also have to reboot :(

'Awright, now I'm good'.... WRONG! Now it was using '::1' for the loopback. Awright, lets see what's in the 'hosts' file. Go to 'C:\Windows\System32\drivers\etc' and open the 'hosts' file. And we find out that we can't simply edit it. Just like my previous .sln post you have to first load notepad, or whatever, as admin and then open the file. You'll have to re-navigate to the file since you also can't simply drag and drop the file onto your open session of notepad. Extra steps build character :)
Comment out the entry       .host
with a '#'

Yay! now it finally works like it used to....

No comments: