Many a time IT admin needs to set up multiple IP addresses to the same network adapter. Situations like hosting various SSL sites, speed up traffic exchanges which can skip the gateway in case of multiple IP addresses, different public IP addresses to avoid firewalls or to avoid being blacklisted in SPAM filters, and so on. In this post, I will share how you can assign multiple IP addresses to a network adapter.
Assign Multiple IP Addresses to a Network Adapter
There are multiple ways to achieve this. It includes making use of the following:
- Network adapter settings
- Netsh utility
1] Network Adapter Settings
1] Go to Settings > Network & Internet, and click on Change adapter options. It will reveal a list of physical and virtual network adapters on the computer. Double click on the ethernet adapter to which you want to assign multiple IP addresses. Click on Properties button.
2] In the Ethernet properties, select TCP/IPv4 or TCP/IPv6, and then click on Properties. Under the General tab, choose “Use the following IP address.” Add an IP address, subnet, and default gateway to the adapter.
3] Then click on Advanced button, to open advanced TCP/IP settings. Then click on Add button to add an IP address. You can keep adding multiple IP addresses to the adapter using this method. You can also choose to add multiple gateways or DNS IP address in the same place.
If you type ipconfig command on the prompt, you should see all the secondary IP addresses listed.
2] Using Netsh command
If you are good with the Command Prompt, then it is a lot faster and easier to add multiple IP addresses.
Open Command Prompt with admin privileges, and run the following command:
Netsh int ipv4 add address name="Local Area Connection" 192.168.100.100 255.255.255.0 SkipAsSource=True
You can choose to set SkipAsSource depending on your need using Netsh. When configured as true, the IP address won’t be used by the OS for outbound connections.
3] Use PowerShell to assign more IP address
Open Power Shell with admin privileges using WIN X. Then use the NetIPAddress command to add more IP address. Make sure to figure out the adapter name.
- Find list of Ethernet adapter:
Get-NetIPAddress | ft IPAddress, InterfaceAlias, SkipAsSource
- Assign an IP address to a network adapter. Here it is vEthernet.
New-NetIPAddress –IPAddress 192.168.100.100 –PrefixLength 24 –InterfaceAlias “vEthernet” –SkipAsSource $True
- Modify the SkipAsSource parameter
Get-NetIPAddress 192.168.100.100 | Set-NetIPAddress -SkipAsSource $False
Assigning multiple IP addresses is used on the needed scenario, and is not for general consumers. They are usually used by IP address when an application demands it.
Hope this helps!
- Tags: Network