- List your networking interfaces networkctl. Take note of the device name, for example eth0, eth1
- Change directory to change to /etc/systemd/network and list files. You should see a file named 10-dhcp-en.network
- Remame file 10-dhcp-en.network.backup. This disables DHCP.
- Create a new file 10-static-en.network
[Match]
Name=eth0
[Network]
Address=192.168.118.20/24
Gateway=192.168.118.1
Where Name is the device name from step 1, Address is the desired static IP and Gateway is obviously the networks gateway.
- Change permissions on the file chmod o+r 10-static-en.network
- Reboot
Avoid running systemctl restart systemd-networkd as it can cause issues with photon.