If restarting systemd-networkd service takes no effect after making changes to a configuration file, it's probably because you didn't prefix your configuration file with a number.

The .network files are read from the files located in the system network directories /usr/lib/systemd/network and /usr/local/lib/systemd/network, the volatile runtime network directory /run/systemd/network and the local administration network directory /etc/systemd/network. All configuration files are collectively sorted and processed in alphanumeric order, regardless of the directories in which they live. However, files with identical filenames replace each other. It is recommended that each filename is prefixed with a number (e.g. 10-eth0.network). Otherwise, the default .network files or those generated by systemd-network-generator.service may take precedence over user configured files. Files in /etc/ have the highest priority, files in /run/ take precedence over files with the same name under /usr/. This can be used to override a system-supplied configuration file with a local file if needed.

Here are details regarding the network configuration files for systemd-networkd:

  • File extension: .network
  • File location: /etc/systemd/network/
  • Naming convention: [priority]-[interface].network, with [priority] being used to order the files and [interface] being used to associate a file with a particular interface