Logging configuration
Verbosity levels
Control log output detail with the--verb option:
Verbosity level reference
Verbosity level reference
- 0 - No output except fatal errors
- 1-4 - Normal usage range (3 recommended for good summary)
- 5 - Shows R/W characters for each packet (uppercase for TCP/UDP, lowercase for TUN/TAP)
- 6-11 - Debug info range (see errlevel.h for details)
Log output options
Log to file
Log to file
--log option takes effect immediately and persists across SIGHUP, SIGUSR1, and --ping-restart events.Log to syslog
Log to syslog
Machine-readable format
Machine-readable format
Log management
Status files
Basic status reporting
Generate status files with connection and routing information:Status file formats
Version 1 - Traditional format (default)
Version 1 - Traditional format (default)
- Common Name
- Real Address
- Bytes Received
- Bytes Sent
- Connected Since
Version 2 - Extended format
Version 2 - Extended format
- Common Name
- Real Address
- Virtual Address
- Virtual IPv6 Address
- Username
- Client ID
- Peer ID
- Data Channel Cipher
- Bytes Received
- Bytes Sent
- Connected Since
Version 3 - Tab-separated format
Version 3 - Tab-separated format
Trigger status output
Generate status on demand:Management interface
Enabling the management interface
The management interface provides real-time control and monitoring:Restricting access
For Unix sockets, restrict by user and group:Connecting to management interface
Connect using telnet or netcat in raw mode:help for available commands.
Management interface commands
Status monitoring commands
status - View connection status
status - View connection status
--status directive and includes:- Connected clients (server mode)
- Routing table
- Traffic statistics
state - Connection state
state - Connection state
CONNECTING- Initial stateWAIT- Waiting for server response (client)AUTH- Authenticating with server (client)GET_CONFIG- Downloading configuration (client)ASSIGN_IP- Assigning IP to interfaceADD_ROUTES- Adding routesCONNECTED- Initialization completeRECONNECTING- Restart occurredEXITING- Graceful exit in progressRESOLVE- DNS lookup (client)TCP_CONNECT- Connecting to TCP server (client)AUTH_PENDING- Authentication pending (client)
>STATE: prefix with up to 9 comma-separated parameters including timestamp, state name, descriptive string, and network addresses.log - View log messages
log - View log messages
>LOG:timestamp,flags,messageFlags: I (info), F (fatal), N (non-fatal error), W (warning), D (debug)bytecount - Bandwidth monitoring
bytecount - Bandwidth monitoring
bytes_received and bytes_sent environmental variables in the >CLIENT:DISCONNECT notification.Client management commands
kill - Disconnect client
kill - Disconnect client
client-kill - Kill by client ID
client-kill - Kill by client ID
status command to find client IDs (CID).Control commands
signal - Send signals
signal - Send signals
verb - Adjust verbosity
verb - Adjust verbosity
mute - Control message repetition
mute - Control message repetition
Utility commands
Real-time notifications
When monitoring is enabled, the management interface sends real-time messages with> prefix:
Notification types
Notification types
- >BYTECOUNT: - Bandwidth usage updates
- >BYTECOUNT_CLI: - Per-client bandwidth (server)
- >CLIENT: - Client connection/disconnection events
- >ECHO: - Echo messages from config
- >FATAL: - Fatal errors before exit
- >HOLD: - Hold state indication
- >INFO: - Informational messages
- >LOG: - Log message output
- >NEED-OK: - User action required
- >NEED-STR: - User input required
- >PASSWORD: - Password request or verification failure
- >STATE: - State changes
- >INFOMSG: - Authentication info from server
Client notifications (server mode)
With--management-client-auth, monitor client lifecycle:
-
CONNECT/REAUTH - New connection or renegotiation
-
ESTABLISHED - Successful authentication
-
ADDRESS - Virtual address assignment
-
DISCONNECT - Client disconnection
- CID = Client ID (sequential: 0, 1, 2, …)
- KID = Key ID for TLS session
- PRI = Primary (1) or Secondary (0) address
Integration with monitoring tools
Prometheus exporter pattern
Parse status file or use management interface:Log aggregation
Forward logs to centralized systems:Health checks
Implement monitoring checks:Alerting scenarios
Monitor and alert on these conditions:Connection failures
Connection failures
- State stuck in RECONNECTING
- Repeated AUTH failures
- Certificate verification errors
- TLS negotiation failures
Performance issues
Performance issues
- High packet loss
- Excessive replay warnings
- Low bandwidth throughput
- High CPU usage
Security events
Security events
- Failed authentication attempts
- Certificate revocation list updates
- Management interface unauthorized access
- Unusual client connection patterns
Operational issues
Operational issues
- Process restarts
- Configuration reload failures
- Disk space issues (log files)
- Interface creation failures