Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Windows 10 / Adding Multiple IP Addresses (Aliases) to a Single Network Adapter

April 27, 2024

Adding Multiple IP Addresses (Aliases) to a Single Network Adapter

Windows allows to assign multiple IP addresses (aliases) to a single physical network adapter. This can be useful when you want to run multiple websites with unique IP addresses on the same IIS server, if you want to bind an application to a specific IP, or if you are preparing to change IP addresses on your network. In Windows, you can add a secondary (virtual) static IP address to an existing network adapter using the GUI or the command prompt.

Contents:
  • Assigning an Additional IP Address to a Network Adapter on Windows
  • The SkipAsSource Flag and the Primary NIC IP Address
  • How to Add a Second IP Address From CMD/PowerShell

Assigning an Additional IP Address to a Network Adapter on Windows

The Control Panel GUI can be used to add an additional IP address to the network adapter.

  1. Navigate to the Control Panel –> Network and Internet –> Network and Sharing Center -> Change adapter settings (or just run the ncpa.cpl command);
  2. Open the network interface properties;
  3. Select TCP/IP v4 from the list of protocols and click Properties; tcp-ip properties windows 10
  4. Click the Advanced button and then click Add in the IP Addresses section;
  5. Specify an additional IP address, subnet mask, and click Add;
  6. Save the changes. Assigning multiple IP addresses to single NIC in Windows 10
Multiple IP addresses can only be added for a network adapter whose first IP address is set manually (not assigned by a DHCP server). If DHCP is enabled on the interface, you won’t be able to add a second IP .

cant add secondary ip address to dhcp enabled network adapter

Run the ipconfigcommand and check that there are now two IP addresses assigned to the network interface.

Adding additional IP addresses on windows

To check the availability of the second IP address over the network from other computers, use the ping command.

The SkipAsSource Flag and the Primary NIC IP Address

If you assign an additional IP from the Control Panel GUI, this IP address will be used for outgoing connections. There is no such thing as a primary IP address in Windows. To prevent Windows from using a specific IP address for outbound connections, you need to enable the SkipAsSource option for it.

Use PowerShell to list the IPv4 addresses assigned to network adapters on Windows:

Get-NetIPAddress | where AddressFamily -eq IPv4| Select-Object IPAddress, InterfaceAlias, SkipAsSource

Check SkipAsSource option value for ip address

In this example, SkipAsSource is set to False for all computer IP addresses. If you want to make a particular IP address the primary source, disable the SkipAsSource option for all the other IP addresses.

Get-NetIPAddress 192.168.1.90 | Set-NetIPAddress -SkipAsSource $True

Enable IPAddress SkipAsSource using PowerShell

Now the specified IP will not be used by Windows as a source for outgoing connections, except the cases where it is explicitly used by a specific app. Also, if the SkipAsSource flag is enabled, the second IP address will not be registered in DNS (if dynamic registration is enabled).

How to Add a Second IP Address From CMD/PowerShell

You can enable the SkipAsSource flag when adding an additional IP address from the prompt. For example, using netsh:

Netsh int ipv4 add address name="Local Area Connection" 192.168.1.92 255.255.255.0 SkipAsSource=True

List all assigned IP addresses and their SkipAsSource values:

netsh int ipv4 show ipaddresses level=verbose

netsh command view SkipAsSource flag

Also, you can also use PowerShell to configure a second IP for an Ethernet0 network adapter:

New-NetIPAddress –IPAddress 192.168.1.92 –PrefixLength 24 –InterfaceAlias Ethernet0 –SkipAsSource $True

New-NetIPAddress adding the secondary ip alias to a NIC
To allow outgoing traffic from a specific NIC IP address, change SkipAsSource to False.

Get-NetIPAddress 192.168.1.92 | Set-NetIPAddress -SkipAsSource $False

powershell: Set-NetIPAddress SkipAsSource

Remove the additional IP address:

Get-NetIPAddress 192.168.1.92| Remove-NetIPAddress

More information about using PowerShell to configure network settings in Windows.
7 comments
2
Facebook Twitter Google + Pinterest
PowerShellWindows 10Windows Server 2019
previous post
FTP Server Quick Setup on Windows 10/11 and Windows Server
next post
Using WMI Filters to Target Group Policies in Active Directory

Related Reading

How to Disable UAC Prompt for Specific Applications...

March 11, 2024

Fix: Photos App in Windows 10 Opens Extremely...

April 19, 2023

How to Get My Public IP Address with...

October 24, 2023

Fix RDP Connection Error ‘CredSSP Encryption Oracle Remediation’

July 23, 2024

Auto-mount VHD/VHDX File at Startup in Windows

February 20, 2024

How to Run Disk Cleanup (Cleanmgr.exe) on Windows...

March 11, 2024

How to Create Multiple Partitions on a USB...

March 13, 2024

Disks and Partitions Management with Windows PowerShell

March 11, 2024

7 comments

Claire Choi February 14, 2020 - 6:12 am

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?

Reply
admin February 14, 2020 - 10:44 am

You can set the SkipAsSource=False flag for all non-primary IP addresses.

Reply
binesh September 15, 2021 - 4:15 am

what should we give in DNS server ip & alternate DNS ip?

Reply
max September 15, 2021 - 4:49 am

You will always use the DNS address of the primary IP address when resolving.

Reply
Harald Bilke October 6, 2021 - 3:52 pm

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.

Reply
Mauricio P September 20, 2022 - 10:27 pm

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

Reply
BARRY November 24, 2022 - 1:14 pm

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.

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Managing Printers and Drivers on Windows with PowerShell
  • Protecting Remote Desktop (RDP) Host from Brute Force Attacks
  • How to Set a User Thumbnail Photo in Active Directory
  • Implementing Dynamic Groups in Active Directory with PowerShell
  • Match Windows Disks to VMWare VMDK Files
  • Disks and Partitions Management with Windows PowerShell
  • How to Measure Storage Performance and IOPS on Windows
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top