How to Build a DIY WiFi Extender with a Raspberry Pi and Improve Your Home Network Coverage on the Cheap
Having poor WiFi coverage in parts of your home can be frustrating. But you don't need to spend a lot of money on an expensive WiFi extender. With just a Raspberry Pi and a few other inexpensive components, you can build your own DIY WiFi extender to boost your network coverage.
What You'll Need
To build your Raspberry Pi WiFi extender, you'll need the following:
- A Raspberry Pi (any model will work, but the Pi 3 or 4 is recommended)
- A microSD card (at least 8GB)
- A micro USB power supply for the Pi
- A USB WiFi adapter that supports access point/client mode
- An Ethernet cable
- A plastic case (optional, for housing the Pi)
I chose the Raspberry Pi 4 since it's the newest and fastest model. For the WiFi adapter, make sure to get one that specifically supports access point and client modes - this allows the Pi to connect to your existing network while also broadcasting its own signal.
Setting Up the Raspberry Pi
With all the components ready, it's time to set up the Raspberry Pi.
First, install the Raspberry Pi OS on the microSD card. Download the image from the Raspberry Pi website and use balenaEtcher to flash it onto the card.
Once the OS is installed, connect the Pi to a monitor, keyboard, and mouse. Insert the microSD card and power it on. Run through the initial setup prompts.
Next, connect the USB WiFi adapter to the Pi. Make sure to update the Pi and install any required drivers for the adapter using the following commands:
sudo apt update
sudo apt full-upgrade
Reboot the Pi to load the new drivers.
Configuring Software
Now we need to configure some software on the Pi to allow it to act as a WiFi extender.
First, install the hostapd and dnsmasq packages. These will allow the Pi to act as a wireless access point:
sudo apt install hostapd dnsmasq
Next, edit the hostapd configuration file:
sudo nano /etc/hostapd/hostapd.conf
Add the following, updating the ssid and password with your own choice:
interface=wlan0
driver=nl80211
ssid=MyExtender
hw_mode=g
channel=6
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=mypassword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
This configures the access point details.
Now edit /etc/dnsmasq.conf
:
sudo nano /etc/dnsmasq.conf
Uncomment this line:
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h
This sets the DHCP range for connecting devices.
Finally, edit /etc/sysctl.conf
to enable packet forwarding:
sudo nano /etc/sysctl.conf
Uncomment this line:
net.ipv4.ip_forward=1
Save all files and reboot the Pi to apply the changes.
Connecting Ethernet Backhaul
To connect the WiFi extender back to your main router, connect one end of the Ethernet cable to the Pi and the other end to a free LAN port on your router. This will provide the backhaul connection.
Now when we start up the access point, the Pi will bridge the WiFi network to the wired backhaul.
Starting the Extender
We're now ready to start up the WiFi extender.
Run the following commands:
sudo systemctl unmask hostapd
sudo systemctl start hostapd
sudo systemctl start dnsmasq
This will start the access point and DHCP server.
The Pi should now be broadcasting your configured SSID. Connect wireless devices to this new network and they will be able to access your main router through the Pi's wired backhaul connection.
Setting Up on Boot
To have the extender start automatically on boot, run these commands:
sudo systemctl enable hostapd
sudo systemctl enable dnsmasq
Now the access point and DHCP server will startup whenever you boot the Pi.
Changing the Hostname
One final touch is to change the Pi's hostname on the network to something like "WiFiExtender" so it's easily identifiable.
Edit /etc/hostname
and /etc/hosts
to change the name:
sudo nano /etc/hostname
sudo nano /etc/hosts
Reboot once more for the change to take effect.
Mounting in a Case
For a nicer permanent installation, I recommend mounting the Pi and USB adapter inside a plastic case. This helps protect the electronics and keeps things tidy.
You can mount the components inside a basic plastic enclosure or get a specialized Raspberry Pi case with slots for the hardware. Place the Pi, USB adapter, and Ethernet cable neatly inside.
And that's it! I now have my own DIY WiFi extender powered by a Raspberry Pi. The extender boosted my WiFi signal across my entire home, covering weak spots and dead zones. And it only cost around $50 to build with a Pi and basic components. Pretty cool!