[HN Gopher] Raspberry Pi WiFi to ethernet bridge ___________________________________________________________________ Raspberry Pi WiFi to ethernet bridge Author : dasl Score : 69 points Date : 2021-06-10 19:51 UTC (3 hours ago) (HTM) web link (willhaley.com) (TXT) w3m dump (willhaley.com) | puzzlingcaptcha wrote: | Ah yes, network configuration by way of executing a random bash | script from a blog. With tasty morsels like: | | ># I have to admit, I do not understand ARP and IP forwarding | enough to explain exactly what is happening here. | geerlingguy wrote: | I mean, the number of people on this site who could | intelligently explain ARP and IP forwarding in detail is | probably 10x higher than in the general population--and that | percentage here is probably in the low single digits. | 0x0 wrote: | I did something similar to bring a legacy cable-only printer | online for wifi clients where there were no cabled uplink. Worked | well. Tried to add airprint with cups as well but that was | hit&miss. | | parprouted & dhcp-helper are secret gems! | CogitoCogito wrote: | I might as well just dump this question in this thread: | | Would this be easy to combine with openvpn? Basically what I'd | like is to hook (say) my Apple TV into my pi by ethernet and then | use the pi's wifi to connect to my router. Finally I'd like to be | able to connect the pi to a VPN and have the Apple TV | transparently use that connection. Is this straight-forward to | achieve? | pmccarren wrote: | Yep, rather straight-forward. Little bit of iptables forwarding | and you're all set: echo 1 > | /proc/sys/net/ipv4/ip_forward iptables -A FORWARD -i eth0 | -o wlan0 -j ACCEPT iptables -A FORWARD -i wlan0 -o eth0 | -m state --state ESTABLISHED,RELATED -j ACCEPT iptables | -t nat -A POSTROUTING -o wlan0 -j MASQUERADE | | I'd recommend wireguard[0] in preference to openvpn. | | refs: [0]https://www.wireguard.com/ | archontes wrote: | May I ask where I might start learning things like this? | hatware wrote: | Stand up a few useful services around the home and harden | them. Stuff like Plex/Emby, Paperless-ng, *arr's, etc. Self | hosting is addicting and one of the best teachers. | CogitoCogito wrote: | Great thanks for the info! | deeblering4 wrote: | Some routers support acting as a transparent vpn client as | well, particularly those with open linux firmwares. | sohei wrote: | Yes, but a better approach would be to enable forwarding on the | pi and using the pi as a gateway. | | Performance is probably the only reason you'd favor bridging | over routing. A segmented network is a safer network. | godelski wrote: | Has anyone tried this and successfully blocked ads from | services like YouTube and Hulu? uBlock works on my computer but | I've always had a hard time with pihole. It'll work for like a | day then go back to serving ads. | vorpalhex wrote: | Make sure nothing is changing your DNS. You may need to set | your router to push the pihole as your DNS and tell any | programs to use system DNS. | godelski wrote: | I've checked that my router continues to point to the | pihole (no fallbacks, though I've tried with fallbacks and | no difference). I also setup the pihole with cloudflare. | I'm just always confused because it seems like some people | have absolutely no problem and there's others in my camp | and the former just stop after "just follow the | directions." I even remember the LTT video mentioned this | specific problem. | geerlingguy wrote: | This can also be set up graphically using OpenWRT (which is a | lighter-weight OS if you just want to do some networking and not | use the Pi for anything else. | | I should note that while the onboard WiFi is 802.11ac, I've never | seen it get more than 60-70 Mbps in my own testing (in a variety | of network environments), so if you want more speed, you might | want to get an old n or ac router and flash it with OpenWRT | instead. | xiii1408 wrote: | Yeah, this. I've used Ethernet bridge on old Netgear 802.11n | routers, and it's quite fast. | dasl wrote: | Yes, those speeds are roughly consistent with what I got in my | speed tests here :) | | You (and others in these comments) have suggested using OpenWRT | as an alternative. I suppose one advantage of the approach | outlined in the submitted article is that you can still use the | pi for other tasks using the normal raspberry pi OS, instead of | installing the OpenWRT OS. | dasl wrote: | 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 bridged pi | | * median upload speed was 0.1% slower on the bridged pi | | More details about my setup and how I performed this speedtest: | https://github.com/dasl-/pitools/tree/main/wifi-ethernet-bri... | ThatPlayer wrote: | I've thought of doing something similar, but exposing it as a | USB-Ethernet adapter instead. The Pi 4 (and Pi Zero W) support | USB OTG. It looks simple enough with a single command with Linux | USB gadget to create the network interface usb0. | | Then you can do power and data over the single USB port. | sigjuice wrote: | Is the kernel's proxy ARP support not enough to handle | everything? What is the reason to have parprouted? | api wrote: | This should work with ZeroTier's Ethernet bridging capability. | You could have a WiFi network that bridged right into a virtual | Ethernet network that spanned sites. | neilv wrote: | 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. | aurelian15 wrote: | I agree that this is a much better option. Also, if you use two | OpenWrt devices, you can enable WDS mode to build a true layer | 2 bridge. That is, you won't need Proxy ARP, and DHCP relay; | DHCP, IPv6, IPv4, etc. will just work out of the box. | tyingq wrote: | And probably also a much better antenna. | lxgr wrote: | Is this a "true" bridge (i.e. every Ethernet segment coming in on | one end is transformed into an appropriate 802.11 frame and vice | versa)? If not, is that possible using an RPi? | rkeene2 wrote: | Not every IEEE 802.1 Ethernet frame can be converted to an IEEE | 802.11 WiFi frame. To do that you would need some type of | tunnel to the Ethernet fabric. | ddtaylor wrote: | DD-WRT has support for Rpi now though. ___________________________________________________________________ (page generated 2021-06-10 23:00 UTC)