Get Social

Using Ethtool on Boot

Written by Scott Holdren | Posted on February 8th, 2006

Ethtool allows you to configure most network drivers with settings such as full or half duplex, speeds of 10 or 100, and auto negotiation. In order to have these settings take affect on boot, you need to add them to the boot process somewhere. There are various approaches for this, but if you use /etc/network/interfaces to configure your network (Debian, Ubuntu, etc), then this is the way to go:

# The primary network interface
auto eth0
iface eth0 inet static
address 10.1.1.11
netmask 255.255.255.0
broadcast 10.1.1.255
network 10.1.1.0
gateway 10.1.1.1
post-up ethtool -s eth0 speed 100 duplex full autoneg off

This will set the NIC at eth0 to 100 full duplex with no auto negotiation. It’s important for the post-up to be the last line. To view the current settings for eth0, just run:

ethtool eth0

The man page for interfaces has more information about the usage of post-up. I assume pre-up would work as well, but I don’t think it makes much of a difference in this case.

Comments