I have a problem with hotplug ethernet in an embedded Linux (ver 3.6.0-rc5). If the network cable is connected during boot everything works fine. But if I connect the cable after boot I do not get an IP address.
My /etc/interfaces look like this:
# The loopback interface
auto lo
iface lo inet loopback
# Wired or wireless interfaces
allow-hotplug eth0
iface eth0 inet dhcp
My startup script includes this command:
ifup eth0
If the ethernet cable is connected at boot I get this after calling 'ifup eth0':
[ 10.257995] davinci_mdio davinci_mdio.0: resetting idled controller
[ 10.265319] net eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=davinci_mdio-0:00, id=7c0f1)
udhcpc (v1.19.4) started
Sending discover...
[ 12.261260] libphy: davinci_mdio-0:00 - Link is Up - 100/Full
Sending discover...
Sending select for 192.168.86.100...
Lease of 192.168.86.100 obtained, lease time 86400
adding dns 192.168.86.1
If the ethernet cable is not connected at boot I get this after calling 'ifup eth0':
[ 10.230285] davinci_mdio davinci_mdio.0: resetting idled controller
[ 10.238037] net eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=davinci_mdio-0:00, id=7c0f1)
udhcpc (v1.19.4) started
Sending discover...
Sending discover...
Sending discover...
No lease, failing
If I then connect the ethernet cable I get this:
[ 346.232391] libphy: davinci_mdio-0:00 - Link is Up - 100/Full
But I do not get an IP address.
So, it appears that Linux knows that the cable got connected, but it doesn't automatically ask for an IP address.
Note: If I do not call ifup during boot then nothing happens when I connect the ethetnet cable.
When the cable is connected I can get an IP address by doing this:
ifdown eth0
ifup eth0
Do I have to tell Linux to look for an address (e.g. ifdown/ifup)?
And if so: how do I do that?