Changing IP configuration from the command line:
================================================
Use:
====
To switch quickly between different network configuration. Particularly useful
for laptop users who frequently change location and network setup.
In Brief:
=========
Us Windows 2000's netsh command line utility and batch files to switch between
network configurations
Terms used through this document:
==================================
"Local Area Connection" - Is the default name of the 'first' network
card/interface in your machine, you may have changed this, if so change the term
throughout the document/batch file also.
When indicating directions to follow each step will be preceded by ">"
Within these directions items in UPPERCASE are items to click on, items in
"quotes" are text to type in.
IP addresses used within this document are for example only. Change where to
appropriate values.
Changing to a dynamically assigned ip(DCHP):
======================================================================
It's likely that in one location you may be able to pick up a DHCP from a local
DHCP server.
If you know this to be the case you may as well use DHCP to pick up the IP
address information dynamically and save yourself some hassle.
To do this at the command line open up a command prompt like so:
>Click START
>Click RUN
>Type "cmd" (without the quotes)
>Click OK
Enter the following text at the command prompt to alter the IP configuration to
dynamically assigned:
>"netsh interface ip set address "Local Area Connection" dhcp"
Changing to a statically assigned IP-Change between IPs:
========================================================
If you wanted to change you IP configuration to the following static IP config:
Static IP: 10.0.0.11
Subnet Mask: 255.255.255.0
Default Gateway: 10.0.0.1
Gateway metric: 1
You'd use this command at the command prompt:
>"netsh interface ip set address "Local Area Connection" static 10.0.0.11
255.255.255.0 10.0.0.1 1"
To change via a batch file:
===========================
To take some of the leg work out of changing between configurations you may wish
to create a batch file to run to change from one configuration to another.
Alternatively you can use:
[setip.cmd]
(file saveas...)
This premade one and customise as you wish.
For example if you create a configuration called "work"
You can run "setip.cmd work"
Or just double click on "setip.cmd" and enter work when prompted for a
configuration set to use.
NOTE:
=====
Changing IP address information requires admin privelledges.