Tailscale Peer Relay: Build a Faster Relay Path
Generate the right relay command and grant policy, then verify whether traffic is direct, peer-relay, or DERP.
Build my relay planDirect
Fastest when possible
Peer relay
Better throughput when direct fails
DERP
Reliable managed fallback
Quick answer
Tailscale tries a direct connection first, a configured peer relay second, and DERP last. A peer relay can improve throughput when strict NAT, CGNAT, or firewalls block a direct path.
Build your Tailscale peer relay plan
Select the relay host, its internet edge, and your goal. The planner generates the matching listener, firewall, access policy, and validation sequence; replace the example tags and addresses before use.
Placement advice
Place the relay on a wired, always-on device with fast paths to both peers. Benchmark the same endpoints before and after.
Network edge plan
tailscale set --relay-server-port=40000sudo ufw allow 40000/udp{
"grants": [
{
"src": ["tag:client"],
"dst": ["tag:peer-relay"],
"app": { "tailscale.com/cap/relay": [] }
}
]
}tailscale ping <peer-name-or-ip>
tailscale statusHow a Tailscale peer relay fits the route
Tailscale first tries to build a direct encrypted connection. When NAT traversal fails, an authorized peer relay gives the tailnet a route you control before traffic falls back to a Tailscale DERP relay. That makes peer relay useful for hard NAT, predictable regional routing, and large transfers—not for replacing a healthy direct connection.
Direct
Best path when both peers can traverse NAT.
Peer relay
Your authorized, reachable tailnet device.
DERP
Reliable managed fallback when needed.
Peer relay vs direct connection vs DERP
These are connection paths, not three VPN products. Tailscale chooses them in order, so a working direct connection normally remains the target while peer relay and DERP provide resilience.
| Path | Selection order | Best use | Trade-off |
|---|---|---|---|
| Direct | First | Normal peer-to-peer traffic | May fail across hard NAT or restrictive firewalls |
| Peer relay | After direct fails | A controlled, potentially higher-throughput fallback | You operate the reachable relay host and UDP path |
| DERP relay | Last fallback | Reliable connectivity without your own relay host | Longer route or lower throughput in some locations |
Prerequisites before setup
A relay command cannot fix an unreachable listener. Confirm the software, permissions, tags, and entire UDP route before troubleshooting throughput.
- Tailscale 1.86 or later on the relay host and clients
- An always-on relay device that is not iOS, Android, or Apple TV
- Tailnet owner, admin, or network-admin access to edit policy
- A stable, reachable UDP port such as 40000
- Tags that distinguish clients from the peer relay
Four-step setup
Use the generated plan above, then validate every layer in this order.
- 1
Enable the listener
Run the relay command on the chosen host and confirm the Tailscale service remains healthy.
- 2
Apply the relay grant
Replace the example tags with your own least-privilege source and destination groups.
- 3
Open the UDP path
Match UDP 40000 across the host firewall, router or load balancer, and any cloud firewall.
- 4
Force a realistic test
Test from networks where direct connectivity fails, then inspect ping and status before measuring speed.
Do not grant relay access to every identity by default
Test the real path, not just reachability
A successful ping proves the peer is reachable. Its path label tells you whether the traffic is direct, peer-relay, or DERP; a controlled endpoint-to-endpoint benchmark tells you whether the relay is faster.
tailscale ping <peer-name-or-ip>
tailscale status
iperf3 -c <peer-tailscale-ip> -P 4direct
NAT traversal worked. Do not force a relay unless you have a measured reason.
peer-relay
The configured relay is active. Compare throughput and latency with the prior path.
DERP
The peer relay was not selected. Check grant, UDP reachability, and endpoint advertising.
Why Tailscale still uses DERP
Work from control plane to data plane. A relay can be online in the admin console while its UDP listener is unreachable from the client network.
Fast diagnosis order
Version → tags → relay grant → listener → host firewall → router or cloud edge → client network UDP.
Measure peer relay speed fairly
Keep the endpoints constant
Use the same client, server, file or iperf3 stream count, and time window. Record path labels with every result.
Watch both relay legs
The slower client-to-relay or relay-to-destination leg caps the transfer. Wi-Fi and CPU can matter more than the port number.
Repeat at busy and quiet times
One short run can hide congestion and route changes. Compare medians instead of presenting one peak as a limit.
Keep DERP as the control
A peer relay is useful only when it improves the real workload or gives you needed route control and auditability.
Tailscale peer relay FAQ
Direct answers to the setup, path selection, ports, Windows, speed, DERP, and disable questions people ask most.
Check the network around your relay
Use these focused guides when the planner exposes an upstream NAT or routing dependency.
Official references
Peer relay requirements and CLI syntax can change. Check the current primary documentation before a production rollout.