You know the problem… Whenever you connect to a new network you have to configure your notebook. This is really annoying, especially when working in different networks daily. There are a lot of methods to solve this problem, but I was always too lazy to find out which is the best. “Why can’t I do this with system tools”, I always asked myself. Well, I can do it with system tools, reading manpages is sometimes helpful 
Package ifupdown has a feature called mapping, which allows to have something like profiles (man interfaces). Thus we can define different network setups:
auto eth0
mapping eth0
script /etc/network/ping-places.sh
map 192.168.0.90/24 192.168.0.42 home
map 192.168.0.90/24 192.168.0.100 sevian7
#
# Profile sevian7
#
iface sevian7 inet dhcp
up cp /etc/resolv.conf.sevian7 /etc/resolv.conf
up cp /etc/apt/sources.list.sevian7 /etc/apt/sources.list
#
# Profile home
#
iface home inet static
address 192.168.0.90
netmask 255.255.255.0
gateway 192.168.0.1
up cp /etc/resolv.conf.annenhof /etc/resolv.conf
We could know start such a profile with the following command
ifup -v eth0=home
This is only useful for testing because ifup can automatically detect your wanted profile. How does this work?
The shell script /etc/network/ping-places.sh fires up eth0 with IP address 192.168.0.90. It then tries to ping 192.168.0.42 and if this ping is answered ifup starts the profile home. If the ping fails fails the next mapping is read and we now ping 192.168.0.100.
I’m using this scheme for about six months now with about ten different profiles by pinging the gateways or other computers in the networks. It works pretty cool, except in networks where I ping the gateways, which most times have the same IP address 192.168.0.1. That’s why I sometimes have to ping other workstations, which might be offline. A good solution would be using arping instead of ping, but I was too lazy again for that 
BTW: ping-places.sh is located in /usr/share/doc/ifupdown/examples (at least on Debian)