Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

moving laptop between networks

Posted on 1999-07-15
8
Medium Priority
?
289 Views
Last Modified: 2010-04-20
i have a laptop with Redhat 6.0 installed and it is connected to my network at home (this all works fine so far)

PROBLEM:
i take my laptop to client sites, such as the one where i am currently contracting and often need to connect to their network.

Given that i have all the relevant information about their network such as ip addresses, netmasks, network names, etc.
what is the recommended way to configure my laptop so that i can switch it on and boot into the right choice for the network that i am connected to?

basically i don't want to have to edit the
/etc/HOSTNAME
/etc/hosts
/etc/resolv.conf
/etc/printcap
and probably some other files every time i change network
but would instead like to set up a profile for each network that i connect to.

plus can you advise on what services that i should be sure to turn off before connecting to their network so that i don't interfere with their network.

So far the only documentation specific to this problem that I can find is some old information on a program called netenv (plus loads of general info such as NAGs HOWTOs etc)

Any help would be appreciated,
cheers
Kie
0
Comment
Question by:kie27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 2

Expert Comment

by:helver
ID: 1635389
Do you have dhcp available at work and at home?
0
 

Author Comment

by:kie27
ID: 1635390
no, neither at work nor at home,

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1635391
AFAIK, the simplest way to do it, is to write a script like:

route flush
ifconfig eth0 down
ifconfig eth0 <IP-address> netmask <netmask> broadcast <broadcast> up
route add -net 127.0.0.0 dev eth0
route add -net <net for IP-address>
route add -net default <gateway>
mv /etc/resolv.conf{,.old}

You don't need to change /etc/printcap when connecting to another network, just add all printers you like.
awk '/^nameserver/{print "nameserver <IP-of-nameserver>"}' /etc/resolv.conf.old > /etc/resolv.conf
kill -1 <pid of named>   # or better restart named

0
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

 
LVL 1

Expert Comment

by:yk030299
ID: 1635392
listen
0
 
LVL 4

Expert Comment

by:gunny051499
ID: 1635393
the hangup signal for named will work beautifully, but when doing everything from out of a script, it will be easier to do it with "ndc restart". putting everything in a script, as ahoffman suggested, and including the call of awk and ndc will give you everything you need.

boot up your system, call the script, done.

don't worry about your services. generaly, they will not "go out on the network and disturb the others". the are resident on your host and activated only if requested from YOUR ip.
0
 

Author Comment

by:kie27
ID: 1635394
Thanks for the help.  I will create the scripts as suggested
including the awk and ndc restart.

Does the comment about services also hold for sendmail or
do I need to be more careful with this?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1635395
as long as there is no change needed in sendmail.cf, you don't need to take care about sendmail (it is usually configure to use DNS).
0
 
LVL 1

Accepted Solution

by:
Rabs earned 200 total points
ID: 1635396
recently I found some script on www.linuxapps.com about it, a set of script that you can use like this:

 setneton client1
 setnetoff client1
 setneton client2
 ....


Take a look at linuxapps, I don't remember the name now, sorry
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question