Notes for setting custom open source firmware on my router.
dd-wrt
My current firmware
-
Follow device specific instructions for flashing dd-wrt. Use dd-wrt forum to find stable versions for the router (search specifically for the model number and look at comments - takes a while π)
-
Setup secure management username, password.
-
Setup wifi:
- Setup same names for both 2.4G and 5G, most devices seem to be able to pick and use the fastest one when required1
- Setup WPA2-PSK with 128 AES for encryption and setup a key (for both).
- Setup a Virtual interface for guest wifi. Use the 2.4 GHz channel for this, make it unbridged, add in its own own ip subnet, and switch on net, AP isolation.2
- Setup a DNS server for the guest wifi. Networking β DHCPD β add a server for the guest interface (ip subnet will be automatically added).
-
Setup local domain so that hosts can be connected using hostnames.
- Setup router name and router hostname @ Setup β Basic setup.
- Setup local domain @ Services β Services β DHCP Setup. Set Used domain to LAN & WLAN, and set LAN domain to βhomeβ.
- Optionally, disable No DNS rebind (@ Services β Services β Dnsmaq infrastructure).
- The router administration page should now be accessible at (router-hostname.home)
-
Add subdomains for self-hosted services in Services β Services β Dnsmasq Infrastructure β Additional Options.
address=/mail.mydomain.home/feed.mydomain.home/192.168.1.191
-
Setup wireguard client and route traffic to VPN server. To do this, I followed this guide from this forum post (local copy here. The easiest approach is to basically just import wireguard config from protonvpn (or other vpn service) and adjust some settings. I typically set the source to Route selected sources through VPN and provide ip subnets for this.3 If the persistent keepalive is not set, I set it to 25 or 26.
-
Setup dynamic DNS so that I can VPN onto your router without an ip address (especially if you wan ip address changes once in a while). Register for a free dynamic dns service (I currently use https://freedns.afraid.org/), and create a subdomain linking to your router wan ip.4 Go to Setup β DDNS β pick service β will username, domain etc β save settings. The router will automatically update the ip linked to the hostname when wan ip changes.
-
Setup wireguard server so that I can VPN into my home network. To do this, I follow this excellent guide from this forum post (local copy here).5 I followed the guide verbatim and then connect from my phone or computer to check if it is working well.
- I use the excellent wg-tunnel for wireguard vpn on android.
- I use the offical wireguard application for macos and iphone
Footnotes
-
Used this superuser page and this tomshardware page as reference β©
-
Used this dd-wrt wiki page as reference β©
-
Used subnet calculator and subnet cheatsheet as reference β©
-
For https://freedns.afraid.org/, create an account β subdomains β create a βAβ subdomain linked to your wan ip and you are set. β©
-
Note: if I add the ip subnet to the wireguard client tunnel, I can vpn into my router, access home network and connect to internet through the output vpn connection. β©