Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5266

Troubleshooting • Re: STICKY: Bookworm, Point to Point Ethernet (inc g_ether)

$
0
0
With the transition to Bookworm, many users have reported that point-to-point Ethernet links, such as direct cable connections or USB Ethernet gadgets, are not functioning as expected. This can lead to connectivity issues, especially when trying to use both Ethernet and Wi-Fi simultaneously.
Workaround for Point-to-Point Ethernet Links
To set up a point-to-point Ethernet connection without requiring additional login methods or root access, follow these steps:
Requirements
Raspberry Pi device running Bookworm
A freshly flashed RPiOS SD card that has not yet been booted
A text editor that supports Linux-style line endings
Steps to Configure the Connection
Open the Boot Partition
Insert your SD card into your computer and access the boot partition.
Locate firstrun.sh:
Find and open the firstrun.sh file in your text editor.
Modify firstrun.sh:
Scroll to the end of the file and locate the line:
bash
rm -f /boot/firstrun.sh
Above this line, copy and paste one of the following code snippets based on your connection type:
For Ethernet Connection:
bash
cat >/etc/network/interfaces.d/eth0 <<'EOF'
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 169.254.1.1
netmask 255.255.0.0

auto eth0.1
allow-hotplug eth0.1
iface eth0.1 inet dhcp
EOF
For USB Ethernet Gadget:
bash
cat >/etc/network/interfaces.d/g_ether <<'EOF'
auto usb0
allow-hotplug usb0
iface usb0 inet static
address 169.254.1.1
netmask 255.255.0.0

auto usb0.1
allow-hotplug usb0.1
iface usb0.1 inet dhcp
EOF
Save and Close:
Save your changes and close the text editor.
Boot Your Raspberry Pi:
Insert the SD card back into your Raspberry Pi and power it on.
Explanation of Configuration
The configuration sets a static IP address for the specified interface in the link-local subnet (169.254.x.x), which is useful for direct connections where no DHCP server is present.
The second block creates a virtual interface that can obtain an IP address via DHCP if a DHCP server becomes available later.
Known Issues
This solution is limited to IPv4 only.
Using static IP addresses can lead to conflicts if multiple devices are connected within the same subnet.
Ensure that each Raspberry Pi connected together has a unique IP address within the 169.254.x.x range.
Additional Considerations
If you're trying to use both Ethernet and Wi-Fi simultaneously but are facing priority issues (where one connection takes precedence over another), consider adjusting the route metrics in Network Manager:
Open a terminal on your Raspberry Pi.
Use nmcli to modify connection priorities:
bash
nmcli connection modify "Wired connection 1" ipv4.route-metric 100
nmcli connection modify "Wi-Fi connection" ipv4.route-metric 200
Restart both connections for changes to take effect.

Guessing you didn't read the above before posting. And that you have not tested on a the latest release of Bookworm.

It also looks like all you have done is copied and tweaked my first post in this thread.

Interfaces.d will do nothing on the latest releases as ifup/down is not installed.

Setting the metric on wired connection 1 in network manager will have no impact on an interface that is not being managed by it.

Please don't post inaccurate information in the guise of help especially when the correct information is already present in the same thread.

Even more so when there appears to be a spam link in your post.

Statistics: Posted by thagrol — Fri Dec 20, 2024 2:28 pm



Viewing all articles
Browse latest Browse all 5266

Trending Articles