maxp maxp - 1 year ago 358
ASP.NET (C#) Question

IIS Request.UserHostAddress returning IPV6 (::1), even when IPV6 disabled

In the properties section of my network card, on windows server 2008, i have IPV6 disabled, leaving only IPV4 enabled.

However in ASP.NET, Request.UserHostAddress returns '::1', an IPV6 address.

Has anyone got any idea how to revert back to IPV4?

Answer Source

If you're connecting to localhost (::1 /, you're not using the network card that your server has, but rather like a virtual card that windows has. I don't think there is anyway to configure the loopback card and removing IPv6 from it, not without removing support from the whole system, but in Win2008 you probably can't do that anymore.

You can verify that your physical card isn't being used by running network packet capturing utils. In windows, you can never sniff out the traffic that walks the virtual loopback card.

That said, should you access from a different machine (through a connection that will be passing through your physical card), you should see an IPv4 address being returned by Request.UserHostAddress

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download