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?

  • 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. – Ramhound Mar 21 '17 at 18:09

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 in a /24 subnet, use the command:

netsh int ip set addr "USB Connection 1" static

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

  • 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. – Chasler Mar 21 '17 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. – I say Reinstate Monica Mar 22 '17 at 0:18
  • Yes, I thought about that, but pretty quickly it is no longer a "simple script". – Chasler Mar 22 '17 at 4:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.