How can i assign multiple IP addresses to an NIC (possibly software solution)?

4,867

You can assign additional IP addresses to a network interface with the netsh interface ip add address command. However, this will disable DHCP on that interface. As you need both addresses, you could query the interface for the DHCP-assigned address using ipconfig and then assign the given address and the additional address you need as static addresses. This will work as long as the DHCP server does not assume it can assign you another address when the DHCP lease is supposed to get renewed. Also, if the DHCP IP address is dynamically assigned (rather than, say, tied to your interface's MAC address) you will need to re-enable DHCP every time you reconnect to that network and add the static addresses again.

Example

C:\>ipconfig

Windows IP Configuration

Ethernet adapter Local Area Connection:
        IP Address. . . . . . . . . . . . : 192.168.13.22
        Subnet Mask . . . . . . . . . . . : 255.255.255.0
        Default Gateway . . . . . . . . . : 192.168.13.40

C:\>netsh
netsh>interface ip add address name="Local Area Connection" addr=10.0.0.2  mask=255.0.0.0
netsh>interface ip add address name="Local Area Connection" addr=192.168.13.22  mask=255.255.255.0 gateway=192.168.13.40
Share:
4,867

Related videos on Youtube

Botz3000
Author by

Botz3000

Updated on September 18, 2022

Comments

  • Botz3000
    Botz3000 over 1 year

    I am connected to a network that assigns my IP address via DHCP, but i also need to assign my NIC an IP address that is not in the network's address range. Is this possible, maybe with some "virtual network interface"? Preferrably so that both networks work? I'm running Windows XP.

    • Tadeusz A. Kadłubowski
      Tadeusz A. Kadłubowski over 14 years
      What operating system?
    • Botz3000
      Botz3000 over 14 years
      Windows XP. added it.
  • Botz3000
    Botz3000 over 14 years
    this looks good, but a solution that requires admin privileges only once would be better.