Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am working on an embedded system running Linux. There is a USB ethernet adapter that can be attached to this system for debugging purposes. I would like this adapter to automatically request an IP address whenever it is active with a link (on boot, or when plugged in to a running system).

This particular system is running a derivative of RedHat EL 5, and I tried simply configuring this adapter in the /etc/sysconfig/network-scripts/ifcfg-ethx file, however this only works if the adapter is present on boot, and the link is active. I would prefer not to delay the boot if the DHCP server is not available.

Ideally, the solution will start trying to get an address as soon as the adapter is present and the link is active, and continue trying forever. I believe Network Manager would do this, but I don't want to install it and it's dependencies on this system. I've tried using dhcpcd and plain old dhclient, but there doesn't appear to be any way to have them continue trying after initially failing to get an address, and dhcpcd does not daemonize until after it gets an address.

I thought of writing a shell script, but there doesn't appear to be any way to get notified when the link becomes active for an interface.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

Look like ifplugd do what you want to do. Haven’t use it, so can’t give more informations.

share|improve this answer
    
Thanks, that was exactly what I was looking for. –  Jason Martens May 13 '11 at 20:03
add comment

ifplugd or netplug are standard solutions for this.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.