Are you searching for a way to change your computer’s IP address from the command prompt? Are you a big fan of command line utility in Windows 7? Well, you can quickly change your Computer’s IP using some simple commands. In this post, I will explain the steps to achieve this.
As we all know, it is easy to change your computer’s IP by accessing Network Properties in Control Panel. But the sad truth here is, you need to click-through some different dialog boxes and windows. To make this as a simpler task, you can change the IP address with some simple commands using Command Prompt, which is one of the great Network utilities of Windows.
Steps To Change Computer’s IP From Command Prompt:
Step 1: First, you need to open the command prompt with administrator privileges. Go to Windows and type cmd in the search box. Right click on the link that appears and select “Run As Administrator” from the context menu.
Step 2: The command prompt window will open up now with administrator privileges as shown below.
Step 3: To view the full name of the network interface for which you wish to change the IP address, type the following command in command prompt and hit Enter.
netsh interface ipv4 show config
You can also copy the command and paste it in Command Prompt. To paste the command in command prompt, right-click inside the command prompt and select Paste.
Step 4: This command will list all the IPv4 network interface configurations of your PC. Replace IPv4 with IPv6 if you wish to list the configuration of IPv6 interface.
Step 5: Locate the interface you are looking for. In this case, it is “Wireless Network Connection“. Note down the exact name of the interface for which you are going to change the IP address.
Step 6: Now to change the IP address, default gateway, and the subnet mask of the selected interface, type the command given below and hit enter.
netsh interface ipv4 set address name=”YOUR INTERFACE NAME” static IP_ADDRESS SUBNET_MASK GATEWAY
Here YOUR INTERFACE NAME specifies the exact name of the interface you noted in step 5, IP_ADDRESS specifies the new IP address that you wish to set for the interface, SUBNET_MASK specifies the net mask of the selected IP range, and the GATEWAY specifies the default gateway to the specified IP range.
For example in our case the above syntax will be,
netsh interface ipv4 set address name=”Wireless Network Connection” static 192.168.0.8 255.255.255.0 192.168.0.1
Step 7: If you wish to use an IP address that is assigned automatically by the DHCP server, enter the following command.
netsh interface ipv4 set address name=”YOUR INTERFACE NAME” source=dhcp
Replace YOUR INTERFACE NAME with the exact name you got in step 5.
This will now assign the IP address automatically from the DHCP server.
If you encounter any issues while following this tutorial, do let me know using the comments section below.