How to Build a Low-Cost WiFi Repeater With a Raspberry Pi to Boost Your Home's Signal
Having a strong WiFi signal throughout your home is crucial for enjoying fast internet speeds. But WiFi dead zones caused by walls, distance, and interference can disrupt your connectivity. A convenient solution is using a Raspberry Pi as a DIY WiFi repeater to extend and amplify your wireless network.
Here's how I built my own low-cost Raspberry Pi WiFi repeater to boost my home's weak WiFi spots, with step-by-step instructions and code.
What You'll Need
To make a functional Raspberry Pi WiFi repeater, you'll need:
- A Raspberry Pi (any model should work, I used a 3 B+)
- A 5V micro USB power supply for the Pi
- A microSD card (8GB or larger)
- A WiFi adapter that supports Access Point mode
- Ethernet cable (optional)
- A case for the Pi (optional)
Installing the Operating System
The first step is preparing the Raspberry Pi.
I downloaded the Raspberry Pi OS from the official website and used Etcher to flash it onto the microSD card. This installed the operating system to control the Pi.
After setup, I enabled SSH on the Pi so I could access it wirelessly from my laptop. With SSH enabled, you won't need to connect a monitor and keyboard to control the Pi.
Configuring Software
Next, I connected to the Pi via SSH and ran the following commands in the terminal to install dependencies:
sudo apt update
sudo apt full-upgrade
sudo apt install hostapd dnsmasq
hostapd and dnsmasq allow the Pi to act as a WiFi access point and DHCP server.
To configure the software, I modified these two configuration files:
/etc/hostapd/hostapd.conf
interface=wlan0
ssid=Your_AP_Name
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=Your_Password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
/etc/dnsmasq.conf
interface=wlan0
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h
I restarted the services:
sudo service dnsmasq restart
sudo service hostapd restart
Now the Pi is configured as a WiFi access point!
Bridging the Networks
To make the Pi repeat my existing WiFi instead of creating a separate network, I installed iptables and ran these iptables rules:
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
This bridges the wlan0 and eth0 interfaces. I could now connect my Pi's WiFi network and access the internet through my main router transparently.
The Pi was now repeating my home WiFi signal as a wireless repeater!
Optimizing the Placement
To maximize the extended WiFi range, I experimented by placing the Raspberry Pi WiFi repeater in different central locations throughout my home. Monitoring the WiFi signals with apps like WiFi Analyzer (Android) or Network Analyzer (iOS) helped me choose optimal spots that covered dead zones.
Elevating the Pi also improved the range versus sitting it on a low shelf. I achieved the best results by mounting it high on a wall or bookshelf.
Results
My DIY Raspberry Pi WiFi repeater effectively boosted weak WiFi spots in my home for under $50 in hardware. I more than doubled my wireless range and speeds in troublesome rooms.
This flexible little repeater has been an indispensable tool for extending my home network. The set-up requires some Linux comfort but nothing too challenging for an intermediate DIYer.
With the right placement, a Raspberry Pi makes an affordable way to fill WiFi dead zones and enhance your overall connectivity. I'd recommend this project to anyone with WiFi range issues in specific areas.