So I have some services and wireguard running locally on a “home” network. I also have wireguard, a DNS resolver, and a reverse proxy set up on a remote server. Since I don’t want to expose the home IP to the public, to access my services I connect to the VPN on the remote, which then forwards my request home. But this means that when I’m at home, connecting to my local services requires going out to the VPS. Is there some way to have the traffic go over the switch when at home, but go over wireguard when away, without having to manually switch the VPN on/off?
I could move the DNS resolver (which handles the internal names for the services) from the remote to the home server. But then if I want to use that DNS resolver when away from home, every DNS request will need to go through both the remote and home servers, doubling the hops. I’d like to use my own DNS server at all times though, both at and away from home. Which tradeoff seems better?
Shimitar@downonthestreet.eu 3 weeks ago
Going the split DNS way is doable but had other issues (android devices bypassing local DNS for example or DNS over HTTPS issues)
I set up my opnSense to redorect all internal traffic to the external IP on port 443 to my internal server ip.
Works fine, it’s transparent, and doesn’t mess with DNS.
Zwuzelmaus@feddit.org 3 weeks ago
Can this be fixed/avoided?
Shimitar@downonthestreet.eu 3 weeks ago
For now yes but the very specifics of DNS over https make that impossible if enforced one day.
mrh@mander.xyz 3 weeks ago
And so when away do you just directly connect to the external IP and do port forwarding?
Shimitar@downonthestreet.eu 3 weeks ago
Actually I am behind CGNAT so when away I connect to my VPS that has a nginx pointing to a wireguard endpoint to the opnSense.
When home, my VPS ip gets rerouted on port 443 (and 80, mandatory for let’s encrypt) to the internal ip of my server.