1

I have a customized Embedded Linux image made using Yocto. The single board computer on which the image is loaded is default configured with a static IP address of 192.168.3.11/24 where I can set a static IP address on my host machine and connect to the board directly to the single board computer (target) via SSH and the static IP address (192.168.3.11)

I have found a file for the systemd network configuration as following:

# Path /lib/systemd/network/10-eth0.network [Match] Name=eth0 [Network] DHCP=ipv4 Address=192.168.3.11/24 

According to the systemd-networkd docs I can understand that the DHCP=ipv4 is to accept the IPv4 Addresses when connected to a router. But I do not understand the Address after it. Is it a fallback to static IP address?

I do not have any other way to reach the board except SSH for the board. If I connect it to an infrastructure LAN where I have no way to reach the router to determine the IP address via DHCP and would like the board to fall back to the static IP address.

Is this achieved via the script above?

3
  • Did you ever confirm if the conf above does indeed provide a fallback static IP in case of no DHCP? Commented May 19, 2022 at 16:25
  • @JPh sorry I can't remember. Since this post I left the work that was associated with this query Commented May 19, 2022 at 17:37
  • 1
    Thanks for getting back. It does not provide a fallback, but allocates a static IP as well as allowing to acquire one from a DHCP server. Commented May 20, 2022 at 11:13

1 Answer 1

0

I just discovered that dhcpcd has this -S option for static assignment... It works if I use it twice, once for ip_address= and once for routers=.

I also can connect through ip link, ip address and ip route.

With systemd I am very careful. And your example shows why: it is a complex layer of configuration and rules.

The Address= means static instead of dynamic, as I see, just like the -S option above. But the filename "10-eth0..." is also important. Has to do with udev according to systemd, just like the "match" rules. Together with other files this could well lead to some "fallback" config...

btw your link is to the arch wiki. systemd has good docs itself, but it is just too much for me!

The systemd docs explain somewhere that the simple "network is up" variable or status is too simple.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.