1. Cookbook
TunnelSats Public Wireguard API
  • About our team
  • 📢 Public
    • List available VPN servers
      GET
    • Create a new VPN subscription
      POST
    • Claim a WireGuard configuration after payment
      POST
    • Check subscription status via payment hash
      GET
    • Renew an existing VPN subscription
      POST
    • Get Subscription Status
      POST
  • 🔐 Authenticated
    • Sync Subscription
      POST
    • Create Referral Code
      POST
    • Referral History
      GET
    • List all active/paid subscriptions for the account
      GET
  • Announcements
    • 💫 What is TunnelSats?
    • 🚀 Introducing the TunnelSats Public API v1
    • How TunnelSats Leverages Public APIs for Confined VPN Management
  • Cookbook
    • 🛠️ Automation & Code Examples
    • 🐚 Bash One-Liners
    • 🛑 Error Codes & Troubleshooting
    • 🎁 Referral Program: Earn Bonus Months
    • 🚑 Node Health & Upkeep
    • 🛡️ Security & Authentication
  • Schemas
    • Server
    • InvoiceOrder
    • SubscriptionStatus
    • WireGuardConfig
    • ReferralCode
    • ReferralHistory
    • NodeLookup
    • ConnectivityResult
    • RenewalOrder
    • ClaimResult
    • ApiError
    • SubscriptionListItem
  1. Cookbook

🚑 Node Health & Upkeep

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.

🔍 1. Monitoring Tunnel Health#

The most reliable way to check if your VPN is truly "Up" is to verify the WireGuard handshake.

Health Check Script#

Save this script as tunnelsats-monitor.sh:
Finding your Interface Name
TunnelSats interface names match your config file. Run wg show | grep interface to confirm yours (usually tunnelsatsv2 or tunnelsats-region).

🛠️ 2. Auto-Healing & IP Migrations#

TunnelSats nodes may occasionally migrate IPs for maintenance. If your handshake fails for more than 5 minutes, our internal logic likely updated the DNS.

The "Auto-Sync" Pattern#

If your tunnel is down, don't just restart WireGuard. Instead, call the Status API to see if the server endpoint has changed.

📉 3. Checking Server Status#

Before you troubleshoot your local node, check if the TunnelSats region is online.

Best Practices for Upkeep#

Persist your paymentHash: Store it in a file like /mnt/data/tunnelsats.hash.
Add a Cron Job: Run the health check every 5 minutes: */5 * * * * /path/to/tunnelsats-monitor.sh.
Monitor Latency: If users report high latency, use GET /api/public/v1/ping/test to find a better region.
Modified at 2026-04-13 06:13:33
Previous
🎁 Referral Program: Earn Bonus Months
Next
🛡️ Security & Authentication
Built with