To renew or change the IP address, you can use the netsh command. Here’re the steps to change the IP address in Command Prompt in Windows 10.
When connected to a network, the Windows computer will automatically get a new IP address as long as it is configured to “Obtain an IP address automatically“. Generally, having the IP address auto-assigned is pretty helpful as you don’t have to configure any extra settings to connect to a network. For instance, you can just plug-in the ethernet cable or connect to a WiFi network and you are ready to go thanks to the auto-config option in Windows 10.
Though Windows can automatically obtain an IP address without any hassle, there might times where you need a specific IP address. For example, to share files in your local network, having a static IP address is really helpful. This eliminates the need to reconfigure the IP address every time you want to access the network drive. In these kinds of cases, you need to change the IP address in Command Prompt.
Thankfully, with just a couple of commands, you change the IP address from Command Prompt. Here are the exact steps you should follow.
Steps to Change IP Address in Command Prompt
To change the IP address from the Windows Command Prompt, there are two major steps. First, you need to know the network interface name and then use it to set the IP address. It is pretty easy. Follow the steps as shown below and you will be good.
- First, press the Windows key to open the Start menu.
- Now, type “Command Prompt” in the search bar.
- Right-click on the Command Prompt and select the “Run as administrator” option.
- Execute the below command to get the network interface name.
netsh interface ipv4 show config
- If you have multiple network interfaces, note down the interface name for which you want to change the IP address.
- Once you have the interface name, execute the below command while replacing “IP_Address”, “Subnet_Mask”, and “Gateway” with the actual IP address you want to assign, subnet mask, and gateway respectively.
netsh interface ipv4 set address name="Interface_Name" static IP_ADDRESS SUBNET_MASK GATEWAY
- After assigning the IP address, close the command prompt window.
That is all. It is that simple to change the IP address in the command prompt.
Note: You can get the subnet mask and gateway addresses from the router or from your ISP.
If you want the IP address to be assigned automatically, execute the below command. This will set the network interface from Static IP to DHCP. DHCP will automatically get a new IP address from the router.
netsh interface ipv4 set address name="Interface_Name" source=dhcp
That is all. I hope that helps. If you are stuck or need some help comment below and I will try to help as much as possible. If you like this article, check out how to change the network name in Windows 10.