switching between two network configurations

2002-12-10 Thread Jörg Johannes
Hi List

With my laptop, I'd like to access two different networks (depending on 
where I am): My home network and university network.
At home, my IP is 192.168.0.99 and hostname shold be horchloeffel, at 
university the IP and hostname are set to other fixed values. What I'd 
like to do is choosing at boot-time which network configuration to load. 
Is it possible to write a shell script that is invoked by a lilo 
parameter? It would have to set the hostname, the nameservers and the IP 
adress according to predefined values (should be simple to write two 
configurations, say /etc/hostname.uni and /etc/hostname.home, one of 
which is copied to /etc/hostname and so on).
Is this possible, or are there other (better) solutions for doing this task?

Thanks
joerg


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: switching between two network configurations

2002-12-10 Thread Christoph Simon
On Tue, 10 Dec 2002 11:54:45 +0100
Jörg Johannes [EMAIL PROTECTED] wrote:

 Hi List
 
 With my laptop, I'd like to access two different networks (depending on 
 where I am): My home network and university network.
 At home, my IP is 192.168.0.99 and hostname shold be horchloeffel, at 
 university the IP and hostname are set to other fixed values. What I'd 
 like to do is choosing at boot-time which network configuration to load.

Have a look at man interfaces, particularly for the mapping
facility. Also, in /usr/share/doc/ifupdown/examples, you should find
an example for something very similar.

-- 
Christoph Simon
[EMAIL PROTECTED]
---
^X^C
q
quit
:q
^C
end
x
exit
ZZ
^D
?
help
.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: switching between two network configurations

2002-12-10 Thread Matthias Hentges
Hi Jörg!

Am Die, 2002-12-10 um 11.54 schrieb Jörg Johannes:


 With my laptop, I'd like to access two different networks (depending on 
 where I am): My home network and university network.
 At home, my IP is 192.168.0.99 and hostname shold be horchloeffel, at 
 university the IP and hostname are set to other fixed values. What I'd 
 like to do is choosing at boot-time which network configuration to load. 
 Is it possible to write a shell script that is invoked by a lilo 
 parameter?

I've never tried that with Debian but with SuSE every kernel-parameter
is send as a parameter (dunno which $x) to all rc-scripts.

So in theory you can edit /etc/init.d/networks to parse $*. And if
$* contains uni or something like that, it sets up the hostname and
IP with respect to the parameter.

Also when using PCMCIA network cards switching between two or more
network setups is *very* easy.

Have a look at /etc/pcmcia/network.opts and to a man cardctl (look for
scheme).

If network.opts is set up correctly you can switch your network
environment as easy as cardctl scheme $NAME_OF_ENVIRONMENT.


  It would have to set the hostname, the nameservers and the IP 
 adress according to predefined values (should be simple to write two 
 configurations, say /etc/hostname.uni and /etc/hostname.home, one of 
 which is copied to /etc/hostname and so on).
 Is this possible, or are there other (better) solutions for doing this task?

Yes: cardctl, see above (but only if you use PCMCIA).

-- 

Matthias Hentges
[www.hentges.net] - PGP + HTML are welcome
ICQ: 97 26 97 4   - No files, no URLs

My OS: Debian Woody: Geek by Nature, Linux by Choice



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: switching between two network configurations

2002-12-10 Thread Gary Hennigan
Jörg Johannes [EMAIL PROTECTED] writes:
 With my laptop, I'd like to access two different networks (depending
 on where I am): My home network and university network.
 At home, my IP is 192.168.0.99 and hostname shold be horchloeffel,
 at university the IP and hostname are set to other fixed values. What
 I'd like to do is choosing at boot-time which network configuration to
 load. Is it possible to write a shell script that is invoked by a lilo
 parameter? It would have to set the hostname, the nameservers and the
 IP adress according to predefined values (should be simple to write
 two configurations, say /etc/hostname.uni and /etc/hostname.home, one
 of which is copied to /etc/hostname and so on).
 Is this possible, or are there other (better) solutions for doing this task?

It pays to know how to use Google Groups!

http://groups.google.com/groups?safe=imagesie=UTF-8oe=UTF-8as_ugroup=*debian*as_usubject=laptop%20environment%20detectionlr=lang_ennum=100hl=en

This should net you a thread started by Martin Krafft on this very
subject about a month or two ago. He surveyed quite a few utilities
with the capabilities you desire, and more.

Gary


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]