There have a been a few reports that point to point ethernet links no longer come up on Bookworm. I've posted some workarounds but so far those have all required either a way to login to the Pi via another method or the ability to read and write to the root partition.
This workaround attempts to provide a method that requires neither.
Target Situation: Any Pi device running Bookworm or using Network Manager, and with a point to point network link (e.g. a direct cabled connection or the ethernet USB gadget).
Requirements:
For ethernet:For the USB ethernet gadget:Known Issues:
Placing a file in /etc/network/interfaces.d makes Network Manager ignore any interfaces configured in it.
The first block configures the actual interface with a static IP address in the link local/zeroconf/mDNS/avahi/Bonjour subnet. Most modern OS on the other end of the link will fallback to this subnet in the absense of a DHCP server. The Pi can be accessed via it's configured static address.
The second block creates a virtual interface and configures ro use DHCP. If you later add a DHCP server to your network or move the Pi to a network with one it will get it's network configuration for this interface in the usual manner.
This workaround attempts to provide a method that requires neither.
Target Situation: Any Pi device running Bookworm or using Network Manager, and with a point to point network link (e.g. a direct cabled connection or the ethernet USB gadget).
Requirements:
- A Raspberry Pi
- A freshly flashed RPiOS SD card (or other storage device) that has not yet been booted
- A text editor. Preferably one that support Linux style line endings.
- Code snippets from this post
- Open the boot partition of you SD card
- Find firstrun.sh
- Open it in your text editor
- Scroll to the end
- Locate the lineIt's likely the third from the end.
Code:
rm -f /boot/firstrun.sh
- Copy and paste one or more of the following code snippets immediately above that line.
- Save and close.
- Boot Pi
For ethernet:
Code:
cat >/etc/network/interfaces.d/eth0 <<'EOF'auto eth00allow-hotplug eth00iface eth00 inet static address 169.254.1.1 netmask 255.255.0.0auto eth0.1allow-hotplug etc0.1iface usb0.1 inet dhcpEOF
Code:
cat >/etc/network/interfaces.d/g_ether <<'EOF'auto usb0allow-hotplug usb0iface usb0 inet static address 169.254.1.1 netmask 255.255.0.0auto usb0.1allow-hotplug usb0.1iface usb0.1 inet dhcpEOF
- This solution is IPv4 only.
- Using a static IP address is not ideal. There is a 1 in 64,516 chance of a conflict.
- If using this on multiple PI that will be connected together (e.g. using an ethernet switch) each Pi must have a unique IP address in the 169.254.0.0/16 subnet.
- Same thing applies when using multiple Pi connected via the USB ethernet gadget to the same USB host.
- This configures one end of the link only. Additional configuration may be required on the other end.
- Your Pi will show two ethernet interfaces. One may not be up.
Placing a file in /etc/network/interfaces.d makes Network Manager ignore any interfaces configured in it.
The first block configures the actual interface with a static IP address in the link local/zeroconf/mDNS/avahi/Bonjour subnet. Most modern OS on the other end of the link will fallback to this subnet in the absense of a DHCP server. The Pi can be accessed via it's configured static address.
The second block creates a virtual interface and configures ro use DHCP. If you later add a DHCP server to your network or move the Pi to a network with one it will get it's network configuration for this interface in the usual manner.
Statistics: Posted by thagrol — Wed Jan 24, 2024 4:45 pm — Replies 0 — Views 30