Change IP Address in Windows via Command Prompt

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


To see a list of interfaces:

To set/change an address:

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


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 (with a /16 subnet mask and a 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:


Vlad Dzhabarov