Sep 14

How to make ethtool settings "stick" on Ubuntu

Category: Linux,Ubuntu   — Published by goeszen on September 14, 2012 at 11:56 pm

On one of my systems I had to set my network to a strange configuration to get reliable connections:

sudo ethtool -s eth0 autoneg on speed 10 duplex half

I did this via ethtool after login, but then, I wanted this setting to be the default, after boot, automatically - I wanted to make the network setting "stick". Normally, on Debian, you setup your interfaces in /etc/network/interfaces, but on this system, running Ubuntu, the eth0 interface was not in /etc/network/interface!

A quick stint to Google brought the answer: I have network-manager installed and then, there are no th0 entries in the file.

So, the only solution is to edit the rc scripts, although this is normally not the way to go, you would do:

iface eth0 inet static
post-up /usr/sbin/ethtool -s eth0 ...
post-down /usr/sbin/ethtool -s eth0 ...

So every runmode properly brings up /brings down the interface. But when running network-manager the only hackish solution is to add the command to /etc/rc.local

Leave a Reply