The systemd's systemd-networkd service enables to setup a networks using the .network unit files. However, as far as it is documented in the official man page (man systemd.network) it allows to configure a static IP address, but it does not specify how to set the subnet mask. How can do that using the systemd mechanism?


Found it:

in the [Network] section, where you configure the IP address (Address=) you can add the subnet mask by adding a / to it, and the subnet mask bit count afterwards. For instance, to configure the IP adress with subnet mask you would put it as following:


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.