How To Create Multiple Ip Addresses
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.
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.
- 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
How To Create Multiple Ip Addresses
Source: http://woshub.com/assign-multiple-ip-addresses-single-nic-windows/#:~:text=You%20can%20add%20the%20second%20IP%20address%20from%20the%20Windows%20GUI.&text=Click%20the%20Advanced%20button%20and,by%20clicking%20OK%20several%20times.
Posted by: garciawhar1968.blogspot.com
0 Response to "How To Create Multiple Ip Addresses"
Post a Comment