0

On Windows10, I would like to be able to set multiple static IP addresses (eg. 192.168.0.250, 192.168.10.250, 10.0.7.250) on the computer ethernet interface card if no DHCP server is found.

I know Windows has an alternate configuration tab in TCP/IP settings to do that but there I can only set one static IP address.

Is there a way to do be able to set multiple IP addresses as an alternate configuration ?

2 Answers 2

0

You don't need to go to alternate configuration. Go to general tab and click advanced. In IP settings tab, Then click Add. Add the each static IP address with their subnet masks. Make sure to disable DHCP and uncheck Obtain IP address automatically and insert your Gateway (Usually router's IP address).

3
  • No, you can't add multiple static addresses there when DHCP is configured because the "Add" button is disabled.
    – Loïc G.
    Commented Jun 11, 2020 at 6:55
  • Then you have to disable DHCP configuration on router and assign each device connected to LAN a static TCP/IP settings and disable DHCP client in your PC.
    – Wasif
    Commented Jun 11, 2020 at 7:01
  • I know but I can't change router settings.
    – Loïc G.
    Commented Jun 11, 2020 at 7:02
0

From command line, using netsh:

These commands are used to view your NICs and IDs:
netsh interface ipv4 show interfaces
netsh interface ipv4 show ip

This commands sets an IP address on NIC with [id]. Execute the command multiple times for multiple IPs.
netsh interface ipv4 set address name=[id] source=static address=[static ip] mask=[subnet mask] gateway=[default gateway]

Using powershell command:
Set-NetIPAddress –InterfaceIndex [id] –IPAddress [newIP] –PrefixLength [subnet length, ie 24]

6
  • And what about the DHCP ? It will be automatically disabled after running these commands which set static IP address. I would like to keep the DHCP feature to use it when available
    – Loïc G.
    Commented Jun 11, 2020 at 6:56
  • How about using a script to check if a dhcp is available, or if you got an IP address. Perhaps you could check for 169.254.x.x IP, which means that no dhcp server was found or IP leased and in that case use the above commands to set static IPs.
    – Krackout
    Commented Jun 11, 2020 at 7:10
  • Yeah but once the static IPs would be set, the DHCP feature will be disabled on the NIC. I could execute a script on cable connection but I don't know how to do this. How to catch this cable connection event.
    – Loïc G.
    Commented Jun 11, 2020 at 7:17
  • Cannot help you with an event driven - cable connection event - script either. But you could use a time interval to execute the script, per minute for example. In this scenario you could also go back to dhcp lease when it's available, reverting from static IPs.
    – Krackout
    Commented Jun 11, 2020 at 7:23
  • I just found this I will have a look at it. Thanks for the hint !
    – Loïc G.
    Commented Jun 11, 2020 at 7:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .