-1

I have a Raspberry Pi 4 that is running Buster/32bit (upgrading the OS is currently not an option).

The Raspberry Pi runs in headless mode, with ssh and vnc enabled.

In order to find the machine in the network, Avahi is installed (so I should be able to connect to it via mypi.local).

As I want to be able to connect to my uni's WiFi network (eduroam; WAP2/MSCHAP), i figured that the default dhcpcd network daemon is not sufficient, and I installed NetworkManager instead.

However, the typical connectivity of the Raspberry Pi is a wired-connection, either in a larger network (with DHCP) or connecting it directly to a laptop (link-local).

Now, everything works as expected if I hook up the Raspberry Pi to my DHCP-enabled network.

However, I cannot figure out how to get link-local connections working.

Checking zeroconf announcements with my trusted avahi-discover, I noticed that in the latter case the Pi announces itself via some IPv6 address, but not via an IPv4 address.

Since I guess that this is the actual problem, I try to convince NetworkManager to fall-back to link-local IPv4 addresses, if DHCP fails. Unfortunately I have no idea, how.

I read in /usr/share/doc/network-manager/NEWS.gz for NetworkManger-1.2:

Native IPv4 link-local addressing configuration based on systemd network library is now used instead.

So I guess I must configure "systemd network", which (I think) is done via /etc/systemd/network/. Note, that systemd-networkd is not running/activated!

Anyhow, I've created a file /etc/systemd/network/98-mypi.network, with the following content (pilfered from some systemd unit-tests):

[Match]
Name=eth0

[Network]
DHCP=ipv4
LinkLocalAddressing=yes
IPv6AcceptRA=no
IPv4LLStartAddress=169.254.133.11

Unfortunately this doesn't seem to do anything useful.

Occasionally I now see the Raspberry Pi announcing itself via ZeroConf, but using the IPv4-address it got assigned from the DHCP-server, the last time it connected to that.

Since the peer machine (my laptop) is not in that network, i stlil cannot reach the Pi (also I would like to not use the DHCP-address on the link-local connection - imagine I configure my double-ethernet desktop to be connected to both the DHCP-network and the Pi (the latter via link-local).

So:

How can I convince NetworkManager to configure the eth0 interface to fall-back to a proper IPv4 link-local address, if DHCP fails?

(This all worked with dhcpcd, but due to the WiFi handling, I really want use NetworkManager)

1
  • while it's fine if you downvote my question if you find it inappropriate, it would be great if you could comment on why you think so. (so I can improve future questions to meet the standards)
    – umläute
    Oct 31, 2023 at 11:53

1 Answer 1

0

What version of systemd? You can use:

systemctl --version

I think you need >= 252

You can use systemctl status systemd-networkd to check for any errors. If your version isn't right you might see an issue like Unknown key name 'IPv4LLStartAddress' in section 'Network', ignoring.

The feature is added here https://github.com/systemd/systemd/pull/23927 https://github.com/systemd/systemd/commit/c1dd250f18d96d31608cbabfb32c8e5a4c36fd41

https://github.com/systemd/systemd/pull/24019 https://github.com/systemd/systemd/pull/24019/files/72c747e6d10637c0844e7c239a47bd5e6d42763c

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.