10.8.3 Triggering network configuration – ifplugd
The ifplugd daemon brings an interface up or down according to
whether or not its underlying hardware is plugged in to a network. The program
can detect a live cable connected to an Ethernet interface or an access point
associated to a Wi-Fi interface (although waproamd is probably
what you want to use in the latter case). When ifplugd sees that
the state of the link has changed it runs a proxy script which by default calls
ifup or ifdown.