It looks like nothing is configured to assign IP addresses on that link. 169.254.x.y is the IPv4 autoconfiguration IP address range, which may be good enough.
Just FYI, IP addresses in the range 169.254.0.0 - 169.254.255.255 are APIPA (automatic private ip adressing) addresses. An interface configured to use DHCP to get an IP-address gets automatically an IP-address in this range if no DHCP server is currently present.
If you manually change an IP-address, you should use one of another range (e.g. 192.168.x.x.). However, that is not really harmful, just take it as an convention.
… which is usually quite slow because it requires timing out all the attempts to contact a DHCP server.
And, yeah, could cause problems if you have more than one interface where DHCP failed.
On the other hand, a static IP address is not great if you intend to connect the Librem 5 to other hosts at other times. You want DHCP - and you want it to work.
The Mac is running macOS 12.6 and the network configuration screen for this link is attached below. I do not understand why the Mac has an IP addr 169.254.151.4, but nothing happens on the L5. As I said, when I do set an addr 169.254.151.5 in the L5 with ifconfig, all is fine and I can ssh into the L5. This is what I wanted, because at work my L5 and my laptop are not on the same Wifi AP (guess why ), but from time to time I need files from the L5 or put files to it. So, I could live with that even.
I am unfamiliar with how the Librem 5 / PureOS on Librem 5 is configured in the default factory settings. But I guess the USB ethernet is another interface which has nothing to do with the usual WIFI interface. It’s possible to give a static IP to the Ethernet over USB interface while keeping DHCP on the WIFI interface.
In order to get a private IP address on the Macbook the Librem 5 would have to be configured to act as a DHCP server for connections over USB.
… or the Mac is configured to act as a DHCP server. That is better because you really want the Librem 5 to be a DHCP client (on all interfaces) and just take a suitable IP address from whatever it is connected to.
I’m not sure about that. I understand your idea but you would have to configure each and every client you connect the Librem 5 to… Not to think about installing DHCP servers on all of them.
It’s just an Ethernet interface. If you want one side to configure its IP automatically based on the other side, you need to run a DHCP server on the other side. On the Librem 5 side you can do it by choosing a profile with “Shared Ethernet” IPv4 option set in NetworkManager. On the macOS side - you’re on your own.
For MacOS, “Shared Ethernet” equivalent functionality is a standard feature of the OS and is available by enabling “Internet Sharing” from the “Sharing” settings, then check select the Librem 5 interface from the list to enable connection sharing on that interface.
I will try to setup a DHCP server on the Mac (already with the motivation to learn something).
Is it safe to assume that when the DHCP server is running on the interface of the USB-C port (which seems to be en7:) that on plug-in of the USB-C something in the L5 is running
I setup the DHCP server on the Mac as described here: https://www.swissns.ch/site/2014/05/running-mac-os-xs-built-in-dhcp-server/
rebooted the L5 and it got assigned 192.168.33.2 in the usb0 interface. The wlan0 and wwan0 interface stay as they have been, i.e. the L5 accesses Internet through wlan0.
In the Linux world, dnsmasq has a DHCP server built-in - so as long as you are using dnsmasq for DNS, you may be set already. (However that is complicated. In Ubuntu, which I mostly run, it used to use dnsmasq for DNS out-of-the-box but no longer does so, using systemd-resolved instead. So your mileage may vary. )
Yes, DHCP on the Librem 5 may work - but with the device at each end both having multiple interfaces the potential exists for clashing private addressing (regardless of which end runs DHCP). Maybe the smarts are there to avoid that problem??