IPv6 localhost woes.<p align=left>So, my situation is this... </p> <p align=left> </p> <p align=left>My OS is XP Pro, I'm using Visual Studio 2008. </p> <p align=left> </p> <p align=left>I'm developing ASP.NET applications, and use the embedded &quot;Cassini&quot; webserver during development to debug/etc.</p> <p align=left> </p> <p align=left>I'm also developing an application that uses the stuff in System.ServiceModel, to do Peer To Peer networking using PNRP, using such classes as ServiceEndpoint, ServiceContract, NetPeerTcpBinding, DuplexChannelFactory, etc..</p> <p align=left> </p> <p align=left>My dillemma is that these two modes of development are in direct conflict with each other, due to IPv6, and it's mapping of localhost to ::1. </p> <p align=left> </p> <p align=left>So, here's the problem (now that you have context):</p> <p align=left> </p> <p align=left>Before installing IPv6 on XP, I could develop web applications just fine, and the little webserver would load, go to <a title="http://localhost" href="http://localhost">http://localhost</a> and load up the pages. </p> <p align=left> </p> <p align=left>Now, since I installed IPv6, localhost maps to ::1.... which is an IPv6 endpoint. That means that it never reaches the little webserver waiting on the 127.0.0.1 endpoint. If I manually type in <a title="http://127.0.0.1" href="http://127.0.0.1">http://127.0.0.1</a> of course, it will reach it and everything works fine. But localhost doesn't ever get there.. In fact, it goes no where, because nothing is listening on ::1 port 80. There's no way to change the embedded webserver to go to 127.0.0.1 specifically, because it's hardcoded to launch the <a title="http://localhost" href="http://localhost">http://localhost</a> URL (I confirmed this by examining the webserver's code via Reflector).</p> <p align=left> </p> <p align=left>Most of the people who have faced this problem have resolved it one of two ways... Either they are on Vista, and they can modify thier c:\windows\system32\drivers\etc\hosts file and remove the reference to ::1 localhost, OR they uninstall IPv6 completely. A third option (on Vista) is to modify the registry value DisabledComponents found at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters , and disable some ore all of the functionality of IPv6.</p> <p align=left> </p> <p align=left>I'm not on Vista. Neither of the Vista fixes are relevant. My hosts file does not have a line like ::1 localhost. My registry does not have the value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents. I even tried creating the value and setting it to one of the suggested settings, and it had no effect. </p> <p align=left> </p> <p align=left>I can't uninstall IPv6 because I need it to develop the Peer to Peer stuff that depends on it. </p> <p align=left> </p> <p align=left>.......</p> <p align=left> </p> <p align=left>So... What I want to do is find a way to re-route the ::1 endpoint to 127.0.0.1, OR just get Windows XP to look for the IPv4 address before the IPv6 (so it'll find 127.0.0.1 before it finds ::1 when it resolved the hostname &quot;localhost&quot;). </p> <p align=left> </p> <p align=left>I've looked over the IPv6 documentation a lot.. But honestly, networking on that level is not my strong point, and I can't figure out what I should do... Should I be making a 6over4tunnel, v6v4tunnel, isatap, toredo, or some other kind of interface?... Is there some OTHER hosts files the IPv6 pays attention to? because it doesn't seem to need or notice the one at drivers\etc\hosts.</p> <p align=left> </p> <p align=left>Can anyone help me understand how to configure the network setup on the machine so that calls to &quot;localhost&quot;, with <strong>IPv6 enabled</strong>, end up at the IPv4 address 127.0.0.1 ?</p> <p align=left> </p> <p align=left>I've tried everything I can think of....</p> <p align=left> </p> <p align=left>Thanks,</p> <p align=left>Troy</p> <p align=left> </p>PS: If this is the wrong forum for this, please direct me to the correct one.© 2009 Microsoft Corporation. All rights reserved.Thu, 11 Jun 2009 14:26:49 Z36f57ccf-7a76-4843-84bd-7bb945aad23fhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/36f57ccf-7a76-4843-84bd-7bb945aad23f#36f57ccf-7a76-4843-84bd-7bb945aad23fhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/36f57ccf-7a76-4843-84bd-7bb945aad23f#36f57ccf-7a76-4843-84bd-7bb945aad23fthoward37http://social.msdn.microsoft.com/Profile/en-US/?user=thoward37IPv6 localhost woes.<p align=left>So, my situation is this... </p> <p align=left> </p> <p align=left>My OS is XP Pro, I'm using Visual Studio 2008. </p> <p align=left> </p> <p align=left>I'm developing ASP.NET applications, and use the embedded &quot;Cassini&quot; webserver during development to debug/etc.</p> <p align=left> </p> <p align=left>I'm also developing an application that uses the stuff in System.ServiceModel, to do Peer To Peer networking using PNRP, using such classes as ServiceEndpoint, ServiceContract, NetPeerTcpBinding, DuplexChannelFactory, etc..</p> <p align=left> </p> <p align=left>My dillemma is that these two modes of development are in direct conflict with each other, due to IPv6, and it's mapping of localhost to ::1. </p> <p align=left> </p> <p align=left>So, here's the problem (now that you have context):</p> <p align=left> </p> <p align=left>Before installing IPv6 on XP, I could develop web applications just fine, and the little webserver would load, go to <a title="http://localhost" href="http://localhost">http://localhost</a> and load up the pages. </p> <p align=left> </p> <p align=left>Now, since I installed IPv6, localhost maps to ::1.... which is an IPv6 endpoint. That means that it never reaches the little webserver waiting on the 127.0.0.1 endpoint. If I manually type in <a title="http://127.0.0.1" href="http://127.0.0.1">http://127.0.0.1</a> of course, it will reach it and everything works fine. But localhost doesn't ever get there.. In fact, it goes no where, because nothing is listening on ::1 port 80. There's no way to change the embedded webserver to go to 127.0.0.1 specifically, because it's hardcoded to launch the <a title="http://localhost" href="http://localhost">http://localhost</a> URL (I confirmed this by examining the webserver's code via Reflector).</p> <p align=left> </p> <p align=left>Most of the people who have faced this problem have resolved it one of two ways... Either they are on Vista, and they can modify thier c:\windows\system32\drivers\etc\hosts file and remove the reference to ::1 localhost, OR they uninstall IPv6 completely. A third option (on Vista) is to modify the registry value DisabledComponents found at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters , and disable some ore all of the functionality of IPv6.</p> <p align=left> </p> <p align=left>I'm not on Vista. Neither of the Vista fixes are relevant. My hosts file does not have a line like ::1 localhost. My registry does not have the value HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents. I even tried creating the value and setting it to one of the suggested settings, and it had no effect. </p> <p align=left> </p> <p align=left>I can't uninstall IPv6 because I need it to develop the Peer to Peer stuff that depends on it. </p> <p align=left> </p> <p align=left>.......</p> <p align=left> </p> <p align=left>So... What I want to do is find a way to re-route the ::1 endpoint to 127.0.0.1, OR just get Windows XP to look for the IPv4 address before the IPv6 (so it'll find 127.0.0.1 before it finds ::1 when it resolved the hostname &quot;localhost&quot;). </p> <p align=left> </p> <p align=left>I've looked over the IPv6 documentation a lot.. But honestly, networking on that level is not my strong point, and I can't figure out what I should do... Should I be making a 6over4tunnel, v6v4tunnel, isatap, toredo, or some other kind of interface?... Is there some OTHER hosts files the IPv6 pays attention to? because it doesn't seem to need or notice the one at drivers\etc\hosts.</p> <p align=left> </p> <p align=left>Can anyone help me understand how to configure the network setup on the machine so that calls to &quot;localhost&quot;, with <strong>IPv6 enabled</strong>, end up at the IPv4 address 127.0.0.1 ?</p> <p align=left> </p> <p align=left>I've tried everything I can think of....</p> <p align=left> </p> <p align=left>Thanks,</p> <p align=left>Troy</p> <p align=left> </p>PS: If this is the wrong forum for this, please direct me to the correct one.Fri, 27 Jun 2008 04:18:14 Z2008-10-02T01:04:03Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/36f57ccf-7a76-4843-84bd-7bb945aad23f#5a594709-d4ed-4e6d-afdf-8dcb414d8949http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/36f57ccf-7a76-4843-84bd-7bb945aad23f#5a594709-d4ed-4e6d-afdf-8dcb414d8949thoward37http://social.msdn.microsoft.com/Profile/en-US/?user=thoward37IPv6 localhost woes.<p>Well, I was able to work around it another way, by setting up the Web Application's start action to be a Start URL, specified as <a title="http://127.0.0.1" href="http://127.0.0.1">http://127.0.0.1</a> instead of it's default &quot;Current Page&quot; setting. This also means you need to speficy the port number for the embedded web server.</p> <p align=left> </p> <p align=left>But this doesn't answer my real question -- How to configure networking so that requests for localhost go to 127.0.0.1 with IPv6 installed on XP?</p> <p align=left> </p> <p align=left>Thanks,</p> <p align=left>Troy</p>Fri, 27 Jun 2008 22:41:15 Z2008-06-27T22:41:15Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/36f57ccf-7a76-4843-84bd-7bb945aad23f#e76ad704-3f36-4dbf-903e-87b31d23f7e9http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/36f57ccf-7a76-4843-84bd-7bb945aad23f#e76ad704-3f36-4dbf-903e-87b31d23f7e9Martin Katz phdhttp://social.msdn.microsoft.com/Profile/en-US/?user=Martin%20Katz%20phdIPv6 localhost woes.<p align=left><font face=Arial size=2>The Vista IPv6 configuration appears to work on XP. At least with SP3 it does. </font></p> <p align=left><font face=Arial size=2></font> </p> <p align=left>IPv6 is getting hard to avoid. Office 2007 uses IPv6 internally instead of named pipes. So do other programs.</p> <p align=left> </p> <p align=left>In your case, setting <span class=wikiword>DisabledComponents to 20 might do the trick. Normally, the OS tries IPv6 addresses before IPv4 addresses. This flag reverses the order (there is a table to control the order that various DNS sources are checked, this setting changes the values in that table).</span></p> <p align=left> </p> <p align=left><font face=Arial size=2>Look at the last section of </font></p> <p align=left><a title="http://www.ipv6day.org/action.php?n=En.Configuration-WindowsVista" href="http://www.ipv6day.org/action.php?n=En.Configuration-WindowsVista">http://www.ipv6day.org/action.php?n=En.Configuration-WindowsVista</a></p> <p align=left>I copied part of it below:</p> <p align=left> </p> <p align=left><strong>Disabling <span class=wikiword>IPv6</span></strong></p> <p>Unlike Windows XP, <span class=wikiword>IPv6</span> in Windows Vista cannot be uninstalled. To disable <span class=wikiword>IPv6</span> on a specific connection, you can go to the Network Connections folder, obtain properties of the connection and clear the check box next to the Internet Protocol version 6 (<span class=wikiword>TCP/IPv6</span>) component in the list. This method disables <span class=wikiword>IPv6</span> on your LAN interfaces and connections, but does not disable <span class=wikiword>IPv6</span> on tunnel interfaces or the <span class=wikiword>IPv6</span> loopback interface. </p> <p class=vspace></p> <p> </p> <p align=left>To selectively disable <span class=wikiword>IPv6</span> components and configure behaviors for <span class=wikiword>IPv6</span> in Windows Vista, create and configure the following registry value (DWORD type) </p> <p class=vspace></p><code>HKEY_LOCAL_MACHINE\SYSTEM\<span class=wikiword>CurrentControlSet</span>\Services\tcpip6\Parameters\<span class=wikiword>DisabledComponents</span></code> <p></p> <p class=vspace></p> <p><span class=wikiword>DisabledComponents</span> is set to 0 by default. </p> <p class=vspace></p> <p> </p> <p align=left>The <span class=wikiword>DisabledComponents</span> registry value is a bit mask that controls the following series of flags, starting with the low order bit (Bit 0): </p> <p class=vspace></p> <ul> <li>Bit 0 Set to 1 to disable all <span class=wikiword>IPv6</span> tunnel interfaces, including ISATAP, 6to4, and Teredo tunnels. Default value is 0 <li>Bit 1 Set to 1 to disable all 6to4-based interfaces. Default value is 0 <li>Bit 2 Set to 1 to disable all ISATAP-based interfaces. Default value is 0 <li>Bit 3 Set to 1 to disable all Teredo-based interfaces. Default value is 0 <li>Bit 4 Set to 1 to disable <span class=wikiword>IPv6</span> over all non-tunnel interfaces, including LAN interfaces and *Point-to-Point Protocol (PPP)-based interfaces. Default value is 0 <li>Bit 5 Set to 1 to modify the default prefix policy table to prefer <span class=wikiword>IPv4</span> to <span class=wikiword>IPv6</span> when attempting connections. Default value is 0 </li></ul> <p class=vspace></p> <p>To determine the value of <span class=wikiword>DisabledComponents</span> for a specific set of bits, construct a binary number consisting of the bits and their values in their correct position and convert the resulting number to hexadecimal. For example, if you want to disable 6to4 interfaces, disable Teredo interfaces, and prefer <span class=wikiword>IPv4</span> to <span class=wikiword>IPv6</span>, you would construct the following binary number: 101010. When converted to hexadecimal, the value of <span class=wikiword>DisabledComponents</span> is 0x2A. </p> <p align=left></p>Fri, 19 Sep 2008 15:26:26 Z2008-10-02T01:04:03Zhttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/36f57ccf-7a76-4843-84bd-7bb945aad23f#e8a984fc-e87c-4e4e-aa29-70eee3b0e22ehttp://social.msdn.microsoft.com/Forums/en-US/wcf/thread/36f57ccf-7a76-4843-84bd-7bb945aad23f#e8a984fc-e87c-4e4e-aa29-70eee3b0e22ekhushi_pranhttp://social.msdn.microsoft.com/Profile/en-US/?user=khushi_pranIPv6 localhost woes.I tried these registry settings.<br/> This does mot help me.<br/> My application is still using ipv6 local loopback adress ::1 to send the result<br/> We are using Apache tomcat web server.<br/> <br/> Its a 2k8 64 bit server and I'm looking for work around.<br/> Either making my web server use IPV4 local loopback address<br/> or disabling IPV6 local loopaback address from the interface.<br/> <br/> Can any please help??<br/>Thu, 11 Jun 2009 14:26:48 Z2009-06-11T14:26:48Z