Comment 1 for bug 9138

Revision history for this message
Greg Norris (haphazard) wrote : Re: Default dhcp timeout should be shorter

(In reply to comment #0)
> 1- when you have no link, it should fail immediatly (if it's possible to detect).

Here's a (probably non-ideal) workaround for item #1, which I use on my Thinkpad
T42p (Intel 82540EP ethernet controller). It looks like it should work with
most other wired interfaces as well.

Edit /etc/network/interfaces, and make the following changes (I'll attach my
modified version):

1) Find the "mapping hotplug" stanza, and comment out the "map eth0" line.

2) Add "auto eth0" just above the "iface eth0" stanza.

3) Add the following line (replace "[TAB]" with it's namesake) to the end of the
"iface eth0" stanza.

   [TAB]pre-up /usr/sbin/ethtool -t "${IFACE:-eth0}" online | egrep -iq '^link
test.+[^0-9]0$'

This causes ethtool to check the interface status, and aborts bringing it online
if the Link Test portion fails. This seems to work fine as long as the
interface isn't managed by hotplug... the pre-up command is apparently run too
early in that case, and fails because the driver hasn't completed it's
initialization. Hence removing eth0 from the "mapping" clause.

I don't remember if the ethtool package was present by default... I think that I
probably installed it manually.