Install PiVPN - https://pivpn.io/
sudo -i
vi /etc/wireguard/wg0.conf
- Add
DNS = 10.6.0.1
(the wireguard IP of the Pi) - Add this to forward all traffic to the internet
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
Install PiHole - https://pi-hole.net/
- Make sure to bind to all interfaces. If you don't do this during setup you can do it in the web UI in "Settings -> DNS -> Interface listening behavior"
- Scan QR code from
pivpn --qr
after adding the client - To forward only DNS set Allowed IPs to
10.6.0.1/32
in the wireguard app - Set DNS servers to "10.6.0.1" in the wireguard app