Forum Home
Press F1
 
Thread ID: 91424 2008-07-07 00:26:00 Automatic IP configuration based on Wireless LAN for XP Chilling_Silence (9) Press F1
Post ID Timestamp Content User
685906 2008-07-07 00:26:00 Hey all,

So Im out & about a *lot* and when I am, Im always connecting via Wireless to the internet. Different places use different LAN settings.

Basically its fine under Ubuntu, I just have a .sh script I run and it'll change my IP / route settings (DNS is always the same) but I have nothing like this for me when I reboot and fire up XP which allows me to quickly / easily say "Use this static IP" or "Try DHCP".
Is there any app that'll do this?

Cheers


Chill.
Chilling_Silence (9)
685907 2008-07-07 00:43:00 Can't you just set your wireless connection to obtain IP and DNS automatically.
In properties of Internet protocol TCP/IP
Safari (3993)
685908 2008-07-07 00:46:00 I know there's a way of making a batch file (or two batch files) to do that for you, but I'm not sure on how. wratterus (105)
685909 2008-07-07 00:50:00 The problem is if I go to 4 different places in 1 day, one requires a static IP of:
192.168.1.X & a gateway of 192.168.1.254
Another uses DHCP
Another uses 192.168.123.X & a gateway of 192.168.123.2
And at home, I have a static IP so the shares on this laptop are availlable to the rest of the family.

DHCP just isnt an option unfortunately except for 1..
Chilling_Silence (9)
685910 2008-07-07 00:55:00 A program like NetSetMan www.netsetman.com
or NetChanger www.freedownloadscenter.com Haven't tried either though.

I would use a script myself. Haven't used this either but I have the same problem at times and this would be the way I would try first. I might even try later in the day.

Got the below from www.experts-exchange.com

Fatal_Exceptions answer is extremely thorough, and using the "dump" option is the better way to go.. However, if you want specific examples of netsh batch files, I have included 2 below. Both run then display current config and pauses for you to view. You can remove the last 2 lines. 1st is for static IP, second for DHCP. Substitute your values/IP's as necessary. The network connection name is assumed to be the default "Local Area Connection".

************************************************** *
rem Reset network Settings for static IP
netsh interface ip set address name = "Local Area Connection" source = static addr = 10.0.0.99 mask = 255.255.255.0
netsh interface ip set address name = "Local Area Connection" gateway = 10.0.0.254 gwmetric = 1
netsh interface ip set dns name = "Local Area Connection" source = static addr = 24.222.0.1
netsh interface ip add dns name = "Local Area Connection" addr = 24.222.0.2
netsh interface ip show config
pause

*************************************************

rem Reset network settings for DHCP
netsh interface ip set address name = "Local Area Connection" source = dhcp
netsh interface ip set dns name = "Local Area Connection" source = dhcp
netsh interface ip set wins name = "Local Area Connection" source = dhcp
netsh interface ip show config
pause
berryb (99)
685911 2008-07-07 01:08:00 berryb, thanks that looks perfect!!

Will mess around with it later tonight :)

Cheers!
Chilling_Silence (9)
685912 2008-07-07 02:55:00 berryb, thanks that looks perfect!!

Will mess around with it later tonight :)

Cheers!

When you enable DHCP on Windows XP, there's a tab along the lines of "Alternative IP configuration", where you can specify a static IP. That way, it'll try DHCP, and if it can't get an address, will revert to what you have set.
somebody (208)
685913 2008-07-07 11:45:00 Yeah the problem is on two of the LANs I use, it gets a DHCP address but using that IP range doesnt give you internet... so I *have* to manually override :(

Tested that today berryb, worked brilliantly! Thanks!!
Chilling_Silence (9)
685914 2008-07-08 05:52:00 Great will have to try myself now! berryb (99)
1