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:

Flashing Raspberry Pi OS

The first step is to install Raspberry Pi OS on the microSD card:

  1. Download the latest Raspberry Pi OS image from www.raspberrypi.org. I recommend the 32-bit Lite version.

  2. Use balenaEtcher to flash the OS image onto the microSD card.

  3. 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:

  1. Connect the Raspberry Pi to your router using an Ethernet cable. This will allow us to SSH into the Pi.

  2. Power on the Pi using a micro USB power supply.

  3. Find the Pi's IP address. I use the Angry IP Scanner tool.

  4. SSH into the Pi using its IP address and default credentials:

  5. Username: pi

  6. Password: raspberry

  7. Run sudo raspi-config to change settings like the default password.

  8. 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:

  1. Shut down the Raspberry Pi.

  2. Insert the WiFi adapter into the USB port.

  3. Boot the Pi back up.

  4. Find the WiFi adapter name:

iwconfig

Let's say the adapter name is wlan1.

  1. Install the hostapd and dnsmasq packages:

sudo apt install hostapd dnsmasq

  1. Configure the required hostapd and dnsmasq files under /etc/hostapd and /etc/dnsmasq.d. There are many guides online explaining the details.

  2. Edit /etc/default/hostapd to autostart hostapd on boot.

  3. 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:

  1. Join the Pi's Access Point from another device and find its IP address.

  2. SSH back into the Pi.

  3. Install iptables:

sudo apt install iptables

  1. Configure iptables rules to enable NAT between wlan1 (Pi Access Point) and eth0 (Ethernet/router connection).

  2. 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:

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!