Skip to content

Configuring Static IP Addresses

It is sometimes useful to provide static IP configuration for a network interface instead of relying on DHCP.

Using systemd-networkd

systemd-networkd manages network configurations and configures network devices as they appear.

Create /etc/systemd/network/00-eth0-static.network with the following content:

[Match]
Name=eth0

[Network]
Address=192.168.1.100/24
Gateway=192.168.1.254
DNS=8.8.8.8 4.4.4.4

Restart systemd-networkd:

systemctl restart systemd-networkd

Check the configured address:

ip addr show eth0