Run a local DERP relay on the NixOS box#191
Draft
samestep wants to merge 3 commits into
Draft
Conversation
Every VM is on the tailnet but behind per-VM NAT, and both physical machines are behind T-Mobile 5G CGNAT, so Tailscale can never connect them directly and relays all VM-to-VM traffic through a cloud DERP — up over the slow 5G upload and back, at ~1 MB/s. Run derper on the always-on NixOS machine so the relay stays on the LAN: the VMs prefer it at home (lowest latency) and fall back to the cloud DERPs when away. The host does not join the tailnet; derper only forwards already-encrypted WireGuard packets, so it can't read the traffic or reach the VMs. Self-signed and pinned by SHA256 in the DERP map, so no domain or ACME cert is needed. Also disable Wi-Fi power saving, which added ~60-110 ms to every LAN round-trip — enough that Tailscale rated the local relay no faster than the cloud one and refused to use it; off, the hop is ~5 ms and the local relay wins. The relay's IP is pinned so its self-signed cert doesn't drift. The gateway (Arcadyan TMO-G4AR) exposes no DHCP settings, so rather than a reservation the box holds a static 192.168.12.10 on its Wi-Fi connection, below the gateway's pool. README documents that plus the rest: reading the pin derper logs, adding the DERP-map region to the tailnet policy, and verifying. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Wku9K54eBg5KJnXDfpvkQ
derper stores its own private key in the file named by -c, and defaults that path (/var/lib/derper/derper.key) only when it runs as root. Under DynamicUser it's unprivileged, so without -c it exits at once with "-c <config path> not specified" and systemd's restart limiter latches. Point -c at the state directory so it creates and reuses the key there. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Wku9K54eBg5KJnXDfpvkQ
This was referenced Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.