Intro
I'd like to share the custom firmware builder / configuration I made for the BananaPi BPI-R4 router. Which of course could also be used for other routers by changing the image builder target.
It uses podman or docker to build the custom firmware, which allows it to be used on Windows as well as other operating systems.
As suggested in the wiki I make heavy use of UCI defaults to configure the system state. There are also extra files in addition to that.
Current list of features
- Configuration via
.env
file for private information - Root login via preconfigured ssh key
- Data partition from either NVME or eMMC
- WAN over PPPoE or USB tethering
- Separate networks for: private (internal), guests, IoT devices, containers and VPN
- Cloudflare DNS
- Cloudflare DDNS
- DNS security via stubby
- Patched sysupgrade to keep ssh host key and wireguard client configuration
Additional scripts
- Add wireguard client via command line, assign correct IP and generate QR code
- Set ondemand as default CPU frequency governor (makes it chill at 800MHz most of the time)
- SFP auto-negotiation fix on device connection
- PPPoE 24h automated disconnect (to prevent ISP doing it at unwanted times)
Containers
I'm currently working on adding the ability to run containers via podman. As the documentation is rather outdated in that regard, I hope my configuration can also be helpful to other people.
I added the following features to make handling containers a bit easier:
- UCI configuration file for containers and volumes
- Hotplug script to update DNS entries when containers start/stop
- init.d/procd script to handle automated creating of volumes and start of containers based on the config
- Custom hostnames for containers to reach them directly instead of port mapping or reverse proxy on the router
Feedback &
Questions
Please let me know if this is useful for you. Or if you have any questions. If the README
should provide more detailed usage steps. Or whatever comes to your mind.
Or if I made some stupid mistakes in my setup.