Categories Menu
Repair Center
24 hours online support we repair all types of laptops and relating to LCD screen,motherboard, DC adapter, power supplies and so much more! The shop reliable laptop repair in Ottawa area since 1995. Repair your laptop as easy as 1-2-3 !
computer_25
Services for your location
How to change IP address from the Windows command line
print
report error
add to favorites
write a review
send to friends
suggest a topic
register

I recently needed a quick and easy way to change the IP address of my Windows XP workstation. I had to reproduce a problem where the IP address of the client program (which runs on Windows) changes in the middle of a communication session with the server program. Such a thing could happen, for instance, when the client's DHCP lease expires and renewal results in a new address being allocated.

I wanted to do this quickly and easily - the first solution that popped into my head was simply to toggle the configuration of the network interface between using DHCP as normal and a static IP. This can be done via the Network Connections applet in the Control Panel, but is rather involved. It's certainly not quick or easy.

To do the same thing via the command line, use the netsh tool.

After some experimentation, I found that the following two commands were sufficient to give my machine a static IP address and have everything still work ok. The "interface ip set address" command changes the IP to 192.168.1.101 (this address is outside the range allocated by our DHCP server, therefore it will be different to what we had before) and I also had to provide the subnet mask (255.255.255.0), default gateway (192.168.1.5) and a gateway metric. The second command explicitly sets the DNS server to use for name resolution - normally this is done for us by the DHCP server.


netsh interface ip set address "Local Area Connection" static 192.168.1.101 255.255.255.0 192.168.1.5 1
netsh interface ip set dns "Local Area Connection" static 192.1

prev
1
Other newly Articles from the Multimedia, Network ,Wi-Fi and Web - Web Guide / Internet Category:
  1. Run multiple sites from the same code base (multi-site)
  2. How to repair hijacked and juggled IE homepage?
  3. MSN error codes(1)
  4. Unscramble Facebook—from design principle to architecture system
  5. Trick To Increase Browsing Speed for IE and Firefox
  6. How to disable Back button in Internet browser
  7. Internet Explorer Freezes Up
  8. How to Avoid False or Misleading Internet Advertising
  9. How to Create Multiple User profiles in FireFox on Mac OSX
  10. How to Limit internet access to users?
  11. How to Change the Font size of Web page?
  12. Add and remove Internet Explorer 8 add-ons
  13. 8 tips for handling email effectively
  14. How to Fix Broken and Slow Tab Issues in Internet Explorer 8
  15. How to Speed Up a Slow Internet Connection
Custom Search
Examples: HP,laptop Rapair,LCD,DC Backlight,Inverter,solder
Article Comment:Replies(0)Views
Name(required):        Email(required):  
Verify: key
Use the above information at your own risk
Loading ... Loading ...