Skip to content

Commit 59ee758

Browse files
dguidoclaude
andauthored
Add diagnostic commands section to troubleshooting guide (#14895)
Add a new 'Diagnostic Commands' section to help users investigate issues themselves. Includes: - Config options to enable verbose logging (algo_no_log, strongswan_log_level, privacy_enhancements_enabled) - Server-side diagnostics for WireGuard, IPsec/StrongSwan, and DNS - Log viewing commands (journalctl, dmesg) - Network and firewall diagnostic commands - Client-side diagnostics for macOS, Linux, and Windows Closes #514 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent cfda275 commit 59ee758

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

docs/troubleshooting.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ First of all, check [this](https://github.com/trailofbits/algo#features) and ens
3131
* [Clients appear stuck in a reconnection loop](#clients-appear-stuck-in-a-reconnection-loop)
3232
* [Wireguard: clients can connect on Wifi but not LTE](#wireguard-clients-can-connect-on-wifi-but-not-lte)
3333
* [IPsec: Difficulty connecting through router](#ipsec-difficulty-connecting-through-router)
34+
* [Diagnostic Commands](#diagnostic-commands)
35+
* [Enable Verbose Logging](#enable-verbose-logging)
36+
* [Server-Side Diagnostics](#server-side-diagnostics)
37+
* [Client-Side Diagnostics](#client-side-diagnostics)
3438
* [I have a problem not covered here](#i-have-a-problem-not-covered-here)
3539

3640
## Installation Problems
@@ -470,6 +474,100 @@ If your router has a setting called something like "VPN Passthrough" or "IPsec P
470474

471475
If your router runs [pfSense](https://www.pfsense.org) and a single IPsec client can connect but you have issues when using multiple clients, you'll need to change the **Outbound NAT** mode to **Manual Outbound NAT** and disable the rule that specifies **Static Port** for IKE (UDP port 500). See [Outbound NAT](https://docs.netgate.com/pfsense/en/latest/book/nat/outbound-nat.html#outbound-nat) in the [pfSense Book](https://docs.netgate.com/pfsense/en/latest/book).
472476

477+
## Diagnostic Commands
478+
479+
If you want to investigate issues yourself, here are useful commands to run on your Algo server.
480+
481+
### Enable Verbose Logging
482+
483+
By default, Algo minimizes logging for privacy. To enable detailed logging for debugging:
484+
485+
**During deployment** - Edit `config.cfg` before running `./algo`:
486+
```yaml
487+
algo_no_log: false # Show detailed Ansible output (includes sensitive data!)
488+
strongswan_log_level: 2 # IPsec debug logging (default: -1 disabled)
489+
privacy_enhancements_enabled: false # Disable log rotation/clearing
490+
```
491+
492+
**Important:** Reset these to defaults before sharing logs or screenshots, as they may contain sensitive information.
493+
494+
### Server-Side Diagnostics
495+
496+
**Check service status:**
497+
```bash
498+
# WireGuard
499+
systemctl status wg-quick@wg0
500+
wg show # Show WireGuard interface and peers
501+
502+
# IPsec/StrongSwan
503+
systemctl status strongswan
504+
ipsec statusall # Show all IKE_SA and CHILD_SA
505+
ipsec leases # Show assigned virtual IPs
506+
507+
# DNS
508+
systemctl status dnscrypt-proxy.socket dnscrypt-proxy.service
509+
ss -lnup | grep :53 # Check what's listening on DNS port
510+
```
511+
512+
**View logs:**
513+
```bash
514+
# WireGuard (kernel module, limited logging)
515+
dmesg | grep wireguard
516+
517+
# IPsec/StrongSwan
518+
journalctl -u strongswan -f # Follow strongswan logs
519+
journalctl -t charon -f # Follow IKE daemon logs
520+
521+
# DNS
522+
journalctl -u dnscrypt-proxy -f
523+
524+
# General system
525+
journalctl -f # Follow all system logs
526+
```
527+
528+
**Check network and firewall:**
529+
```bash
530+
# Verify VPN interfaces exist
531+
ip addr show wg0 # WireGuard interface
532+
ip addr show # All interfaces
533+
534+
# Check firewall rules
535+
iptables -L -v -n # IPv4 filter rules with counters
536+
iptables -t nat -L -v -n # IPv4 NAT rules
537+
ip6tables -L -v -n # IPv6 filter rules
538+
539+
# Test DNS resolution
540+
dig @172.x.x.x google.com # Replace with your local_service_ip
541+
```
542+
543+
**Find your local DNS IP:**
544+
```bash
545+
grep local_service_ip /etc/dnsmasq.d/algo.conf 2>/dev/null || \
546+
grep listen_addresses /etc/dnscrypt-proxy/dnscrypt-proxy.toml
547+
```
548+
549+
### Client-Side Diagnostics
550+
551+
**macOS:**
552+
```bash
553+
# View VPN-related logs (last hour)
554+
log show --predicate 'subsystem == "com.apple.networkextension"' --info --last 1h
555+
556+
# Or use Console.app and search for: nesessionmanager
557+
```
558+
559+
**Linux (WireGuard):**
560+
```bash
561+
sudo wg show
562+
journalctl -t NetworkManager -f # If using NetworkManager
563+
```
564+
565+
**Windows:**
566+
```powershell
567+
# View VPN event logs
568+
Get-WinEvent -LogName "Microsoft-Windows-VPN-Client/Operational" -MaxEvents 50
569+
```
570+
473571
## I have a problem not covered here
474572

475573
If you have an issue that you cannot solve with the guidance here, [create a new discussion](https://github.com/trailofbits/algo/discussions) and ask for help. If you think you found a new issue in Algo, [file an issue](https://github.com/trailofbits/algo/issues/new).

0 commit comments

Comments
 (0)