Port reference › VPN
Port 51820 · WireGuard
WireGuard VPN
UDP VPN Exposure risk: Low
What is port 51820 used for?
Default WireGuard port. Tailscale uses WireGuard too but picks ports automatically.
Dynamic / ephemeral port (49152-65535): assigned by the OS to outgoing connections.
Security notes
It does not answer without a valid key, so it barely shows up in scans. Just guard the private keys.
Allow port 51820 through the firewall
This port is generally fine to expose publicly.
sudo ufw allow 51820/udp
sudo ufw status sudo firewall-cmd --permanent --add-port=51820/udp
sudo firewall-cmd --reload sudo iptables -A INPUT -p udp --dport 51820 -j ACCEPT New-NetFirewallRule -DisplayName "Allow UDP 51820" -Direction Inbound -Protocol UDP -LocalPort 51820 -Action Allow # Replace sg-0123456789abcdef0 with your security group ID
aws ec2 authorize-security-group-ingress --group-id sg-0123456789abcdef0 --protocol udp --port 51820 --cidr 0.0.0.0/0 Check whether port 51820 is open
sudo ss -ulpn | grep ':51820 ' netstat -ano | findstr :51820 nc -zuv SERVER 51820
# UDP can look "open" even with no reply, so do not trust this alone.
# Testing with a real client for the service is more reliable. sudo lsof -i :51820