Comment on How to Use Local IP for Services when at Home?
mrh@mander.xyz 16 hours agoOh hm I didn’t think about your last point, maybe it’s not really an issue at all. I guess I’m not 100% how the wireguard networking works.
Suppose I tunnel all of my traffic through wireguard on the remote server. Say that while I am home, I request foo.local, which on the remote server DNS maps to a wireguard address corresponding to my home machine. The remote will return to me the wireguard address corresponding to the home machine, and then I will try and go to that wireguard address. Will the router recognize that that wireguard address is local and not send it out to the remote?
motruck@lemmy.zip 16 hours ago
Your home router knows nothing about your wireguard VPN unless it is also configured to be a peer in it. So in short no it will not recognize and route your connection locally unfortunately.
Are you using TLS here at all? Can you give me an example of how you access this on your phone when remote vs when local.
e. g. From my phone on cellular I go to Firefox and type in jelly.bob.com which resolves to my wireguard ip hitting the VM in the cloud that then using nginx as a reverse proxy to reach jellyfin over my network.
Remote network: jellyfin.bob.com Phone - > VM - > Home Server where Jellyfin is running
Is each hop is over wireguard i.e from phone to VM from VM to Home Server?
On the local network: jellyfin.bob.com Currently looks the same as the above and what youx like it to do with the same name is go: Phone->Home server
Even when wireguard is on, correct?
mrh@mander.xyz 16 hours ago
Yes your description is just right and is the heart of my question. To use your terminology:
Currently away from home: Phone -> VM -> Home Server Currently at home: Phone -> VM -> Home Server (inefficient!)
Ideally away from home: Phone -> VM -> Home Server Ideally at home: Phone -> Home Server
In the ideal case, I would never have to change anything about the wireguard config/status on the Phone, nor would I have to change the domain name used to reach the resource on the Home Server.
motruck@lemmy.zip 14 hours ago
Are you routing DNS over wireguard the whole time or do the DNS servers change when you go from public internet to your home network?
If you are using the same DNS servers i.e. always using DNS over wireguard then there isn’t really a lot you can do.
The way I do this is when I am on my home network I use the DNS on that network, i.e. the adguard instance I set up and also override DNS names with, when I am on some public internet i.e. via cellular, I use whatever DNS server they have. So on home network jellyfin.bob.com returns 192.168.8.3 (for example) and on the public internet jellyfin.bob.com will return 68.32.23.11 (i.e. my public IP address).
However that requires multiple DNS servers.
What is an example server where you’d like to do this (it may give us more options) and how is your DNS set up?