ifplugd and ethernet device configuration

Posted: November 8, 2010 in Administration, Debian, Debian package
Tags: , ,

How to configure dynamically your  ethernet device when a cable  is plugged or unplugged ?

Ifplugd is a solution. It provides a daemon which configures your ethernet device when a cable is plugged and de-configures it when a cable is pulled out.

For Debian, to install it :

root@localhost:~# apt-get install ifplugd

Initially, to configure it, the use of /etc/ifplugd/ifplugd.conf file is deprecated. Instead, add your ethernet device, eth0 (often the default name) into the /etc/default/ifplugd file:

Interfaces=”eth0″

Make sure that the /etc/network/interfaces file looks like this  :

root@localhost:~# cat /etc/network/interfaces

auto lo
iface lo inet loopback

iface eth0 inet dhcp

Make sure you have removed the stanza “auto eth0″ below otherwise ifplugd will not work properly.

root@localhost:~#/etc/init.d/ifplugd restart

Look at your syslog’s file for messages sent by ifplugd :

ifplugd 0.28 initializing.
ifplugd(eth0)[12701]: Using interface eth0/6C:F0:49:17:1E:2E with driver <r8169> (version: 2.3LK-NAPI)
ifplugd(eth0)[12701]: Using detection mode: SIOCETHTOOL
ifplugd(eth0)[12701]: Initialization complete, link beat detected.
ifplugd(eth0)[12701]: Executing ‘/etc/ifplugd/ifplugd.action eth0 up’.
ifplugd(eth0)[12701]: client: /sbin/ifup: interface eth0 already configured
ifplugd(eth0)[12701]: Program executed successfully.

More information about ifplugd : http://0pointer.de/lennart/projects/ifplugd/

About these ads
Comments
  1. Pavan says:

    Fisrt thank for the such a nice information

    I install ifplugd on embedded board and edit the /etc/network/interface as you mentioned, for me it’s working fine, when i run on manually on shell /etc/init.d/ifplugd start but i want to start this daemon manually ,

    when run that daemon using crontab at bootup its not working properly.
    and after that i try to run on shell ifup eth0 it’s giving the message,

    ifup: interface eth0 already configured

    but when i run daemon manually its working fine.

    Please help

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s