1

I have some tablets that use USB network adapters. If I set the tablets static IP address, but then change USB network adapters, the IP address reverts to DHCP.

Is there a way to have windows preserve the network configuration even if the MAC address of the adapter changes?

1
  • You would have to configure each individual adaptor and insure they the same USB port is always used to achieve this. The easier solution is to assigned specfic adapters to specific laptops, but the same USB, must be used for even that to work. Commented Mar 21, 2017 at 18:09

1 Answer 1

1

One solution is to use a simple script to assign a static IPv4 address to the USB network connection. You can do this with the built-in Netsh command as follows:

netsh int ip set addr "<connection-name>" static <static-ip> <subnet-mask> 

For example, if your network connection is named USB Connection 1 and you want to assign the static IP address 10.24.0.77 in a /24 subnet, use the command:

netsh int ip set addr "USB Connection 1" static 10.24.0.77 255.255.255.0 

You can read more about Netsh's commands for manipulating your network connections in this TechNet article.

3
  • Started with that route, but the problem is that the connection name changes each time a new usb adapter is plugged in. It appears that the connection-name is tied to the MAC address. Commented Mar 21, 2017 at 22:25
  • Then to fully automate the process, you could run netsh int ip show int to get a list of current network interfaces, then use that to get the current name of the USB NIC. Hopefully there is something unique about the interface that would enable you to scriptomatically select the one you're after. Commented Mar 22, 2017 at 0:18
  • Yes, I thought about that, but pretty quickly it is no longer a "simple script". Commented Mar 22, 2017 at 4:38

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.