Difference between revisions of "How to configure network using systemd-networkd in Yocto"
From KoanSoftware Wiki
(Created page with "== How to configure network using systemd-networkd in Yocto == When using '''Yocto Project''' it sometimes may be necessary to setup a '''static IP address''' via a custom re...") |
(No difference)
|
Revision as of 13:49, 15 March 2025
How to configure network using systemd-networkd in Yocto
When using Yocto Project it sometimes may be necessary to setup a static IP address via a custom recipe.
When the network manager is systemd-networkd the file usually responsible for that is /lib/systemd/network/80-wired.network
Simply change it from the original
# cat /lib/systemd/network/80-wired.network [Match] Type=ether Name=!veth* KernelCommandLine=!nfsroot KernelCommandLine=!ip [Network] DHCP=yes [DHCP] UseMTU=yes RouteMetric=10 ClientIdentifier=mac
To the following
# cat /lib/systemd/network/80-wired.network [Match] Type=ether Name=!veth* KernelCommandLine=!nfsroot KernelCommandLine=!ip [Network] Address=192.168.0.184/24 Gateway=192.168.0.1 DNS=1.1.1.1 [DHCP] UseMTU=yes RouteMetric=10 ClientIdentifier=mac
Below is an example of a recipe to manage that