Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am developing an embedded device based on Linux and Busybox, and trying to make it adaptable to different network configurations. I want to:

1- At boot time, if there is no DHCP reply, use an AutioIP address.
2- At run time, if a DHCP server become available, start using it.

Point 1 seems easy as I can set my eth0 to manual in my /etc/network/interfaces, and set up command to

udhcpc eth0 --now || zcip eth0 /etc/zcip.script

I am not sure of point 2. If I run both udhcpc and zcip daemons simultaneously, would they play well together?

share|improve this question
    
Sounds pretty close to what the avahi project provides –  dawud May 2 '13 at 14:31
    
I am not looking for an AutoIP daemon, there are multiple on the market. My problem is detecting and acting on the presence of DHCP. cnnman see,s promising –  Atilla Filiz May 2 '13 at 14:35

1 Answer 1

You can do this with udhcpc+avahi. Avahi is zeroconf implementation for linux. It provides autoip (giving an address without dhcp) and mDNS (name resolution withoud DNS server).

I got it working in an embedded system with buildroot. There's also a modified udhcpc start script that enable fallback to autoip when dhcp isn't available.

share|improve this answer

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.