Wednesday 29 June 2011

How to change (in windows) the ip address (and so on) from command line

List the network connection and its settings
netsh interface ip show config
also
ipconfig
also 
ipconfig /all

Change a static address
netsh interface ip set address name="Wireless Network Connection" static 192.168.0.96 255.255.255.0 192.168.0.240 1
If you get the error The object already exists. check if other network connection has this ip address.

Change to DHCP
netsh interface ip set address name="Wireless Network Connection" dhcp

Change the DNS servers to static
cannot be done  by netsh !!! or with other easy way, You can change it with dnscmd command that is available in support.cab of you system’s installation cd. For more read http://technet.microsoft.com/en-us/library/cc778513%28WS.10%29.aspx (good luck... microsoft is there).
On the other hand, you may use one of the free dns servers (world wide, domain wide), read http://itfailed.blogspot.com/2011/06/free-public-dns-server.html.

change the DNS servers to DHCP
netsh interface ip set dns "Wireless Network Connection" dhcp

No comments:

Post a Comment