Yes, you can turn a Raspberry Pi into a Wi-Fi bridge, and it takes about 30 minutes with a second wireless adapter. You enter your existing network’s SSID and password, and the Pi rebroadcasts that connection as a new access point, letting wired-only devices or distant gadgets join your network.
What a Wi-Fi Bridge Actually Does
A Wi-Fi bridge connects two separate network segments. In the Raspberry Pi context, the Pi joins your main router as a wireless client (using its built-in Wi-Fi), then creates a new access point (AP) that other devices can connect to. The Pi forwards traffic between the two, so devices on the new AP can reach the internet and other devices on your main network.
This is different from a range extender, which repeats the same SSID. A bridge can use a different SSID or the same one, but its real value is that it can also bridge to a wired Ethernet port. For example, you can connect an old printer or a desktop PC to the Pi’s Ethernet port, and the Pi shares its Wi-Fi connection with that device.
What You Need Before Starting
- A Raspberry Pi (any model with built-in Wi-Fi, such as Pi 3, 4, or Zero 2 W).
- A microSD card with Raspberry Pi OS installed (Lite is fine, no desktop needed).
- A second Wi-Fi adapter if you want the Pi to act as both a client and an access point simultaneously. The built-in chip can only do one job at a time in most configurations.
- Power supply, keyboard/monitor for initial setup, or you can SSH in.
If you only have one wireless adapter, you can still create a bridge, but the Pi will connect to your main Wi-Fi and then share that connection over its Ethernet port only. That works for wired devices but not for wireless ones.
How the Software Stack Works
The standard approach uses two main tools: hostapd to create the access point and dnsmasq to assign IP addresses. The Pi’s wireless client connection is handled by dhcpcd or NetworkManager, depending on your OS version.
The key is to enable IP forwarding, which lets the Pi pass packets between its Wi-Fi client interface (e.g., wlan0) and its AP interface (e.g., wlan1). You also need to set up network address translation (NAT) using iptables so that devices on the AP can reach the internet through the Pi’s own connection.
Without NAT, devices on the AP would need routable IP addresses from your main router, which is possible but more complex. NAT is simpler and works for most home setups.
Step-by-Step Setup (Raspberry Pi OS)
These steps assume you have a second USB Wi-Fi adapter and are running Raspberry Pi OS (Bookworm or later).
- Connect the USB Wi-Fi adapter and boot the Pi. Run
ip linkto confirm both interfaces exist (wlan0 and wlan1). - Configure your client connection to your main Wi-Fi using
nmclior the desktop Wi-Fi tool. Make sure wlan0 connects automatically. - Install the required packages:
sudo apt install hostapd dnsmasq. - Edit
/etc/hostapd/hostapd.confwith your desired SSID and password. Setinterface=wlan1anddriver=nl80211. - Edit
/etc/dnsmasq.confto define the DHCP range (e.g., 192.168.4.2 to 192.168.4.20) and the interface (wlan1). - Enable IP forwarding by editing
/etc/sysctl.confand uncommentingnet.ipv4.ip_forward=1. - Add an iptables rule to masquerade traffic from wlan1 to wlan0:
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE. - Save the iptables rule using
netfilter-persistentso it survives reboot. - Start and enable hostapd and dnsmasq with
sudo systemctl enable --now hostapd dnsmasq.
After a reboot, your Pi should broadcast the new SSID. Connect a device to it and test internet access.
Common Problems and Fixes
Wi-Fi adapter doesn’t support AP mode: Not all USB adapters can create an access point. Check with iw list for “AP” in supported modes. If it’s not there, you need a different adapter.
Client connection drops when hostapd starts: This happens when both interfaces use the same driver and the Pi tries to use the same channel. Set a different channel in hostapd.conf (e.g., 6 instead of 1) and ensure the client connection is on a different band if possible.
No internet on AP devices: Check that IP forwarding is on (sysctl net.ipv4.ip_forward should return 1). Also verify the iptables rule is present with sudo iptables -t nat -L.
DNS not working: Ensure dnsmasq is running and that its DHCP range doesn’t conflict with your main router’s range. Use a different subnet, e.g., 192.168.4.x.
Bridge vs. Extender vs. Repeater
These terms are often used interchangeably, but they differ technically:
- Bridge: Connects two separate networks at the data-link layer. The Pi acts as a bridge between your main Wi-Fi and a new AP or wired port.
- Repeater: Receives a Wi-Fi signal and retransmits it with the same SSID. It doesn’t create a separate network; it just extends the existing one.
- Extender: Often a marketing term for a repeater, but some extenders create a new SSID. They all do essentially the same thing: boost coverage.
The Pi bridge is more flexible because you can also bridge to Ethernet, which repeaters typically can’t do. It also lets you control the AP settings precisely.
Performance and Limitations
The Pi’s Wi-Fi throughput is limited by its USB 2.0 bus (if using a USB adapter) and the CPU. Expect real-world speeds of 50-100 Mbps on a Pi 4, less on older models. The bridge adds latency because every packet goes through the Pi’s CPU.
Also, the Pi’s built-in Wi-Fi can only handle one radio role at a time. If you want both client and AP on the same chip, you’d need to use a single interface in “master” mode with a virtual interface, which is complex and often unstable. The second adapter is the practical solution.
For most home use, a dedicated Wi-Fi extender is cheaper and faster. But if you already have a Pi lying around, or you need a bridge to a wired device, this project is worth it.
Frequently Asked Questions
Can I use the Pi’s built-in Wi-Fi for both client and AP?
Technically yes, but it’s not recommended. You’d need to create a virtual interface (e.g., wlan0_ap) and run hostapd on it, but the single radio can’t handle both simultaneously without performance drops and disconnections. A USB adapter is much more reliable.
Do I need a second Wi-Fi adapter?
Only if you want wireless devices to connect to the Pi’s AP. If you only need to share the Pi’s Wi-Fi with a wired device via Ethernet, the built-in Wi-Fi is enough.
Will a Raspberry Pi Zero 2 W work?
Yes, but it has only one USB port, so you’d need a USB hub for the second adapter. The Zero 2 W’s CPU is slower, so throughput will be lower, but it works for basic bridging.
How do I make the bridge permanent after reboot?
Use systemctl to enable hostapd and dnsmasq, and save iptables rules with netfilter-persistent. Also ensure your client Wi-Fi connection is set to auto-connect.
Can I bridge to a different subnet?
Yes, that’s the default with NAT. Devices on the AP get IPs from dnsmasq (e.g., 192.168.4.x) and access the internet through the Pi. They can also reach devices on your main network if you add appropriate routing rules.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Upgrade MTG Foundations Commander Deck on a Budget
- Cardano Bridge Frozen Withdrawals: What to Do
- Smoke Alarm Alerts via HomePod: Setup Guide
- Anti-Aliasing Explained: What It Is and How It Works
- Tree Shake Unused Endpoints from an Angular API Client
- Highlight Above & Below Average Values in Excel