Set default Windows Server interface IP with multiple IPs

Solution 1:

have you seen this link? http://securahosting.com/technical-insight/windows-server/set-primary-ip-address-windows-server-2012#.VOe_0EfF98E

and this: http://www.confusedamused.com/notebook/source-ip-address-preference-with-multiple-ips-on-a-nic/

shortly, in netsh address setup use SkipAsSource=true flag for all non-primary IPs

Solution 2:

You can easily use PowerShell to do this:

Set-NetIPAddress -IPAddress 192.168.1.221 -SkipAsSource:$true

Do that for all IP addresses on interface that you don't want to be default. Leave one IP where SkipAsSource = False. That IP will end up being the default.

Solution 3:

Here I found a post with a very detailed example on how to define the primary IP output:

https://www.sysadmit.com/2018/12/windows-configurar-ip-primaria-salida.html

Example extracted from previous link:

Imagine that we want to configure the following IP addresses in the same network interface: 172.17.0.2, 172.17.0.3 and 172.17.0.10 but that the primary IP address of output is: 172.17.0.10 instead of 172.17.0.2.

We remove the current TCP / IP configuration and execute the following:

netsh int ipv4 add address "Ethernet0" 172.17.0.2/16 SkipAsSource = true

netsh int ipv4 add address "Ethernet0" 172.17.0.3/16 SkipAsSource = true

netsh int ipv4 add address "Ethernet0" 172.17.0.10/16 SkipAsSource = false

If we look, with the first two lines, we indicate that both 172.17.0.2 and 172.17.0.3 are ignored as primary IP addresses of output, therefore it will be the IP address 172.17.0.10 which will be considered as the primary IP address of output.