This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to auto execute udhcpc when link up with BeagleBone Black

When BeagleBone Black is booted as DHCP server is connected, BeagleBone Black obtains IP address by udhcpc when

auto eth0

iface eth0 inet dhcp

is described in /etc/network/interfaces.

When DHCP server is connected after Linux is booted, BeagleBone Black can not obtain DHCP IP address. I found BBB can obtain IP address by manual "udhcpc" command, but automatic obtaining is required for the system.

Are there any way to execute udhcpc automatically?

I want to treat following two situation.

1. Link down when udhcpc is executed during boot time. After Linux is booted, RJ45 is connected to the network which DHCP server is exist.

2. Link up but DHCP server is not exist when Linux is booted. After Linux is booted, DHCP server is connected to the network.

For #1, udhcpc can be executed by network connection.

For #2, udhcpc must be executed periodically during IPv4 address is not obtained. (This method also works for #1)

Please let me know the solution for BBB DHCP client.