-
Possible? [SOLVED]
I was wondering:
Is it, or is it not possible to set all IP details through DOS?
Here is what I am trying to acheive.
My Wireless PCMCIA Card can (obviously) set to DHCP or static. When I am using it for work, mostly is DHCP. But at home I run Static.
I was hoping I could basically double click a script of some sort (batch file-style) that would automatically set either DHCP or my home Static IP details, without any more user intervention. Saves having to go to Network Control Panel, TCP/IP, Properties, etc etc. YOu get me.
Thanks!
HOng
-
Use two different hardware profiles - one for work and one for home.
-
Thats one solution: thanks. I guess i'll use that idea for now.
This is why I like Linux...no bother rebooting, all I have to do is run a script and its all done!!
HOng
-
If you are using Windows XP, you can set the machine to obtain an IP address automatically and configure one alternative static IP. For more information, see the following MS KB Article.
How to use the Alternate Configuration feature for multiple network connectivity in Windows XP
http://support.microsoft.com/default...b;en-us;283676
You can also use the "netsh" command to specify the IP configuration for multiple networks. You can type it a command prompt or include it in a .bat file.
To specify a fixed address:
netsh interface ip set address <connection> static <ip> <mask>
<gateway> <gateway metric>
For example:
netsh interface ip set address "Local Area Connection" static
192.168.0.100 255.255.255.0 192.168.0.254 10
netsh interface ip set address "Wireless Network Connection" static
10.20.30.100 255.0.0.0 10.0.0.1 20
To specify a DHCP address:
netsh interface ip set address <connection> dhcp
For example:
netsh interface ip set address "Local Area Connection" dhcp
How to Use the NETSH Command to Change from Static IP Address to DHCP in Windows 2000
http://support.microsoft.com/default...b;en-us;257748
-
Thanks ecross!!
I have one question.
I made 2 batch files, one for static (home) and one for DHCP. The dhcp one works, but the static one just hangs there.
My suspicsion in the gateway metric... I put it in as 0, but thats a guess. What is it? What does it refer to? Has it anything to do with OSPF type routing?
Thanks
Hong
-
Ok, works now. Just took a while :rolleyes:
But still...what is gateway metric?
-
An explanation of the Automatic Metric feature for Internet Protocol routes
http://support.microsoft.com/default...b;en-us;299540
-