Question : How to configure IIS 7.5 to use ipv4 IP addresses in log files

I am running IIS 7.5 on Windows Server 2008 R2. I am using the W3C format log files. IIS is putting the IPV6 ip addresses in the log files, but I would like to see the IPV4 IP addresses instead. How can I configure IIS logging to use the IPV4 address instead of the IPV6 address?

Thanks!

Answer : How to configure IIS 7.5 to use ipv4 IP addresses in log files

I found the answer...

3.4 When using a function like GetLocalAddress to programmatically check web site’s IP or look into IIS 7.0 log, the result is “::1” instead of “127.0.0.1” or a string like "fe80::e1ac:c656:a6bd:d619%10".  Why?  [top]

The result is expected. These are IPv6 addresses instead of IPv4. ::1 is the local loopback address of IPv6 which is corresponding to 127.0.0.1 in IPv4 format.

By default, IPv6 is enabled on Windows 2008. If you want to disable it, go to Control Panel->Network and Sharing Center->Manage network connections. Uncheck IPv6 in your network connection's property. However, this will not disable the loopback interface of IPv6 which means http://localhost/ will still result in ::1. To fully disable all IPv6 interfaces on the server, we need to create and set DisabledComponents registry property to 0xffffffff under:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters .

and reboot the server. IE and IIS7 will start to use IPv4 addresses after this.

Reference:

929852     How to disable certain Internet Protocol version 6 (IPv6) components in Windows Vista

http://support.microsoft.com/default.aspx?scid=kb;EN-US;929852
Random Solutions  
 
programming4us programming4us