How to Build a DIY WiFi Extender Using a Raspberry Pi
I decided to build a DIY WiFi extender using a Raspberry Pi to improve my home's wireless network coverage. Here is a step-by-step guide on how I did it.
What You'll Need
To build your own Raspberry Pi WiFi extender, you'll need:
- A Raspberry Pi (any model will work, I used a Raspberry Pi 3 B+)
- A microSD card (at least 8GB)
- A power supply for the Pi
- A WiFi adapter that supports Access Point mode
- An Ethernet cable
- A plastic case (optional)
Flashing Raspberry Pi OS
The first step is to install Raspberry Pi OS on the microSD card:
-
Download the latest Raspberry Pi OS image from www.raspberrypi.org. I recommend the 32-bit Lite version.
-
Use balenaEtcher to flash the OS image onto the microSD card.
-
Insert the microSD card into the Pi. Raspberry Pi OS is now installed!
Setting Up the Raspberry Pi
With the OS ready, it's time to configure the Raspberry Pi:
-
Connect the Raspberry Pi to your router using an Ethernet cable. This will allow us to SSH into the Pi.
-
Power on the Pi using a micro USB power supply.
-
Find the Pi's IP address. I use the Angry IP Scanner tool.
-
SSH into the Pi using its IP address and default credentials:
-
Username: pi
-
Password: raspberry
-
Run
sudo raspi-config
to change settings like the default password. -
Update the Pi's packages:
sudo apt update
sudo apt full-upgrade
The Raspberry Pi is now ready!
Configuring the WiFi Adapter
Next, we need to set up the WiFi adapter for Access Point mode:
-
Shut down the Raspberry Pi.
-
Insert the WiFi adapter into the USB port.
-
Boot the Pi back up.
-
Find the WiFi adapter name:
iwconfig
Let's say the adapter name is wlan1
.
- Install the hostapd and dnsmasq packages:
sudo apt install hostapd dnsmasq
-
Configure the required hostapd and dnsmasq files under
/etc/hostapd
and/etc/dnsmasq.d
. There are many guides online explaining the details. -
Edit
/etc/default/hostapd
to autostart hostapd on boot. -
Reboot the Pi. The WiFi adapter should now be in Access Point mode!
Connecting the Extender to Your Router
With the Pi WiFi adapter hosting its own Access Point, we now need to connect it to the primary router:
-
Join the Pi's Access Point from another device and find its IP address.
-
SSH back into the Pi.
-
Install iptables:
sudo apt install iptables
-
Configure iptables rules to enable NAT between wlan1 (Pi Access Point) and eth0 (Ethernet/router connection).
-
Devices connected to the Pi Access Point should now have internet connectivity through the router!
Setting Up the Case (Optional)
For a cleaner finish, you can house the Raspberry Pi extender in a case:
-
Choose a plastic case that fits the Pi, adapter, and cables comfortably.
-
Drill holes for the various ports you need access to.
-
Place the Pi and adapter inside and connect all the cables.
-
Close up the case for a tidy, finished look!
And that's it! I now have a handy Raspberry Pi WiFi extender that improved my home's network coverage. The Pi draws very little power and works great for this purpose. Let me know if you have any other tips for building a Pi WiFi extender!