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)