Raspi enable systemd.networkd

nguyennamdsn | March 16, 2023, 6:53 a.m.

Remove non-systemd networking packages.

To rid your system of "obsolete" :P networking packages, execute the following commands:

sudo apt remove --purge --auto-remove dhcpcd5 fake-hwclock ifupdown isc-dhcp-client isc-dhcp-common openresolv
sudo killall wpa_supplicant
sudo killall dhcpcd
Configure systemd networking.

a) Use your editor of choice (nano or vi) to create config file for the ethinterface, e.g.:

sudo vi /etc/systemd/network/eth0.network

and enter the following in it:

[Match]
Name=eth0

[Network]
DHCP=ipv4

This will enable DHCP on eth0.

b) Create config file for the eth0 interface, e.g.:

sudo vi /etc/systemd/network/eth0.network

with the following contents:

[Match]
Name=eth0

[Network]
Address=192.168.1.100/24
Gateway=192.168.1.1
This will enable static address on eth0.

Enable systemd networking.

a) Enable network management service:

sudo systemctl enable systemd-networkd

b) Reboot:

sudo reboot

Refer: https://hackaday.io/project/162164/instructions

0
0

Leave a comment:

Comments: