WireGuard clients apply the tunnel DNS to the whole device, so the hub resolver answers lab.internal authoritatively and forwards everything else: - dnsmasq on rpi, bound to lo/wg0/wg-remote only, 10.10.0.1 + 10.20.0.2 - grafana.lab.internal, hubble.lab.internal -> 10.10.0.2 (hosts file, one line per record) - ufw: 53 allowed from 10.10.0.0/24, 10.20.0.0/24, 10.244.0.0/16; dropped everywhere else, inserted above the LAN catch-all - docs: zone, per-client instructions (phone is a linode-hub spoke), rollback
21 lines
661 B
Shell
Executable file
21 lines
661 B
Shell
Executable file
#!/bin/bash
|
|
# Install the lab.internal resolver on rpi (the WireGuard hub).
|
|
# Run as root from a checkout of sirius/homek8s:
|
|
# bash infrastructure/networking/internal/dns/install-rpi-dns.sh
|
|
#
|
|
# Re-run after a Pi reinstall or after editing the records. Idempotent.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
install -m 0644 lab-internal.conf /etc/dnsmasq.d/lab-internal.conf
|
|
install -m 0644 lab-internal.hosts /etc/dnsmasq-lab-internal.hosts
|
|
|
|
bash rpi-ufw-dns.sh
|
|
|
|
# dnsmasq is already enabled at boot on rpi; make that explicit, not assumed.
|
|
systemctl enable dnsmasq
|
|
systemctl restart dnsmasq
|
|
|
|
sleep 1
|
|
systemctl is-active dnsmasq
|
|
ss -lntup | grep ':53 ' || true
|