My Ubuntu Experience: Networking

November 16, 2006 – 00:26 | LAMP, Ubuntu

The Marvell Yukon Gigabit onboard NIC coming with my ASUS motherboard had some problem hooking up with the DLink router. You would think, when both devices are 100baseT by default, the auto link speed negotiation ought to have been a mere formality. But, everytime after the system just boot up, it would take anywhere between 5 seconds to 30 minues for the two to shake hands and achieve a viable link. The visible symptom is the DHCP requests kept getting ignored, and in turn no IP can be obtained from the router for the system.

In Windows, I had to go to the driver configuration, disable the "auto sensing", and explicitly set the NIC to 100baseT. In Ubuntu, this is done by adding the following script to /etc/network/if-pre-up.d:

CODE:
  1. #!/bin/sh
  2.  
  3. ETHTOOL=/usr/sbin/ethtool
  4.  
  5. if [ ! -x $ETHTOOL ]; then
  6.   exit 0
  7. fi
  8.  
  9. if [ "$IFACE" = "eth0" ]; then
  10.   echo disabling $IFACE auto negotiation
  11.   $ETHTOOL -s $IFACE autoneg off
  12. fi

Everytime when the network interfaces are initialized, this script (along with everything else in that if-pre-up.d directory) is executed before dhcpclient is involved.

Update:
Use sudo ifdown -a to bring down all interfaces, and sudo ifup -a to bring them back up.

Trackback from your site, or follow the comments in RSS.
  1. 1 Trackback(s)

  2. Apr 25, 2007: The Path to Zen » Blog Archive » Ubuntu Network Manager - Feisty… Fowl-up?

Post a Comment