Score:0

Ubuntu 22.04 - Intel X550 - Run a pre-up command to set ethtool network interface parameters at startup

cn flag

Following the question at: https://askubuntu.com/questions/1406445/ubuntu-22-04-server-intel-x550-advertised-speed-not-correct I need to run a command at startup so that the necessary changes are permanent. From the Intel drivers documentation (https://downloadmirror.intel.com/727507/readme.txt), the command is:

pre-up ethtool -s <ethX> advertise 0x1800000001028 || true

I tried to write the command in various files, without success.

Where should I write it ?

Edit 1: Following Anton Danilov's answer, I did not find how to set up a solution with sytemd.link, but I found a different way by creating a service in

/etc/systemd/system

as explained here: https://bbs.archlinux.org/viewtopic.php?id=262075

It works, but is it the optimal way for Ubuntu 22.04 (the link above is a solution for archlinux and is from 2018) ? If no, could someone please provide a complete working solution for Ubuntu Server 22.04 ?

Score:0
es flag

Since you are using Ubuntu Server 22.04 I am going to guess you are using netplan with systemd-networkd as the "renderer".

You could try putting a script in /etc/networkd-dispatcher/configuring.d. E.g.

mkdir -p /etc/networkd-dispatcher/configuring.d/
install -m 0755 /dev/null /etc/networkd-dispatcher/configuring.d/x550
cat <<EOF > /etc/networkd-dispatcher/configuring.d/x550
#!/usr/bin/env bash

ethtool -s <ethX> advertise 0x1800000001028 || true
EOF

I chose configuring.d based on the Netplan hook table mapping. Another state might work better.

other links

Score:0
cn flag

The recent versions of ubuntu use the netplan network configuration tool. Unfortunately it lacks the setting of the advertising of speed modes. So you can switch to usage of networkd directly without this wrapper.

For networkd you should edit the .link file and set the Adevertise option. See the man systemd.link.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.