Tailscale

On this page 7

Tailscale is a mesh virtual private network service that connects laptops, servers, containers and phones into one private network, called a tailnet, using the WireGuard protocol for encryption. In network security and networking, it is classified as a form of zero trust network access, because every connection is authorized by user and device identity rather than by the location of a machine on a trusted internal segment.

Unlike a classic hub-and-spoke VPN concentrator, Tailscale separates a central coordination server, which only distributes keys and policy, from a peer-to-peer data plane in which devices exchange encrypted traffic directly. The result is a network that administrators can deploy in minutes without opening inbound firewall ports, while still enforcing centrally managed access rules.

How Tailscale builds an encrypted mesh

Tailscale builds an encrypted mesh by giving every device its own WireGuard key pair and letting a coordination service tell each node which peers it may reach. The private key never leaves the device; only the public key is uploaded, so the coordination service cannot decrypt traffic even though it orchestrates the network.

When a user signs in, the client authenticates through an external identity provider using OpenID Connect or SAML, registers its public key and receives a network map. That map lists the peers the device is allowed to contact, their public keys, their candidate endpoints and the current access control policy. Each change to the policy or the device list is pushed to clients within seconds.

Each node receives a stable address from the 100.64.0.0/10 range, the carrier-grade NAT block, plus an IPv6 address from a dedicated unique local prefix. Because addresses follow the device rather than the physical network, a server keeps the same tailnet address whether it runs in a data center, a cloud region or a home office.

The table below separates the main components and the role each plays in the architecture.

ComponentPlaneFunction
Coordination serverControl planeDistributes public keys, network maps and policy
Client daemonData planeRuns WireGuard, enforces filters, performs NAT traversal
DERP relayData plane fallbackForwards encrypted packets when direct paths fail
Identity providerAuthenticationVerifies users through SSO before keys are accepted
Policy fileControl planeDefines who may reach which hosts and ports
Core components of a Tailscale network

NAT traversal and DERP relays

Tailscale reaches peers behind firewalls through UDP hole punching, a technique in which both sides send packets simultaneously so that their stateful firewalls create matching outbound mappings. Clients discover their public endpoints with a STUN-style probe and exchange those candidates through the coordination service, typically using UDP port 41641 by default.

When both peers sit behind symmetric NAT or a network that blocks UDP entirely, direct paths may fail. In that case traffic flows through Designated Encrypted Relay for Packets servers, known as DERP, over HTTPS on port 443. The relay sees only already encrypted WireGuard packets, so relaying affects latency and throughput but not confidentiality. Clients keep probing and upgrade to a direct path as soon as one becomes available.

The following table summarizes how common network conditions affect the connection path.

Network conditionResulting pathPractical effect
Public IP or easy NATDirect UDPLowest latency, full throughput
Both sides behind cone NATDirect after hole punchingNear-direct performance
One side behind symmetric NATOften direct, sometimes relayedVariable latency
UDP blocked by firewallDERP relay over port 443Higher latency, limited throughput
Connection paths under typical network conditions

Access control and identity in Tailscale

Access in Tailscale is governed by a central policy file written in HuJSON, a JSON dialect that allows comments and trailing commas. Rules grant users, groups or tags access to destination hosts and ports, and the default for an explicit policy is deny everything not allowed. Filters are enforced on the receiving node, so even a compromised peer cannot bypass the rule set at its destination.

Tags assign identity to servers and automated workloads rather than to people, which prevents a service from losing access when its original installer leaves the organization. Additional controls include device approval, which holds new nodes until an administrator accepts them, key expiry that forces periodic reauthentication, and Tailnet Lock, which requires trusted nodes to sign new keys so that a compromised coordination service cannot add rogue devices.

  • Subnet routers advertise existing LAN or VPC ranges to the tailnet without installing the client on every host.
  • Exit nodes route all internet traffic of selected devices through a chosen node, similar to a full-tunnel VPN.
  • MagicDNS gives each device a resolvable name inside the tailnet.
  • Tailscale SSH authorizes SSH sessions through the same policy file instead of distributed key files.

Tailscale compared with traditional VPN designs

Tailscale differs from conventional remote access mainly in its topology and trust model. OpenVPN and IPsec deployments usually route every client through a central gateway, while a site-to-site VPN joins entire networks. Tailscale instead links individual devices directly and authorizes each flow by identity, which narrows the blast radius when one endpoint is compromised.

The comparison below places Tailscale beside related approaches that appear in network security architectures.

ApproachTopologyTrust basisTypical weakness
TailscalePeer-to-peer meshUser and device identityDepends on hosted control plane
Plain WireGuardManually configured peersStatic public keysKey distribution does not scale
OpenVPN gatewayHub and spokeCertificates on a concentratorGateway bottleneck and exposed port
IPsec site-to-siteNetwork to networkPre-shared keys or certificatesBroad flat access between sites
SASE platformCloud points of presenceIdentity plus inspectionHigher cost and vendor dependence
Tailscale and related remote access approaches

Organizations that cannot rely on a vendor-hosted control plane sometimes run Headscale, an independent open-source implementation of the coordination server. It supports the core mesh features but lacks some commercial functions, and its operators take on full responsibility for availability and patching.

Deployment decisions and common pitfalls

Successful Tailscale deployments start with a written access policy rather than the permissive default that allows every device to reach every other device. Administrators should replace the default rule early, group servers by tags, and restrict subnet routers to the narrowest prefixes required.

The table below lists frequent mistakes, their consequences and the recommended correction.

MistakeConsequenceRecommended fix
Keeping the allow-all default policyFlat network with lateral movement riskWrite explicit least-privilege rules
Disabling key expiry on user laptopsStolen devices keep access indefinitelyDisable expiry only for tagged servers
Advertising a whole /16 via a subnet routerExcessive exposure of internal hostsAdvertise only required subnets
Ignoring relayed connectionsPoor performance blamed on the networkAllow outbound UDP to improve direct paths
Sharing one auth key widelyUntracked devices join the tailnetUse ephemeral, single-use or tagged keys
Frequent deployment mistakes and fixes

A further limitation is that the tailnet relies on endpoint security. Tailscale authenticates devices and encrypts traffic, but it does not replace patching, endpoint detection or network segmentation inside the hosts themselves, and a compromised laptop with valid access remains a serious threat.

A non-technical view

Tailscale lets computers in different places talk to each other as if they sat in the same office, while keeping everything private. Each device carries its own digital lock and key, and a central service simply tells devices who is allowed to talk to whom.

Think of a building where every room has a badge reader instead of one guarded front door. Getting into the building does not let anyone wander freely; each door checks the badge. That is the key idea of Tailscale: access is decided person by person and device by device, not by being inside the network.

A concrete example

A small software company with 25 employees runs a staging database in a cloud VPC, a build server in a colocation rack and a monitoring dashboard in the office. Previously, an OpenVPN gateway exposed port 1194 to the internet and gave every connected employee access to all three networks.

The operations engineer installs Tailscale on the build server, deploys one subnet router in the cloud VPC that advertises only the database subnet, and tags each server. The policy file allows developers to reach the build server on port 22 and the staging database on port 5432, while only the operations group may open the dashboard. New laptops require administrator approval before joining.

After the migration the company closes its inbound VPN port entirely. Most connections run directly between laptops and servers, a contractor receives access to one host only, and the audit log shows every connection attempt. The attack surface shrinks noticeably without adding hardware.