This commit is contained in:
2026-05-21 21:21:13 +02:00
parent 1696d5c65b
commit e07f75432e
2 changed files with 7 additions and 1 deletions

View File

@@ -191,6 +191,9 @@ start_vpn() {
> /etc/resolv.conf > /etc/resolv.conf
for dns in $(echo "$VPN_DNS" | tr ',' ' '); do for dns in $(echo "$VPN_DNS" | tr ',' ' '); do
echo "nameserver $dns" >> /etc/resolv.conf echo "nameserver $dns" >> /etc/resolv.conf
# Add explicit route to DNS server through wg0 so it's found in main table
# (suppress_prefixlength 0 ignores default routes but allows host routes)
ip -4 route add "$dns" dev "$INTERFACE" 2>/dev/null || true
done done
echo "[vpn] DNS set to: ${VPN_DNS}" echo "[vpn] DNS set to: ${VPN_DNS}"
fi fi
@@ -349,6 +352,8 @@ check_vpn_connectivity() {
echo "[check] FAIL DNS resolution failed" echo "[check] FAIL DNS resolution failed"
echo "[check] resolv.conf: $(tr '\n' ' ' < /etc/resolv.conf)" echo "[check] resolv.conf: $(tr '\n' ' ' < /etc/resolv.conf)"
echo "[check] Check that DNS servers are reachable through wg0" echo "[check] Check that DNS servers are reachable through wg0"
echo "[check] ── End of checks ──"
exit 1
fi fi
echo "[check] ── End of checks ──" echo "[check] ── End of checks ──"

View File

@@ -1,7 +1,8 @@
[Interface] [Interface]
PrivateKey = EPRa2f/v72LvIXAY4yqIRJifsSb+nCcYHqC2rwA94UI= PrivateKey = EPRa2f/v72LvIXAY4yqIRJifsSb+nCcYHqC2rwA94UI=
Address = 100.64.244.78/32 Address = 100.64.244.78/32
DNS = 198.18.0.1,198.18.0.2 #DNS = 198.18.0.1,198.18.0.2
DNS = 8.8.8.8
# Route zum VPN-Server direkt über dein lokales Netz # Route zum VPN-Server direkt über dein lokales Netz
PostUp = ip route add 91.148.236.64 via 192.168.178.1 dev wlp4s0f0 PostUp = ip route add 91.148.236.64 via 192.168.178.1 dev wlp4s0f0