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.