Set up two (2) IP addresses on the same network card?

I think it is possible to set up 2 IP addresses and subnet masks on one NIC in Windows XP.

How can this be done?


Solution 1:

Having more than 2 IP addresses is called Multihoming.
Most Multihoming solutions require giving up DHCP addressing in favor of static ones.

Actually, there is a way to multihome a network interface card (NIC) under XP and use both DHCP and multiple static IP addresses. Here's how, taken from Eccentricities of Windows networking :

  1. Use regedit to navigate to
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\NetTrans
  2. Under these subkeys you'll find all of the NICs in your PC listed by their COM Class Identifiers otherwise known as Globally Unique Identifiers (GUID). For example:
    {A8BF419B-8185-4396-B87A-2B6345BBC8E3}
    Be careful to correctly identify which NIC the entry refers to - you'll find multiple GUIDs listed under each NIC in the registry.
  3. Find the key IPAddress and double click on it. In the Edit Multi-String dialog that appears, enter in the value of each of the static IP addresses you want to assign to the NIC, one value per line. Note that the first value must be "0.0.0.0".
  4. Now find the SubnetMask key and edit it exactly the same way you did the "IPAddress" key, again making sure the first value is "0.0.0.0".
  5. Reboot.

Solution 2:

I usually do this with netsh as it's easy to replicate.

netsh interface ip set address "Local Area Connection" static 10.0.10.20 255.255.255.0 10.0.10.1 1
netsh interface ip add address "Local Area Connection" 192.168.1.20 255.255.255.0

Now you'll want to configure DNS also, I presume.

netsh interface ip set dns "Local Area Connection" static 10.0.10.1
netsh interface ip add dns "Local Area Connection" 192.168.1.140

I'll then save these commands to a .cmd file and save that in my source code repository (or other backed up location) for posterity.

Solution 3:

Yes, although both IP's have to be static.

  1. Control Panel -> Network Connections
  2. Right click the NIC -> Properties
  3. TCP/IP->Properties
  4. Click Advanced
  5. Under IP Addresses click Add.