Use your Raspberry Pi 3B/3B+/4/5 as an Ethernet bridge on Raspberry Pi OS Bookworm or newer.
I have a few older devices that either only have an ethernet connection or have trouble with newer mesh networks. I wanted to get them on my network with the device getting its own IP address from DHCP on the LAN without double NAT. I tried solutions like RaspAP but couldn't it to work as I had hoped while in Bridge mode.
There had to be a more simple solution. After a while, I found Will Haley's post about using a Raspberry Pi as a Wi-Fi Ethernet bridge. After some modifications to the script, I was able to finally get a Raspberry Pi to work as an Ethernet bridge.
Review bridge.sh before running this command on your Raspberry Pi:
curl -sSL https://raw.githubusercontent.com/ShiftaDeband/Raspberry-Pi-WiFi-Ethernet-Bridge/refs/heads/main/bridge.sh | sudo bash- You'll need a Raspberry Pi 3B, 3B+, 4, or 5. (FAQ)
- Using Raspberry Pi Imager, prepare an SD card with the following:
- For OS, use the latest version of Raspberry Pi OS Lite (64-bit). This is somewhat hidden inside Raspberry Pi OS (other).
- Configure your hostname, Wi-Fi connection information and country code, username, password, and allow SSH access.
- Write to your SD card, and when finished, plug it into your Raspberry Pi.
- Power on your Raspberry Pi with the SD card you just created.
- After a moment, SSH into your Raspberry Pi. (e.g.
ssh username@hostname.local) - When logged in, make sure everything is up-to-date via
sudo apt updatefollowed bysudo apt full-upgrade. - When everything is updated, run
sudo reboot. After that, wait a few seconds and SSH back into your Raspberry Pi. - Run the script via the following command:
curl -sSL https://raw.githubusercontent.com/ShiftaDeband/Raspberry-Pi-WiFi-Ethernet-Bridge/refs/heads/main/bridge.sh | sudo bash- When the script is done executing, reboot the Raspberry Pi by running
sudo reboot. - Plug in an Ethernet cable from the Raspberry Pi to the device you're connecting to the internet.
Would a Raspberry Pi Zero W or Zero 2 W work?
A Raspberry Pi Zero W or Zero 2 W may work when using an OTG cable and a USB Ethernet adapter, but is untested. You may also need to modify the network interface name in bridge.sh if it doesn't show up as eth0 in your device list.
A huge thank you to Will Haley's post, which was incredibly helpful in getting this version of the script working.