From LedHed's Wiki
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
This article describes how to change the IP address of a Windows based computer from the commandline. | This article describes how to change the IP address of a Windows based computer from the commandline. | ||
+ | |||
+ | == Checking Interfaces == | ||
+ | netsh interface ip show config | ||
== Changing Static IP to Obtain from DHCP == | == Changing Static IP to Obtain from DHCP == | ||
netsh interface ip set address "Local Area Connection" dhcp | netsh interface ip set address "Local Area Connection" dhcp | ||
− | == | + | == Changine to Obtain DNS from DHCP == |
+ | netsh interface ip set dns "Local Area Connection" dhcp | ||
− | + | == Changing Static IP == | |
− | + | ||
− | + | ||
− | == Changing Static | + | |
Usage: | Usage: | ||
net sh interface ip set address "Local Area Connection" static ''ipaddr'' ''netmask'' ''gatway'' ''metric'' | net sh interface ip set address "Local Area Connection" static ''ipaddr'' ''netmask'' ''gatway'' ''metric'' | ||
Example: | Example: | ||
netsh interface ip set address "Local Area Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1 | netsh interface ip set address "Local Area Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1 | ||
+ | |||
+ | == Changing Static DNS Server == | ||
+ | netsh interface ip set dns "Local Area Connection" static 192.168.0.1 | ||
+ | |||
+ | == Adding a Secondary DNS from the commandline == | ||
+ | netsh interface ip add dns "Local Area Connection" 192.168.0.2 index=2 | ||
+ | |||
== References == | == References == |
Latest revision as of 18:36, 19 August 2008
This article describes how to change the IP address of a Windows based computer from the commandline.
Contents
Checking Interfaces
netsh interface ip show config
Changing Static IP to Obtain from DHCP
netsh interface ip set address "Local Area Connection" dhcp
Changine to Obtain DNS from DHCP
netsh interface ip set dns "Local Area Connection" dhcp
Changing Static IP
Usage:
net sh interface ip set address "Local Area Connection" static ipaddr netmask gatway metric
Example:
netsh interface ip set address "Local Area Connection" static 192.168.0.10 255.255.255.0 192.168.0.1 1
Changing Static DNS Server
netsh interface ip set dns "Local Area Connection" static 192.168.0.1
Adding a Secondary DNS from the commandline
netsh interface ip add dns "Local Area Connection" 192.168.0.2 index=2
References
How to Use the NETSH Command to Change from Static IP Address to DHCP in Windows 2000 - http://support.microsoft.com/kb/257748