Automating IP Change

  • Thread starter Thread starter Scott Thompson
  • Start date Start date
S

Scott Thompson

Is there a way that I can change my IP address with, say,
the click of an icon? Maybe in a dos environment like a
batch file? I have a client/server network internet
connection at work and a DSL at home. I would like to
simplify taking my laptop home and using DSL on it.

Any help would be great!

Scott
 
Because it is easier to use static IPs over a WAN. I have
trouble with DHCP messages traversing over the link. Is
there a way to do it?
 
You've lost me. You need an IP address while you're at work, and you need
one while you're at home. These are two discrete networks. I don't see where
the 'wan' comes into it in this context- even if you're using VPN. Maybe you
can rephrase your question?
 
Scott Thompson said:
Is there a way that I can change my IP address with, say,
the click of an icon? Maybe in a dos environment like a
batch file? I have a client/server network internet
connection at work and a DSL at home. I would like to
simplify taking my laptop home and using DSL on it.

Any help would be great!

Scott

I use a batch file with NETSH.EXE commands. Works quite nicely
_Hans
 
Ah, then I was correct initially. Perhaps you could talk to someone at your
company and show them the wisdom of ditching static IPs. DHCP is the only
way to fly.

The only other option I can think of that doesn't require purchase/config of
third party software is, get a different PCMCIA NIC for each location -
Windows will 'remember' your settings for each card. However, I like to keep
things simple, and don't like installing a bazillion apps on a workstation
for something that can be accomplished, better, with native tools....

Hans' option may well work like a champ - I've never tried it. I use DHCP in
even teeny tiny mom & pop networks.
 
Scott said:
How does the code look? Could you post an example?
here you go:

rem * too lazy to type "Local Area Network" all over again :-)
netsh interface set interface name="Local Area Network" newname="_LAN"
rem *
netsh interface ip set addr "_LAN" static 192.168.0.90 255.255.255.0
192.168.0.254 1
netsh interface ip set dns "_LAN" static 192.168.0.254
netsh interface ip set wins "_LAN" static none
rem * check
netsh interface ip show config
ipconfig /all

more einfo: Knowledge Base article
Q257748 - How to Use the NETSH Command to Change from Static IP Address to
DHCP in Windows 2000

HTH _Hans
 
With windows XP or 2000, in the NIC properties for TCP/IP you can use DHCP
as the default and also config the fixed IP address in the "Alternate
Address" for use at work.
The alternate address is used if no DHCP is found.

Other ways are
using script files (an example was posted in this ng earlier today)
using a MultiNetworkManager such as www.globesoft.com

good luck

"Lanwench [MVP - Exchange]"
 
A way to accomplish this would be to script a netsh command in a batch/cmd
file.

There is also a tool called tcpipparams.exe that can do this, but I believe
both options will require an additional reboot. Not sure, as I haven't
tested. I just use DHCP since I am lazy. :)
--

Best regards,
Brian Oakes, MCSE
Microsoft Product Support
Windows 2000 Server Networking Team

This posting is provided "AS IS" with no warranties and confers no rights.
Please reply to the newsgroup so that others may benefit.
 
Back
Top