In some cases an administrator needs to configure multiple IP addresses one a single network interface (NIC) in Windows. An example of such situations can be the need to run multiple sites with unique IP addresses and SSL certificates (e. g., SSL certificates from Let’s Encrypt) on one IIS or Apache server, preparing to change of IP addressing in a subnet, binding the applications to different IP addresses, etc.
Let’s consider how to add an additional static IP address on a network interface in Windows 10 (in the same way you can add an additional IP address to a NIC on Windows Server). First of all, make sure that only one IP address is assigned to your Ethernet network adapter. To do it, run this command:
ipconfig
As you can see, one IP address (192.168.1.90) is assigned to the local network connection (it is called Ethernet0 in my case).
You can add the second static IP address in a number of ways.
How to Add an Additional IP Address via Windows GUI?
You can add the second IP address from the Windows GUI.
- Open the Control Panel –> Network and Internet –> Network and Sharing Center -> Change adapter settings (or just run the
ncpa.cpl
command); - Open the properties of your network interface;
- Select TCP/IP v4 in the list of protocols and click Properties;
- Click the Advanced button and then press Add in the IP Addresses section;
- Specify an additional IP address, IP subnet mask and click Add;
- Save the changes by clicking OK several times.
Using the ipconfig
command, make sure that the second IP address has appeared on this interface.
Check the availability of the second IP address from other computers in the same network using the ping
command. It should respond.
SkipAsSource Flag
The main drawback of adding the second IP address using this method is that the SkipAsSource
(SkipAsSource=False) flag is not enabled for it. If SkipAsSource is enabled (True), the IP address won’t be used by the system for outbound connections, except if it is explicitly used by a certain application. Also, if the flag is enabled, the second IP address is not registered in the DNS (even when the dynamic registration is enabled). In general, you can set the main IP address using SkipAsSource parameter.
How to Assign the Second IP Address Using Netsh Command?
You can assign an additional IP address from the command prompt using the Netsh
utility. This command also allows you to set the SkipAsSource for an IP address.
Open the command prompt as administrator and run this command:
Netsh int ipv4 add address name="Local Area Connection" 192.168.1.92 255.255.255.0 SkipAsSource=True
Adding Secondary IP Address Using PowerShell
You can also add a second IP alias to a network interface using the NetIPAddress PowerShell cmdlets (this cmdlet appeared in PowerShell version in Windows 2012 / Windows 8.)
Display the list of available interfaces:
Get-NetIPAddress | ft IPAddress, InterfaceAlias, SkipAsSource
IPAddress InterfaceAlias SkipAsSource<
--------- -------------- ------------
172.23.53.241 vEthernet False
192.168.1.90 Ethernet0 False
127.0.0.1 Loopback Pseudo-Interface 1 False
To add an additional IP address for the Ethernet0 NIC, run this command:
New-NetIPAddress –IPAddress 192.168.1.92 –PrefixLength 24 –InterfaceAlias “Ethernet0” –SkipAsSource $True
IPAddress : 192.168.1.92
InterfaceIndex : 11
InterfaceAlias : Ethernet0
AddressFamily : IPv4
Type : Unicast
PrefixLength : 24
PrefixOrigin : Manual
SuffixOrigin : Manual
AddressState : Tentative
ValidLifetime : Infinite ([TimeSpan]::MaxValue)
PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
SkipAsSource : True
PolicyStore : ActiveStore
To modify SkipAsSource parameter and allow the outgoing traffic from this IP address of the network interface, use this command:
Get-NetIPAddress 192.168.1.92 | Set-NetIPAddress -SkipAsSource $False
7 comments
Hey, It’s really good contents.
I have a question about this.
Do the multiple IPs in single NIC have a priority?
If the server want to connect to another server using the NIC, which IP would be used?
I manage some server like this condition, they operate differently, so I confused.
Do you know anything about this?
You can set the
SkipAsSource=False
flag for all non-primary IP addresses.what should we give in DNS server ip & alternate DNS ip?
You will always use the DNS address of the primary IP address when resolving.
Interesting stuff. I’d like to utilise it for the following scenario:
NEW AD-DC, new name okay but: masses of devices w/hard code DNS IP.
Use the 2nd IP for the DNS service.
Were you able to set it in a DC? Did you have replication issues? I need to do the same as I have network devices pointing to an IP as DNS
Hello — I hope you are still active here and can assist me.,
I wish to use a dedicated Server 2019 to only host (10 to 15) websites. I have changed the registrar to point the domain to my custom DNS assignment. We have a single static IP.
Goal = set up one server to host multiple web sites over using one IP address. Only have one NIC card installed. Traffic for all websites will be small (< 10,000 per month). Using a SonicWall TZ500 firewall.
Do we need to create additional private IPs — one for each web site?
Running ipconfig shows only one private IP — 192.168.1.145. Could we create additional IPs … 146, 147, 148, etc??
What is limit on the # of IPs that can be created?
Any suggestions you can offer will be appreciated.
Thank you.