Ethernet passthrough

Hi,

I have a Raspberry Pi 4 with a USB dongle attached to it. The USB dongle will get an active internet connection, but the hardware ethernet (eth0) has to pass the internet connection of the USB dongle (or any network interface at all) through. So eth0 has to function like some sort of router.

I’ve looked around on the internet and on the Balena forums, but nothing seems to work or seems to do what I want. I want to use NetworkManager for this, not dnsmasq + iptables etc, because I like NetworkManager and it’s installed by default.

I’ve tried the following config already:

[connection]
id=eth0.passthrough
type=802-3-ethernet
interface-name=eth0

[ipv4]
method=auto

[ipv6]
method=shared

But I get the following error:

NetworkManagerError: Connection 'eth0.passthrough' is not available on device eth0 because device has no carrier

Did I do something wrong in my configuration, or is it simply not possible?

Bonus question
Is there a way to disable the Wi-Fi radio via the NetworkManager DBus? We don’t use the Wi-Fi chip for this project at the moment and we want to disable the Wi-Fi chip via NetworkManager (for future purposes), so that it doesn’t scan regularly. We don’t want to use udev rules, because we can’t change them automatically via the software.

Thanks in advance!

Damn, had to change ipv4.method = auto to ipv4.method = shared obviously,
Now, I don’t get the error and it seems to work. I’ve to try it out with additional network devices if everything goes well, but I’ll post an update!

Nonetheless, I still want to disable radio with the DBus API, so if anyone has any input for that, that’d be great :slight_smile:

There is indeed a way for doing so. Using the NetworkManager CLI it is done by nmcli radio wifi off. This internally uses the NM D-Bus API and the WirelessEnabled property - https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.WirelessEnabled.
Thanks,
Zahari

1 Like

Hi Zahari,

Thanks for pointing me in the right direction. When my Node.js container starts, it disabled the Wireless radio (WirelessEnabled = false) and configures the USB Ethernet device as a passthrough device. So all seems to work fine :slight_smile:

Just for my knowledge, disabling the Wireless radio means that the Wi-Fi devices does absolutely nothing right? No radio signals are being sent? (same goes for Bluetooth)

Hi Bart, glad to see that everything works. Yes that’s correct, it will turn off the wifi and it shouldn’t send any signals.

1 Like