Thursday 31 March 2011

Windows Server 2008, multiple IP addresses, primary IP, secondary IP confusion

When multiple IP addresses are assigned to a single Windows Server 2008 OS, the OS seems to randomly choose any one of the multiple IP addresses assigned as the primary IP address. Even though the GUI would suggest otherwise.

The problem with this is that if you have firewall rules allowing only the primary IP address of this server to other resources, requests from this server are going to be blocked as the target is not seeing the primary IP address you specified, it sees one of the other IP addresses instead.

This can also be a problem with mail servers as you may have specified SPF records which expect emails to be sent only from one IP address, but instead are being sent from another IP address on the same machine because of the same problem.

Solution is explained in below article.

http://support.microsoft.com/kb/2386184/

1. Find the correct patch for your OS, download, install and reboot. This patch will add "skipassource" capability to "netsh" command.

2. Remove all secondary IP addresses and add them not using the GUI, but using the following comand:

  
   
Netsh int ipv4 add address "Local Area Connection" 192.168.x.x 255.255.255.0 skipassource=true


The Skipassource=true causes that IP address never to be used as a primary IP address.

This should resolve the issue.