Systemd-neworkd configuration

I’m new to systemd-networkd, and I’m trying to configure some static IPs and routing rules. I see from the clear linux guide that I should add my configurations to a file called /etc/systemd/network/70-static.network

Does the file need to be called 70-static.network? In non-Clear Linux online material about networkd, it seems like the file can be called different names like “static.network” or “20-static.network” or “10-eth0-static.network”.

Also, if I have multiple network interfaces that I need to configure, should I put all the configurations in the 70-static.network file? Or, should I make separate files for each network interface (and if so, what naming convention do I use)?

You should define a separate .network file for each interface.

70-static.network is just an example file name. The examples you gave will work too as long as the extension is .network.

The prefix number just helps load the network configurations in a specific order if needed. This is common convention with systemd configuration files.

From the systemd.network man page:

All configuration files are collectively sorted and processed in lexical order

Pay attention to the numbers, they set the sort order they get load in. The lower the number the sooner it gets loaded, think init startup and shutdown scripts.

Just be sure you are running systemd-networkd as your network manager.

In the past month CL added NetworkManger as an other network manager for Ethernet. You can find more info executing man stateless

1 Like