20250323-tailscale.jpeg

<aside> ✅

This post discusses my setup, which allows me to access my Traefik HTTPS upgraded services over the Tailscale mesh as if I were at home. To achieve this, I use Tailscale’s “subnet router” and DNS at Cloudflare, pointing to a private IP. Traefik hosts and HomePage entries are propagated by Docker labels.

</aside>

Revision: 20250323-0 (init: 20250323)

Detailing my setup during a recent “https://www.reddit.com/r/selfhosted/comments/1imobmz/comment/mcabxlu/” conversation made me realize it would be good to discuss it further…

This post is not a complete guide, and rely on a few previous posts for more in-depth instructions.

This setup relies on Tailscale. I have been a user of Tailscale since 2021. Over the years, I have recommended it to a few dozen friends :) I published a post on GitHub about "localhost-only Linux Desktop in a container on Unraid accessed over a non-root ssh tunnel and adding Tailscale to add a Zero Conf VPN over Wireguard" which was shared on Tailscale's blog in March 2022 and have been a "Friend of Tailscale" for a while. Since then, my home lab setup has significantly grown, and Tailscale is still the easiest way to get back into my lab when traveling.

If you are curious about the tool, check their "Why Tailscale".

The tl;dr of this post can be described in the following image, for which we have discussed every component in previous posts.

Slide1.png

If you are looking for further details on the different components of this diagram, refer to the individual posts with setup instructions:

Tailscale

For a primer, see "How Tailscale works".

Mesh networking is a network topology where devices (nodes) connect directly to each other, forming a decentralized network structure without relying on a central hub. This allows for multiple data transmission paths, increased reliability, and self-healing capabilities, as nodes can route traffic through alternate paths if one connection fails. Tailscale creates a peer-to-peer mesh network (called a tailnet) rather than routing all traffic through a central server. Tailscale uses NAT Traversal for direct connections between devices —even behind firewalls or NATs— using techniques like hole punching.

A Virtual Private Network (VPN) is a technology that creates a secure and encrypted connection over a public network. It allows users to send and receive data as if they were directly connected to the private network it connects to.

WireGuard is a modern VPN protocol known for its simplicity, speed, and robust security. It leverages state-of-the-art cryptography, such as ChaCha20 for encryption and Poly1305 for authentication, making it highly efficient and secure. Its strengths include direct Linux kernel integration, fast performance, and low latency due to its operation over UDP.

Tailscale is a mesh VPN that allows devices to connect securely and directly to each other using a combination of direct and relayed connections. It leverages the WireGuard protocol for encryption and Designated Encrypted Relay for Packets (DERP) servers for situations where direct connections are impossible (”these fill the same role as TURN servers in the ICE standard, except they use HTTPS streams and WireGuard keys”). Tailscale uses DERP servers as relay points when direct connections between devices cannot be established. These servers are crucial for maintaining network connectivity that blocks direct UDP traffic or has strict firewalls.

Tailscale uses existing identity providers (like Google, Microsoft, GitHub,...) for authentication, eliminating the need for separate credentials. Its MagicDNS feature allows devices to be addressed by name rather than IP address within the tailnet.

Tailscale's traffic routing is designed to be efficient and scalable. It uses a hybrid model with a centralized control plane for key management and policy enforcement. In contrast, the data plane operates in a mesh topology, allowing devices to communicate directly with each other whenever possible.

Tailscale's Regional Routing feature helps scale traffic globally by directing clients to the nearest available infrastructure, ensuring low latency and high availability.

Tailscale adds features to its product, making it very friendly for the home lab enthusiast. It was recently featured as integrated with the latest stable release of Unraid (7.0); see https://unraid.net/tailscale for more details.

For this post, let me introduce two more features:

Setup

In this setup, when we are at an alternate location and want to connect to a service within our home lab, we rely on the tailnet NAT traversal to reach the subnet router, which allows it to access the reverse proxy configured to redirect the calling client to the destination URL.

For this to function:

Following the earlier picture:

Category

Tags


Untitled

Untitled