VPN server on router or within home network?
from ratzki@discuss.tchncs.de to selfhosted@lemmy.world on 18 Jun 13:18
https://discuss.tchncs.de/post/38885370

Hi, looking for some advice to set up a VPN server to get into my home network when traveling.

I have a NAS and an openWRT AP within the network. My router is provided by the ISP and with a built-in VPN. Being a hobbyist in networking, I would like to tab your brains for suggestions and know how:

Should I get my own router to run a wireguard VPN off the router directly, i.e. on the edge of the network, OR run a VPN service off the openWRT AP or the NAS, i.e. from within the home network?

Thanks a lot for your help!

#selfhosted

threaded - newest

Dubiousx99@lemmy.world on 18 Jun 13:28 next collapse

Expand on your use case. Why/what do want to access on your local network when you are not there?

Dubiousx99@lemmy.world on 18 Jun 13:46 next collapse

Since I have no patience, I’ll lay out some items for consideration.

1st, I wouldn’t rely on an ISP router to serve as my end point for a VPN. They likely have access to manage that device and it likely isn’t getting any updates. You are better off implementing it with your own equipment that you keep updated.

If you have a capable security device serving as your router to the external internet and you want full access to your internal network, then you might consider using a VPN that terminates at your router.

I myself am a fan of setting up a jump host and initiating a VPN connection directly to that host when using an agent based solution. Then you can monitor the host for activities, more easily keep your edge device patched, and then use the capabilities of your jump host to interact with the rest of your network. This would require either an agent to periodically poll a platform for connection requests or another form of ingress into your network.

ratzki@discuss.tchncs.de on 19 Jun 01:30 collapse

Thanks, I can follow and understand the first two paragraphs. That feels like my preferred option for now.

Don’t understand your third paragraph. Any good resources you can point me to for learning?

Thanks!

Dubiousx99@lemmy.world on 19 Jun 09:31 collapse

A jump host is just a system that serves as an exit point into the restricted network. You can do this with Ubuntu desktop but you need to figure out how you are going to jump into your host. Others have mentioned tail scale and head scale as options for doing this. Tailscale would be an example of an agent based adhoc vpn solution; this would place a dependency on an external provider to host a connection broker service and use an agent that periodically checks into the broker service for connection requests. Headscale would be the self hosted option and you would need to forward a port into your network and you should guard it with a reverse proxy.

ratzki@discuss.tchncs.de on 19 Jun 12:24 collapse

Great, understood. Thanks a lot!

ratzki@discuss.tchncs.de on 19 Jun 02:47 collapse

I want to access my NAS, incl the containers it is running.

[deleted] on 18 Jun 13:36 next collapse

.

FlexibleToast@lemmy.world on 18 Jun 13:41 collapse

But this is self hosting.

github.com/fosrl/pangolin

thelittleblackbird@lemmy.world on 18 Jun 13:47 collapse

Tailscale too if you use the fee implementation Headscale

And in both cases you need a vps fully reachable from anywhere

FlexibleToast@lemmy.world on 18 Jun 13:57 collapse

I know gross Oracle, but they have a fantastic free tier that would be good for that.

randombullet@programming.dev on 19 Jun 07:27 collapse

Actually you can get 2 IPs for free. Then use high availability

FlexibleToast@lemmy.world on 19 Jun 08:16 collapse

I don’t understand, each compute unit gets their own IP right?

randombullet@programming.dev on 20 Jun 05:27 collapse

Yes but you can get two free instances under the same account.

FlexibleToast@lemmy.world on 20 Jun 06:10 collapse

You can get 4 if you make them 1 core each.

FlexibleToast@lemmy.world on 18 Jun 13:41 next collapse

I have wireguard on my router. To me it makes sense. If my router is down, nothing inside my network is reachable anyway. If I’m going through my router, anything inside my network can be rebooted without effecting my connection. That said, I’m really considering using Pangolin github.com/fosrl/pangolin, and hosting it in Oracle Cloud. If you don’t know, Oracle Cloud has an extremely generous free tier. As much as I generally hate Oracle, I still recommend their free tier.

Dubiousx99@lemmy.world on 18 Jun 14:11 next collapse

Good point about network availability and endpoints.

ratzki@discuss.tchncs.de on 19 Jun 01:27 next collapse

Sounds interesting to consider, thank you! Did not know about Pangolin and was considering a wireguard VPN on the router to access my NAS services (jellyfin, files, foto backup), avoiding exposed ports etc, and also to avoid hotel WiFi security risks.

What are the benefits of using the could-pangolin setup vs. wireguard on the router?

FlexibleToast@lemmy.world on 19 Jun 05:17 collapse

I believe Pangolin is also using Wireguard. Pangolin is basically a self hosted Tailscale. I think the biggest advantage is the ease of management, but I’ve never used Pangolin or Tailscale so I couldn’t really tell you.

Jason2357@lemmy.ca on 19 Jun 05:40 collapse

Pangolin Is a reverse proxy for TLS/https. Headscale is the self hosted Tailscale.

FlexibleToast@lemmy.world on 19 Jun 08:17 collapse

Oh, I must have completely misunderstood what Pangolin is for. Is Pangolin like a replacement for Cloudflare tunnels in that case?

Jason2357@lemmy.ca on 19 Jun 16:56 collapse

Yeah, basically. It does bundle wireguard so that it can reverse proxy services over that. That’s probably what you were thinking of.

