Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting up 2 locations with different TCP/IP settings on the same PC.

Status
Not open for further replies.

Chrismenzies

Technical User
Oct 2, 2003
165
0
0
GB
Hi All.

I have a laptop that requires TCP/IP settings for 2 different locations.

At the moment I am having to leave the user with instructions of how to change the TCP/IP setting depending on which company site they are at.

Is there a way that I can either set a second Local Area Connection that uses the same network card as the original Local Area Connection..........

OR......

Could I ask the user to log onto the laptop as Workstation Only, and then double-click on a shortcut on the desktop that would configure the laptop's TCP/IP settings depencing ofn their location?

I look forward to any replies.
 
I set up a script ages ago that changes the ipsettings - found the answer on the internet somewhere.

It involed the command: 'netsh' - use 'netsh /?' for help.

I can't remember creating all the file below, but it came from somewhere!

#========================
# Interface configuration
#========================
pushd interface

reset all


popd
# End of interface configuration



# ----------------------------------
# Interface IP Configuration
# ----------------------------------
pushd interface ip


# Interface IP Configuration for "Local Area Connection"

set address name = "Local Area Connection" source = static addr = [IP ADDRESS] mask = [MASK}
set address name = "Local Area Connection" gateway = [GATEWAY] gwmetric = 1
set dns name = "Local Area Connection" source = static addr = [DNS SERVER]
add dns name = "Local Area Connection" addr = [SECOND DNS SERVER]
set wins name = "Local Area Connection" source = static addr = [WINS SERVER]


popd
# End of interface IP configuration


Amend this (using the help commands in 'netsh' to help understand it!).
You will need two config files, oabviously, one for location A and one for location B.

I then had shortcuts for this on the desktop - I think the user needs Local Admin rights

Sorry its all a bit vauge - good luck!

PS, this was on a W2K workstation.

Thanks, Mark
 
You dont mention the O/S being used but have a look at the TCP/IP properties for your LAN connection. There is a tab called 'alternate configuration' (XP). You can set a second set of IP details here so that if the Laptop is not on one network, it will try the other config instead.

Hope that helps.
 
hop on to the internet and there are many batch-scripts for most OS available.
Also in the new C't Magazine, there is exactly this problem described with lots of code for it on the CD that comes with it.
MarkhP's suggestion of course works very well provided your problem is XP related (as he mentioned).
Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top