Family Encyclopedia >> Electronics

How to Transform Your Raspberry Pi into a Reliable Wi-Fi to Ethernet Bridge

While most modern devices connect to Wi-Fi seamlessly, many older gadgets and Ethernet-only hardware still need a wired solution. That's where the Raspberry Pi shines—repurposing it as a Wi-Fi bridge is a simple, cost-effective fix.

Whether reviving a legacy desktop or linking Ethernet peripherals to your wireless network, this setup delivers fast, stable connectivity without buying expensive adapters.

Turn Your Raspberry Pi into a Wi-Fi Bridge

Follow this proven tutorial, refined from years of Raspberry Pi networking projects, to connect your Pi to Wi-Fi (wlan0) and bridge it to Ethernet (eth0). Any device plugged into the Pi's Ethernet port gains instant network access.

How to Transform Your Raspberry Pi into a Reliable Wi-Fi to Ethernet Bridge

After updating your dnsmasq configuration for DHCP on the Ethernet interface, save with Ctrl + O, then exit via Ctrl + X.

Enable IP Forwarding

Activate IP forwarding to route traffic between the Pi's Wi-Fi and Ethernet interfaces.

sudo nano /etc/sysctl.conf

Uncomment this line:

#net.ipv4.ip_forward=1

So it reads:

net.ipv4.ip_forward=1
How to Transform Your Raspberry Pi into a Reliable Wi-Fi to Ethernet Bridge

Save with Ctrl + O and exit with Ctrl + X. Apply changes now:

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

Forward Traffic from Ethernet to Wi-Fi

Configure iptables for NAT masquerading and stateful forwarding, ensuring Ethernet devices (eth0) use the Pi's Wi-Fi uplink (wlan0).

sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo iptables -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT

Persist these rules:

sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"

Reload on boot by editing rc.local:

sudo nano /etc/rc.local

Add this line before "exit":

iptables-restore < /etc/iptables.ipv4.nat

Save with Ctrl + O and exit with Ctrl + X.

Test Your Wi-Fi Bridge

Launch dnsmasq to handle DHCP:

sudo service dnsmasq start

Connect an Ethernet-only device to your Pi. It should pull an IP and access the internet via the Pi's Wi-Fi—tested and reliable every time.

Conclusion

With this setup, your Raspberry Pi becomes a versatile Wi-Fi bridge for any wired device. Ideal for home networks, retro gaming rigs, or IoT. Try it for captive portals or personal servers next—share your results!