Maintaining a 24/7 VPN connection is essential for Lightning Node operations. This guide provides scripts to automate the monitoring and recovery of your TunnelSats tunnel.
TunnelSats nodes may occasionally migrate IPs for maintenance. If your handshake fails for more than 5 minutes, our internal logic likely updated the DNS.
If your tunnel is down, don't just restart WireGuard. Instead, call the Sync API to get fresh data from the VPN server, or the Status API to check by WireGuard key.
When your bandwidth exceeds 70% (approaching the 100GB soft cap), the VPN server may throttle or disable your peer. Automate recovery with the bandwidth-reset endpoint.
WireGuard Claim: Always offer a way to "Claim" the config again if the initial download fails.
Self-Healing: If wg show indicates no handshake for >3 minutes, automatically call /sync (authenticated) or /status (by key) to verify the server hasn't migrated.
Bandwidth Monitoring: Periodically check /status and warn users when bandwidth_used_gb exceeds 70GB.
Custom Keys
We recommend generating keys on our server (leaving wgPublicKey empty) for the easiest setup. However, for maximum privacy, allow advanced users to provide their own wgPublicKey.