Do you use your laptop in different network environments? At home? In the office? At a customers site?
If yes, the small package "netenv" might be useful for you. When booting your laptop it provides you with a simple interface from which you can choose the current network environment. The first time in a new environment, you can enter the basic data and save it for later reuse.
Netenv sets up a file containing variable assignments which describe the current environment. This can be used by the PCMCIA setup scheme, e.g. like the one that comes with Debian/GNU Linux and perhaps others.
The netenv data can be used for things like:
Netenv is available at netenv home. It depends on dialog(1) for its menu interface. Netenv was developed by Gerd Bavendiek.
SuSE's System Configuration Profile Management - SCPM software allows you to switch configuration profiles. You can boot directly into one profile and then switch to another profile at run time. This is the successor of SuSE's older "scheme" management software.
ifplugd is a lightweight Linux daemon which configures the network automatically when a cable is plugged in and deconfigures it when the cable is pulled. It is primarily intended for usage with laptops. It relies on the distribution's native network configuration subsystem, and is thus not very intrusive.
divine is an utility for people who use their machines in different networks all the time. "The idea is this:
The point about divine in contrast to other solutions is that other solutions normally use ping or something like that. divine can check a large number of networks instantaneously, assuming that the machines you ping answer within one second (.4 seconds are normal on Ethernets). And pinging an unknown address will do an arp request anyway, so why not do an arp request in the first place?"
From the Networking-HOWTO : "The term IP Mobility describes the ability of a host that is able to move its network connection from one point on the Internet to another without changing its IP address or losing connectivity. Usually when an IP host changes its point of connectivity it must also change its IP address. IP Mobility overcomes this problem by allocating a fixed IP address to the mobile host and using IP encapsulation (tunneling) with automatic routing to ensure that datagrams destined for it are routed to the actual IP address it is currently using."
Dynamics Mobile IP is a dynamical, hierarchical Mobile IP system for Linux operating system. The implementation enables a hierarchical model for IP mobility, thus decreasing the location update times as a mobile host moves. Dynamics system has been designed Wireless LAN technology in mind, and the system has optimized functionality for mobility in WLAN.
See also Linux and Mobile AdHoc Networks - MANETs.
DHCP and BootP are also useful for working in different environments. Please see the DHCP-HOWTO .
The pppd command can be configured via several different files: pppd file /etc/ppp/<your_options> .
How can I have separate PCMCIA device setups for home and work? This is fairly easy using PCMCIA scheme support. Use two configuration schemes, called home and work. For details please read the appropriate chapter in the PCMCIA-HOWTO.
From Martin J. Evans I have taken this recommendation: The first point to note is that init will take any arguments of the form name=value as environment variable assignments if they are not recognized as something else. This means you can set environment variables from the LILO boot prompt before your rc scripts run. I set the LOCATION environment variable depending on where I am when I boot Linux. e.g.
LILO: linux LOCATION=home
LILO: linux LOCATION=work
where failing to set LOCATION means the same as
LOCATION=home (i.e. my default). Instead of typing
LOCATION=place each time you boot you can add an
entry to your
# Linux bootable partition for booting Linux at home # image = /vmlinuz root = /dev/hda3 label = linux read-only # Linux bootable partition config ends # # Linux bootable partition for booting Linux at work # image = /vmlinuz root = /dev/hda3 label = work read-only append="LOCATION=work" # Linux bootable partition config ends
With the example above you can use "linux" for booting at home and "work" for booting at work.
Armed with the facility above, you can now edit the relevant rc scripts to test ENVIRONMENT before running ifconfig, setting up route etc.
There are several other bootloaders which are often overlooked. Besides LILO, have a look at loadlin, CHooseOS (CHOS) (not GPL), GRand Unified Bootloader (GRUB), System Commander and take a look at ftp://metalab.unc.edu/pub/Linux/system/boot/loaders/ . The MicroSoft Windows-NT boot loader or OS/2 boot loader may even be used.
From Steve <steve_AT_cygnet.co.uk> I got a configuration for X Windows with an external monitor: Note that I have introduced a neat trick! For my nice 17" monitor I start X11 with no options and get the default 16-bit 1152x864 display - but when using the LCD screen I specify a 15-bit display (startx -- -bpp 15) and get the correct 800x600 resolution automatically. This saves having to have two X11 config files.
Using a Laptop in Different Environments by Gerd Bavendiek . This article appeared in the August, 1997 issue of the Linux Gazette . This is an excellent, short technical article describing an easy way to setup your Linux notebook to boot into different network and printing configurations, especially useful for those who use their machines at home as well as other locations such as in the office, at school, or at a customer site.