Windows XP Command-Line Network Configuration
There are times when you need to switch between using DHCP and a fixed IP address for your notebook’s wireless or LAN cable connection. Having to click Start –> Connect To –> Show all connections –> (right-click) Local Area Connection –> Properties –> (double-click) Internet Protocol (TCP/IP) can become cumbersome - or just impossible if you are logged in as a non-Administrator user. Below is how to do it from the Command Prompt.
First, get the connection name (which is usually Local Area Connection or Wireless Network Connection) by typing:
ipconfig
To use a static IP address:
netsh interface ip set address "<connection_name>" static <ip_address> <subnet_mask> <default_gateway> 1
netsh interface ip set dns "<connection_name>" static <preferred_DNS_server>
netsh interface ip add dns "<connection_name>" <alternate_DNS_server>
To use DHCP:
netsh interface ip set address "<connection_name>" dhcp
netsh interface ip set dns "<connection_name>" dhcp
Comments: