Multiple IP addresses on Windows 2008 R2 – What’s the primary/default address?

Lately I have been working and troubleshooting some OCS Edge installation, where the Edge server didn’t have internet access. Internet access is required for OCS Edge, to check certificate revoke lists and so on.

Scenario:

You assign several ip addresses to a network adapter on Windows 2008 R2. You use only the primary ip address for outgoing traffic. Firewall only allows internet connection from the primary address, traffic coming from other ip addresses is blocked by the firewall.

Problem:

How does Windows selects what address to be used for outgoing traffic?
It normally selects the lowest of addresses, but this is not 100 % consequent.

How do you define on of the IP’s as Primary?
You can’t by default.

Solution:

Microsoft have released a non-official hotfix that solves this problem – KB article 2386184.
This hotfix add a new flag to the NETSH command. This new flag is SkipAsSource.

I have NOT included the hotfix with this mail, as I think that if Microsoft is checking the request for this hotfix.
Maybe they make it public, if the requests increases.

What does this do:

This new flag tells the operating system to NOT use the ip address as a source address for outgoing traffic.

Examples:

netsh interface ipv4 add address “Interface Name” “IP Address” “Net Mask” SkipAsSource=true

This command adds an additional ipv4 address to the interface.
To list the IPv4 addresses that have SkipAsSource flag set to true, run the following command:

netsh interface ipv4 show ipaddresses level=verbose

I hope that this will help some of the OCS Edge installations out there, that have restrictions on internet access.

A BIG thanks to Bjørnar Selvén in Atea, for helping out with crucial information.

Advertisements