After a long time of deliberation, I finally decided to share my OpenWrt setup for the BPI-R4.
You can find it in my Smart Home repository and use it as inspiration for your own setup.
It uses the OpenWrt image builder and docker or podman on Windows to build the firmware that can be loaded onto the R4.
My setup includes five different networks: private (internal), guest, IoT (internet of things and smart home devices), container (for podman on the router) and vpn (wireguard).
And three different WiFi networks: private, guests and IoT devices.
It uses Cloudflare DNS as default and also encrypts DNS traffic using stubby. Cloudflare is also used for dynamic DNS to reach the router via domain name when your ISP doesn’t provide static IPs.
VPN is provided using wireguard. A script to add clients is included, if you don’t want to use Luci for that. It even prints out the QR code on the command line, if your terminal supports it. I didn’t know that was possible.
There is an environment file .env.example
that shows all the configuration options that are available. Root password, ssh public key for connections from your PC, WiFi names (SSIDs) and passwords, and cloudflare and domain configuration.
The image build makes extensive use of the uci defaults feature to establish the desired system state after first boot. I chose those scripts over simply replacing the files in /etc/config
, as this was suggested in the OpenWrt wiki.
Please let me know if this setup could be helpful for you. And if you have any questions, suggestions or issues when trying it yourself.
It requires a bit more technical knowledge compared to images provided by other members of the community, as I currently have not setup GitHub actions to automatically build the image.