0

I'm upgrading my production servers from Ubuntu 14.04 => 18.04 and running into a lot of surprising changes. For example, I'm trying to permanently disable TSO & GSO using ethtool and can't find either /etc/rc.local, or /etc/network/interfaces which used to be there in 14.04 and is also mentioned in this link

How do I achieve this via netplan which seems to be the shiny new way of setting up network infra in Ubuntu 18.04?

Related: How to execute post-up scripts with netplan

2

It should be possible to do this directly in systemd.

Netplan (per its documentation, which you linked to) renders the yaml config you feed it into config files which it then feeds to whatever underlying engine, which may be NetworkManager or systemd-networkd. It puts these files into the appropriate /run directory.

The systemd-link man page has a directive for TCPSegmentationOffload, and one for GenericSegmentationOffload.

Systemd considers files in /etc/ to have the highest priority (higher than /run/) so what should work is placing a .link unit file in /etc/systemd/network/, perhaps called 01-tso-and-gso.link, with the following contents:

[Match]
# Set a match condition appropriate for your use case
Name=*

[Link]
TCPSegmentationOffload=false
GenericSegmentationOffload=false

I haven't tested this; I don't have an easy way to test it; but I've been reading a lot of systemd documentation recently and I'm pretty sure this is what you need. Please let me know whether it works for you.

0

Actually it's not that simple as @Wildcard posted. First of all, there is an error in his Match section. It should be:

[Match]
# Set a match condition appropriate for your use case
OriginalName=*

[Link]
TCPSegmentationOffload=false
GenericSegmentationOffload=false

Secondly, if you add it as 01-tso-and-gso.link in /etc/systemd/network/ it will usually do more harm than good ;] That is because the Match rule will be applied to all interfaces and therefore all other rules for those interfaces (all of them in that case) defined in other files will be ignored. That is because: "The first (in lexical order) of the link files that matches a given device is applied. Note that a default file 99-default.link is shipped by the system. Any user-supplied .link should hence have a lexically earlier name to be considered at all.". So the "nice" effect is for example that the interfaces NamePolicy defined in the 99-default.link file is not taken into consideration - your interfaces names get changed after a reboot, which is usually not what you want ;]

So to make things work, as you probably want, you should:

  • put the [Link] section rules to each existing .link file that affects your interfaces. Those are to be found in: /usr/lib/systemd/network, /run/systemd/network, /etc/systemd/network and in case of eg. Ubuntu in /lib/systemd/network.
  • put the [link] section rules to the default .link file: /lib/systemd/network/99-default.link (thats's in Ubuntu 18.04 - don't know the location in other systems)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.