Skip to content

Instantly share code, notes, and snippets.

@craigbalding
Created May 6, 2026 05:39
Show Gist options
  • Select an option

  • Save craigbalding/631721c29f714c66bb036cd5c85fa39d to your computer and use it in GitHub Desktop.

Select an option

Save craigbalding/631721c29f714c66bb036cd5c85fa39d to your computer and use it in GitHub Desktop.
Tailscale RDP
# powershell -ExecutionPolicy Bypass -File .\rdp-tailscale-only.ps1
# Disable the built-in broad RDP rules
Disable-NetFirewallRule -DisplayGroup "Remote Desktop"
# Allow RDP only from Tailscale IPv4
New-NetFirewallRule `
-DisplayName "RDP over Tailscale IPv4 only" `
-Direction Inbound `
-Action Allow `
-Protocol TCP `
-LocalPort 3389 `
-RemoteAddress 100.64.0.0/10
# Optional: allow Tailscale IPv6 too
New-NetFirewallRule `
-DisplayName "RDP over Tailscale IPv6 only" `
-Direction Inbound `
-Action Allow `
-Protocol TCP `
-LocalPort 3389 `
-RemoteAddress fd7a:115c:a1e0::/48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment