4

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?

5

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 1.2.3.4 with subnet mask 255.255.255.0 you would put it as following:

[Network]
Address=1.2.3.4/24
.
.
.
0

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.