Live data from Hacker News

Raspberry Pi WiFi to ethernet bridge

willhaley.com

51–60 of 67 posts

Re: Raspberry Pi WiFi to ethernet bridge

#51
post #2

A couple of months ago, another setup for a wifi to ethernet bridge was posted here: https://news.ycombinator.com/item?id=26940521 I like Will Haley's setup better though, because it keeps everything in the same subnet. The slowdown from the bridge is negligible, in my experience. After running 10 trials, I found that: * median ping was 2.4% higher on the bridged pi * median download speed was 3.6% slower on the brid…

> * median ping was 2.4% higher on the bridged pi Pings are best compared in absolute terms as the latency of the Pi would be additive, not multiplicative. I looked at your results and the Pi appears to add 0.6ms, which is indeed very negligible! Thanks for sharing detailed results

Even download & upload should be posted as bride/no-bridge speeds. Assuming they meant internet upload/download then it makes a big difference if you are testing using a 50Mbps internet connection or 500Mbps.

I'd be very curious of the Wifi & Ethernet can both operate at link saturation speeds so 1Gbit on the Ethernet. While the 4B has AC WiFi, just quick search shows it can only hit ~120Mbps with maybe 200Mbps maybe being achievable with some tweaks. At best it can do 480Mbps.

Considering the 4B costs ~$80, you would be better off buying a dedicated bridge. I think any Ubiquity AP can be used as a bridge for example. An old router would also work. I have a hard time thinking of a situation where you would want a 1-many bridge but don't need decent bandwidth. i.e most situations where minimal throughput is OK means you probably only need 1 raspberry pi for the task anyway.

Still it's a pretty decent project and good intro to networking.

Re: Raspberry Pi WiFi to ethernet bridge

#52
I have an ASUS RT-N16 router from about 2013 that has been doing this duty since about 2015. It's running the old Toastman build of TomatoUSB. It's only WiFi G (not N) so throughput wasn't so hot. But it really served me well until I decommissioned it last week.

Re: Raspberry Pi WiFi to ethernet bridge

#55
post #4

You can also do this with an old OpenWrt router, which also gets you a management interface and a gigabit Ethernet switch as part of the plastic box. I used to have such a bridge (OpenWrt on Netgear WNDR3800 hardware) Velcro'd to the underside of a TV cart, so that an appliance on the cart that only had Ethernet and 2.4 GHz WiFi built-in could do a more reliable 5 GHz across the room.

DD-WRT also supports this (wifi mode: "client")

Re: Raspberry Pi WiFi to ethernet bridge

#56
It seems like making an ethernet bridge shouldn't be hard; off the top of my head, if we wanted to bridge eth1 to wlan1 it would be something like:

  brctl addbr br0
  brctl addif br0 eth1
  brctl addif br0 wlan1
  ip link set br0 up
or the equivalent with ovs-vsctl

I frequently use RPi as a programmable soft switch, plugging in four USB-ethernet dongles. On my Pi it splits the USB bandwidth, but it's still very useful.

Re: Raspberry Pi WiFi to ethernet bridge

#57

It seems like making an ethernet bridge shouldn't be hard; off the top of my head, if we wanted to bridge eth1 to wlan1 it would be something like: brctl addbr br0 brctl addif br0 eth1 brctl addif br0 wlan1 ip link set br0 up or the equivalent with ovs-vsctl I frequently use RPi as a programmable soft switch, plugging in four USB-ethernet dongles. On my Pi it splits the USB bandwidth, but it's still very useful.

I wondered too, and found this from the debian docs: https://wiki.debian.org/BridgeNetworkConnectionsProxyArp

TL;DR: Some routers don't like it, so layer 3 might work better

Re: Raspberry Pi WiFi to ethernet bridge

#58
I used an Intel NUC running Debian Stretch as wireless access point for month. All I had to do was to assign all the interface (the internal ethernet one, an USB-ethernet adapter, and hostapd, the access point daemon) to the same network bridge `br0`. That's all. Even hotplugging the usb-ethernet adapter worked fine.

For those curious, find the `/etc/network/interfaces` and `/etc/hostapd.conf` here: (Grep for `br0` in both)

  * https://gitlab.com/manuel_wagesreither/debian-image-creator/-/blob/master/src/files/interfaces
  * https://gitlab.com/manuel_wagesreither/debian-image-creator/-/blob/master/src/files/hostapd.conf
---

Can anyone elaborate on why the authors way of implementation is superior to that? He/she's using `parprouted` and `dhcp-helper`.

From the parprouted man page:

> parprouted is a daemon for transparent IP (Layer 3) proxy ARP bridging. Unlike standard bridging, proxy ARP bridging allows to bridge Ethernet networks behind wireless nodes. Normal L2 bridging does not work between wireless nodes because wireless does not know about MAC addresses used in the wired Ethernet networks. Also this daemon is useful for making transparent firewalls.

When wireless nodes don't know about mac addresses, why is my wireless interface on `ip a` showing a mac address then?

Re: Raspberry Pi WiFi to ethernet bridge

#59

I used an Intel NUC running Debian Stretch as wireless access point for month. All I had to do was to assign all the interface (the internal ethernet one, an USB-ethernet adapter, and hostapd, the access point daemon) to the same network bridge `br0`. That's all. Even hotplugging the usb-ethernet adapter worked fine. For those curious, find the `/etc/network/interfaces` and `/etc/hostapd.conf` here: (Grep for `br0` i…

On wired ethernet, a packet contains the MAC address of the destination host. Switches across the network keep track of which port a given MAC address is associated with and forward it appropriately. Wifi doesn't have the same concept - the only destination MAC address in a standard 802.11 packet is that of the destination Wifi station. So, if you have a device on Wifi with several wired devices behind it, and you want to send a packet to one of those wired devices, you can't stick the wired device's MAC address in there - it needs to be the address of the one with Wifi. So how does that Wifi node know which wired device to forward the packet to?

(This is avoided with WDS, but that requires the AP to cooperate)

Post reply on HN