FlexibleToast@lemmy.world on 19 Jun 17:28 collapse

Okay, it’s been a while since I first heard of it. I misremembered. So, it would be cool to have a vps with Headscale and Pangolin.

elbarto777@lemmy.world on 19 Jun 12:02 collapse

Oracle??!!

FlexibleToast@lemmy.world on 19 Jun 12:30 collapse

Yeah… I know it’s insane. But they give you 4 arm cores, 24GB RAM, 200GB of storage in their always free tier.

rtxn@lemmy.world on 18 Jun 13:42 next collapse

Tailscale. It does some UDP fuckery to bypass NAT and firewalls (most of the time) so you don’t even need to open any ports. You can run it on individual hosts to access them directly, and/or you can set it up on one device to advertise an entire subnet and have the client work like a split tunnel VPN. I don’t know about OpenWRT, but both pfSense and OpnSense have built-in Tailscale plugins.

People are freaking out about their plan to go public, but for the moment, it’s a reliable, high quality service even on the free tier.

I’ve also used Ngrok and Twingate to access my LAN from outside, but they simply use relay servers instead of Tailscale’s black magic fuckery.

fragrantvegetable@sopuli.xyz on 19 Jun 10:55 collapse

It does some UDP fuckery to bypass NAT and firewalls

I wouldn’t be surprised if they use hole punching. It’s an old but effective technique which Skype famously used back in its heyday.

rtxn@lemmy.world on 19 Jun 11:52 next collapse

It’s based on hole punching, but with extras. The clients punch a hole in their respective firewalls then the service connect the holes so the clients end up communicating directly with each other. They have a lengthy blog post about NAT traversal.

girsaysdoom@sh.itjust.works on 19 Jun 12:37 collapse

It does a few techniques depending on the type of network and security obstacles. They posted an article on it that’s interesting.

I’d also check out pangolin or headscale like others recommeded though since you’re already looking to self-host.

dual_sport_dork@lemmy.world on 18 Jun 13:55 next collapse

I personally do not trust ISP provided routers to be secure and up to date, nor free of purposefully built in back doors for either tech support or surveillance purposes (or both). You can expect patches and updates on those somewhere on the timescale between late and never.

Therefore I always put those straight into bridge mode and serve my network with my own router, which I can trust and control. Bad actors (or David from the ISP help desk) may be able to have their way with my ISP router, but all that will let them do is talk to my own router, which will then summarily invite them to fuck off.

Likewise, I would not be keen on using an ISP provided router’s inbuilt VPN capability, which is probably limited to plain old PTPP – it has been on all of the examples I’ve touched so far – and thus should not be treated as secure.

You can configure an OpenWRT based router to act as an L2TP/IPSec gateway to provide VPN access on your network without the need for any additional hardware. It’s kind of a faff at the moment and requires manually installing packages and editing config files, but it can be done.

ratzki@discuss.tchncs.de on 19 Jun 01:44 collapse

Thank you for the David link 🎆

The distrust is adding up, I see your point. Will be adding an openWRT router to host a VPN and also manage VLANs. Ultimately might move AdGuard there instead of piHole on my NAS.

Still not sure what to think about the cloud-pangolin setup, so might work stepwise.

Thanks!

boydster@sh.itjust.works on 18 Jun 14:03 next collapse

Got an old raspberry pi laying around? PiHole+PiVPN is something I run on an old 3B+ I think, so I have something dedicated running both. But otherwise, I’d probably just spin up a container on a server or cluster and I’d probably go with debian and just run the exact same PiVPN setup script I did for the pi because it was super easy.

ratzki@discuss.tchncs.de on 19 Jun 01:35 collapse

Running piHole on a NAS, so would avoid adding another device. Adding a trusted router works already increase the device count.

(My rPi1 is connected to my PS2 and hosts all my ISO files from USB via Ethernet so no discs are required and loading is faster )

boydster@sh.itjust.works on 19 Jun 12:49 next collapse

I just don’t want my NAS doing anything other than being a NAS, so I intentionally don’t run extra services there, but its a matter of finding what works for you. As long as you get to the destination you’re looking for, its mission accomplished

ratzki@discuss.tchncs.de on 20 Jun 00:14 collapse

I have many containers running on it, for media services, data syncs etc. Enjoying it

minutnudler@feddit.dk on 19 Jun 20:51 collapse

This is a little off topic but would you mind sharing how you use your pi to serve ISO’s to your ps2?

ratzki@discuss.tchncs.de on 20 Jun 00:12 collapse

PSX-Pi SMB share

See the good explanation in the video.

Note: there are new MemCard mids yo play directly off a SD card, see his more recent videos.

catloaf@lemm.ee on 18 Jun 14:04 next collapse

If you use the ISP one, you’ll rapidly find you can’t configure it to do what you want. Run your own, lock it down, and keep it up to date.

ratzki@discuss.tchncs.de on 19 Jun 01:31 next collapse

Seems like rule #1 😄

Nighed@feddit.uk on 19 Jun 04:55 collapse

Depends on the ISP, my old one just handed out Fritz box routers with nothing locked down. Still using it now with the new ISP!

randombullet@programming.dev on 19 Jun 07:24 next collapse

I use ZeroTier on a MikroTik router.

Then just advertise routes on the router.

bruhduh@lemmy.world on 19 Jun 21:11 collapse

I use wireguard on my openwrt router