Gentoo Logo

1.  Network Management

If you and your computer are always on the move, you may not always have an ethernet cable or plugged in or an access point available. Also, you may want networking to automatically work when an ethernet cable is plugged in or an access point is found.

Here you can find some tools that help you manage this.

Note: This document only talks about ifplugd, but there are alternatives such as netplug. netplug is a lightweight alternative to ifplugd, but it relies on your kernel network drivers working correctly, and many drivers do not.

1.  ifplugd

ifplugd is a daemon that starts and stops interfaces when an ethernet cable is inserted or removed. It can also manage detecting association to Access Points or when new ones come in range.

Code Listing 1.1: Installing ifplugd

# emerge sys-apps/ifplugd

Configuration for ifplugd is fairly straightforward too. The configuration file is held in /etc/conf.d/net. Run man ifplugd for details on the available variables. Also, see /usr/share/doc/netifrc-*/net.example.bz2 for more examples.

Code Listing 1.1: Sample ifplug configuration

(Replace eth0 with the interface to be monitored)
ifplugd_eth0="..."

(To monitor a wireless interface)
ifplugd_eth0="--api-mode=wlan"

In addition to managing multiple network connections, you may want to add a tool that makes it easy to work with multiple DNS servers and configurations. This is very handy when you receive your IP address via DHCP. Simply emerge openresolv.

Code Listing 1.1: Installing openresolv

# emerge openresolv

See man resolvconf to learn more about its features.

Page updated December 17, 2013

Summary: For laptop users or people who move their computer around different networks.

Donate to support our development efforts.

Copyright 2001-2014 Gentoo Foundation, Inc. Questions, Comments? Contact us.