; Date: Fri Jul 08 2022
Raspberry Pi OS (Linux) can be configured to support high end WiFi router configurations. No software like OpenWRT or RaspAP is required, if you have the patience to configure it all yourself using the command-line tools.
We recently went over using OpenWRT and RaspAP to build a WiFi router from a Raspberry Pi. Either of those software packages make it easy to configure router settings. It is possible to build most WiFi router configurations with a few clicks of the mouse. But, those packages are built on top of capabilities inherent to Linux, meaning we could do everything with the existing tools and not require addon software.
If you wish to learn the commands, you can custom build a router that exactly suits your needs. Both OpenWRT and RaspAP are limited in that you can only implement what the authors of each package believed you need. Using the command-line tools you can build any configuration you like.
For earlier articles:
- Installing OpenWRT on Raspberry Pi 4 using USB boot device
- A portable WiFI router/NAS/Docker using RaspAP on Raspberry Pi 4 with USB/SSD boot device
Below is a video that goes over the Linux/Raspberry Pi OS commands required to setup a WiFi router on Raspberry Pi that has NAS capabilities. Our earlier article did this using RaspAP.
This is a summary of the commands:
- Turn off
rfkillto allow turning on the WiFi system
hostapd-- Allows WiFi antenna to host an access point
dnsmasq-- Allows services like DNS and DHCP to be installed
sudo DEBIAN_FRONTEND=noninteractive apt install -y netfilter-persistent iptables-persistent-- Sets up
iptablesso their settings persist across reboots
sudo systemclt unmask hostapd.service
sudo systemclt enable hostapd.service-- Enable the WiFi access point service
/etc/dhcpcd.conf-- to set up DHCP service for the subnet we want to support from this router. See the discussion and settings in the video.
net.ipv4.ip_forward=1to configure forwarding of IPv4 addresses. How will IPv6 addresses be handled?
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADEto set up NAT routing from WiFi to ethernet
sudo netfilter-persistent save-- to save things
sudo rm /etc/dnsmasq.conf-- To remove existing DNSmasq configuration
sudo touch /etc/dnsmasq.conf-- To start a new file
/etc/dnsmasq.confto add the configuration described in the video
sudo touch /etc/hostapd/hostapd.conf
sudo touch /etc/hostapd/hostapd.confto add the configuration described in the video
That much enables the WiFi router. The number of commands and files involve explains to me why software packages like OpenWRT or RaspAP are so valuable.
He then configured Samba but didn't show the Samba configuration in the video.