Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / Assign Multiple IP Addresses (Aliases) to a Single NIC

August 3, 2020 PowerShellWindows 10Windows Server 2012 R2Windows Server 2016

Assign Multiple IP Addresses (Aliases) to a Single NIC

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

ipconfig - getting current ip address

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.

Contents:
  • How to Add an Additional IP Address via Windows GUI?
  • SkipAsSource Flag
  • How to Assign the Second IP Address Using Netsh Command?
  • Adding Secondary IP Address Using PowerShell

How to Add an Additional IP Address via Windows GUI?

You can add the second IP address from the Windows GUI.

  1. Open the Control Panel –> Network and Internet –> Network and Sharing Center -> Change adapter settings (or just run the ncpa.cpl command);
  2. Open the properties of your network interface;
  3. Select TCP/IP v4 in the list of protocols and click Properties; tcp-ip properties windows 10
  4. Click the Advanced button and then press Add in the IP Addresses section;
  5. Specify an additional IP address, IP subnet mask and click Add;
  6. Save the changes by clicking OK several times. Assigning multiple IP addresses to single NIC in Windows 10

Using the ipconfig command, make sure that the second IP address has appeared on this interface.

Adding additional IP addresses on windows

Check the availability of the second IP address from other computers in the same network using the ping command. It should respond.

ping the secondary ip address

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

Get-NetIPAddress

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

New-NetIPAddress adding the secondary ip alias to a NIC
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

powershell: Set-NetIPAddress SkipAsSource

7 comments
1
Facebook Twitter Google + Pinterest
previous post
Configuring an FTP Server with User Isolation on Windows Server 2016 / 2012 R2
next post
Restricting Group Policy with WMI Filtering

Related Reading

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

October 15, 2023

How to Query and Change Teams User Presence...

October 8, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

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

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023
  • How to Use Ansible to Manage Windows Machines

    September 25, 2023
  • Installing Language Pack in Windows 10/11 with PowerShell

    September 15, 2023
  • Configure Email Forwarding for Mailbox on Exchange Server/Microsoft 365

    September 14, 2023
  • How to View and Change BIOS (UEFI) Settings with PowerShell

    September 13, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Managing Printers and Drivers with PowerShell in Windows 10 / Server 2016
  • Deploy PowerShell Active Directory Module without Installing RSAT
  • Managing User Photos in Active Directory Using ThumbnailPhoto Attribute
  • RDP Brute Force Protection with PowerShell and Windows Firewall Rules
  • Match Windows Disks to VMWare VMDK Files
  • Active Directory Dynamic User Groups with PowerShell
  • Auditing Weak Passwords in Active Directory
Footer Logo

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


Back To Top