Ethernet Hotplug

DRAFT ONLY

For mLinux version 4.0 or higher:

Overview

Ethernet hotplug will cause an ethernet interface to be brought down when the link is lost, and brought back up when the link is acquired on an ethernet port.

Normally, when the ethernet port is brought up, if the interface is configured for DHCP, a DHCP request will be made. If the ethernet port or DHCP server on that network is not ready at the time of boot, the DHCP client server will terminate, and the device will need rebooting to acquire it’s IP address.

With ifplugd configured, if the link is not present at boot, the IP address will be acquired later when the link becomes available.

MTCDT may have up to two ethernet ports.

Only the first ethernet port is configured for ifplugd by default.

To disable ifplugd (not recommended), edit /etc/default/ifplugd, and change yes to no:

ENABLED="yes"

The configuration for ifplugd is in /etc/ifplugd directory:

$ ls -1 /etc/ifplugd
eth0.conf
eth1.conf.example
ifplugd.action

ifplugd.action is a shell script that is executed when the link goes up, or when it goes down. The user is free to write his own script, if something else is needed.

The script is configured in the *.conf file. One *.conf file is created for each interface that requires ifplugd. eth1.conf.example is an example that may be used if eth1 is present. To use the example, create the eth1.conf file:

$ cd /etc/ifplugd
$ sudo cp eth1.conf.example eth1.conf
$ sudo chmod 744 eth1.conf

Here is the eth1.conf file:

INTERFACE="eth1"
ARGS="-fI -i ${INTERFACE} -u 0 -d 10 -r /etc/ifplugd/ifplugd.action"

ARGS are the arguments to the ifplugd daemon. The script /etc/ifplugd/ifplugd.action may be replaced by a user written script if desired. The script must have execute permission.

The ifplugd documentation can be found here:

Busybox documentation for ifplugd