Great that worked! As I mentioned, I hadn't tried the ExecStartPre, great that you were able to work out that the full path is required. Always a good thing when dealing with systemd.SOLUTION:
To set the mtu automatically during boot using the NetworkManager.service, this works:
In /etc/systemd/system/NetworkManager.service
add the line with ExecStartPre before the ExecStart which is already present. And it looks like this:So relative to the original suggestion the absolute path for the ip module has to be specified. Putting the command part in quotes is not needed.Code:
ExecStartPre=/usr/sbin/ip link set eth0 mtu 9000ExecStart=/usr/sbin/NetworkManager --no-daemon
It is recommended not to edit the service file with an editor but in stead to use the systemctl itself to edit this file like this:
$ sudo systemctl edit NetworkManager.service
in which case an overlay file is created (follow the instructions given by the tool)
Alternatively To edit the master file /etc/systemd/system/NetworkManager.service and not the overlay, use
$ sudo systemctl edit --full NetworkManager.service
Thanks again bls for this and the /etc/rc.local suggestion.
Where to report the issue with NetworkManager not being able to modify/load a custom mtu despite it is in the configuration file?
Thanks for confirming that it works!
Statistics: Posted by bls — Sat Mar 30, 2024 3:27 am