Purpose

I wanted to be able to just turn my laptop on and have it automagically figure out what network it was connected to as well as setting everything up that needed to be set up.

I also became quite annoyed at waiting for (or ctrl-c) eth0's dhcp to timeout whenever the cable wasn't plugged in. Basically, I wanted it to figure out for itself whether or not a cable was plugged in.

I've seen all kinds of laptop-wandering programs around, but I knew that ifupdown was the real tool to handle this sort of thing. Unfortunately, ifupdown is also rather confusing and almost completely undocumented. Here's my attempt to clear up some of the fog.

Platform

I figured out everything offered here under Debian / Testing on my VPR Matrix 220a5 in a couple hours between classes

Solution

To set up mapping, the interfaces(8) man page offers this example:

auto lo eth0 iface lo inet loopback mapping eth0 script /usr/local/sbin/map-scheme map HOME eth0-home map WORK eth0-work iface eth0-home inet static address 192.168.1.1 netmask 255.255.255.0 up flush-mail iface eth0-work inet dhcp

The main problem with this example is that it doesn't work. More specifically, the mapping lines don't work. The map line is supposed to take the "HOME" or "WORK" output by the map-scheme and given that run the appropriate eth-[whatever] block. It doesn't do this. What it does do is complain:
wlan0=SCHOOL interface not found
or something along those lines. It's dumb. Anyway, as the best way to learn just about anything is by example, here are my /etc/network/interfaces, map-scheme, and my script which checks link status before attempting to bring up an interface.

Last updated: Sunday, 20-Sep-2009 16:55:45 CDT

Contact me at randall dot will at gmail dot com

Hobbies

Vintage Motorcycles

Networking

Facebook
LinkedIn

Presence

Ubuntu
Discount ASP.NET
CPAN
p2p Wrox
Roundcube
Freshmeat
Blogger
uShip
Psychology Software Tools
Virtual Corvair Club
Chopper Charles
Live Journal

Thoughts

Borrowed Philosophy
Historical Histrionics
Current Histrionics

Old Projects

Motorola V400 / Linux
HP ZE4200 / Linux
VPR Matrix 220a5 / Linux
FreeRadius Accounting / Linux
LDAP / FreeRadius Auth / Linux
Remote MySQL / OSX
Stewie Radio Automation
Wireless Wandering Done Right
DynDNS: TinyDNS / OpenSSH
Xilinx WebPACK 6.3 / Wine
Xilinx WebPACK 7.1 / Debian
Apache 301 Redirection
Using Your Debian Cache
Google AdSense
Gnome AdSense Monitor
Pixlatch Gallery Generator
C#.NET Tips & Tricks
Ubuntu Breezy Clockmod Bug