Change IP Address in Windows via Command Prompt

Problem
Change or set to static an IP Address of an interface in Windows via netsh command in Command Prompt.

tl;dr

To see a list of interfaces:

To set/change an address:

Where “Ethernet” is the name of the interface, 10.0.0.100 is the IP address, 255.255.0.0 is the subnet mask, and 10.0.0.1 is the default gateway.

Solution

In Windows, you can use the netsh command to edit network interfaces. To see a list of network interfaces on your system (including copies or disabled adapters), type in the following:

To see a list of NICs with their configured network settings, type in the command below:

To set a static IP, run the netsh command with the following format:

So, for example, if you need to set the IP address on Local Area Connection 3 to 10.0.0.100 (with a /16 subnet mask and a 10.0.0.1 default gateway), you would enter the following:

If you are setting a static IP for the first time, you will also need to configure a DNS server:

To change the connection back to DHCP, run the following:

Author

Vlad Dzhabarov