Overview
WireGuard uses public/private key pairs for authentication. Each user gets a unique peer configuration per server. StartMyVPN generates, stores, and delivers these configs automatically.Peer config lifecycle
Downloading WireGuard config
Users get their per-server config from:- Web dashboard:
/vpn/download/{server}/wireguard - API:
GET /v1/servers/{server}/wireguard
.conf file contains:
- Client private key
- Client IP address (assigned by StartMyVPN)
- Server public key
- Server endpoint (IP:port)
- DNS servers
AllowedIPs(typically0.0.0.0/0for full tunnel)
Speed limits
WireGuard supports per-user bandwidth speed limits usingtc (traffic control) on the server. When a plan has a speed limit configured (in Mbps), StartMyVPN enforces it on the server-side peer interface.
Speed limits are applied/updated automatically when:
- A service is created
- A plan’s speed limit is changed
- A service is upgraded or downgraded to a different plan
Bandwidth tracking
WireGuard doesn’t log individual connections, but StartMyVPN polls each WireGuard server periodically to readrx_bytes / tx_bytes counters per peer. This data is stored and used for:
- User-facing bandwidth usage display
- Bandwidth limit enforcement
Jobs that run in the background
| Job | When it runs |
|---|---|
AddUserJob | New service created or reactivated |
RemoveUserJob | Service suspended or terminated |
UpdateSpeedLimitJob | Plan speed limit changed |
DeleteExpiredServiceConfigsJob | Service expires, cleanup configs |
CreateConfig | Initial config generation |
InstallWireGuard | New server being provisioned |