My Ubuntu Experience: Networking
November 16, 2006 – 00:26 | LAMP, UbuntuThe 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:
-
#!/bin/sh
-
-
ETHTOOL=/usr/sbin/ethtool
-
-
if [ ! -x $ETHTOOL ]; then
-
exit 0
-
fi
-
-
if [ "$IFACE" = "eth0" ]; then
-
echo disabling $IFACE auto negotiation
-
$ETHTOOL -s $IFACE autoneg off
-
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.

1 Trackback(s)