TCP/IP multiple addressing

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

I am looking to find an easy way to change the TCP/IP
settings. I use a portable which travels between work
(hard coded IP address) and home (Automatic IP
addressing). It is becoming a drag having to change to
change the address each time I move - daily!

Is there a way that I can change the address
automatically or at least using a batch file that I can
run depending on location? I cannot find where the
information is stored - apart from the registry, but I
have tried setting up an import/export for the registry
and this does not seem to change the current address.

Any ideas?

jim
 
"Jim" said:
I am looking to find an easy way to change the TCP/IP
settings. I use a portable which travels between work
(hard coded IP address) and home (Automatic IP
addressing). It is becoming a drag having to change to
change the address each time I move - daily!

Is there a way that I can change the address
automatically or at least using a batch file that I can
run depending on location? I cannot find where the
information is stored - apart from the registry, but I
have tried setting up an import/export for the registry
and this does not seem to change the current address.

Any ideas?

jim

Use the "netsh" command in a batch file.

Static:

netsh interface ip set address <connection> static <ip> <mask>
<gateway> <gateway metric>

Dynamic:

netsh interface ip set address <connection> source=dhcp

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 "Local Area Connection" source=dhcp
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 
"Jim" said:
Worked great.

Is there a way that I can also change the automatic DNS
address to a static address?

Thanks

Static:

netsh interface ip set dns <connection> static <DNS server>

Dynamic:

netsh interface ip set dns <connection> dhcp
--
Best Wishes,
Steve Winograd, MS-MVP (Windows Networking)

Please post any reply as a follow-up message in the news group
for everyone to see. I'm sorry, but I don't answer questions
addressed directly to me in E-mail or news groups.

Microsoft Most Valuable Professional Program
http://mvp.support.microsoft.com
 
I have set up two batch files that I can run when moving
the machine between locations and it is working
perfectly!!

Cheers,

Jim
-----Original Message-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top