Skip to content

Commit 4570ce3

Browse files
committed
update TUNNEL.md
Signed-off-by: kerthcet <kerthcet@gmail.com>
1 parent 5a8b4ed commit 4570ce3

1 file changed

Lines changed: 63 additions & 9 deletions

File tree

docs/TUNNEL.md

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,69 @@ SandD supports secure tunnel mode for production deployments using mesh VPN tech
1717

1818
---
1919

20-
## Quick Comparison
21-
22-
| Feature | Direct Mode | Tunnel Mode |
23-
|---------|-------------|-------------|
24-
| Setup | 5 minutes | 15 minutes |
25-
| Controller IP | Public | Private (mesh) |
26-
| NAT traversal | Manual | Automatic |
27-
| Network isolation |||
28-
| Multi-cloud | ⚠️ Needs VPN | ✅ Built-in |
20+
## Direct Mode vs Tunnel Mode (VPN)
21+
22+
### Visual Comparison
23+
24+
**Direct Mode (No VPN):**
25+
```
26+
┌──────────┐ ┌──────────┐
27+
│ Daemon │──── WebSocket over ───→│Controller│
28+
│ │ public internet │Public IP │
29+
└──────────┘ └──────────┘
30+
31+
- Direct WebSocket connection
32+
- No VPN
33+
- Controller needs public IP
34+
- Daemons connect over internet
35+
```
36+
37+
**Tunnel Mode (Mesh VPN):**
38+
```
39+
┌──────────┐ ┌──────────┐
40+
│ Daemon │════ VPN tunnel ════════│Controller│
41+
│ Mesh IP │ WireGuard encrypted │ Mesh IP │
42+
└──────────┘ └──────────┘
43+
↓ ↓
44+
Join VPN Join VPN
45+
↓ ↓
46+
┌────────────────────────────────────────────┐
47+
│ Headscale (VPN coordinator) │
48+
└────────────────────────────────────────────┘
49+
50+
- VPN mesh network
51+
- Encrypted tunnels between nodes
52+
- Private mesh IPs
53+
- No public IPs needed
54+
```
55+
56+
### Feature Comparison
57+
58+
| Feature | Direct Mode | Tunnel Mode (VPN) |
59+
|---------|-------------|-------------------|
60+
| **Setup complexity** | Simple (5 min) | Medium (15 min) |
61+
| **Controller IP** | Must be public | Can be private |
62+
| **Daemon location** | Anywhere (outbound) | Anywhere (mesh) |
63+
| **NAT traversal** | Manual (firewall rules) | Automatic (hole punching) |
64+
| **Encryption** | Need to add TLS | Built-in (WireGuard) |
65+
| **Port exposure** | Public (attack surface) | Hidden (mesh only) |
66+
| **Multi-cloud** | Need VPC peering | Works automatically |
67+
| **Use case** | Single cloud/datacenter | Cross-cloud, laptop↔cloud |
68+
69+
### When to Use Each
70+
71+
**Use Direct Mode when:**
72+
- ✅ Controller has stable public IP
73+
- ✅ Single cloud or trusted network
74+
- ✅ Development and testing
75+
- ✅ Simple setup preferred
76+
77+
**Use Tunnel Mode (VPN) when:**
78+
- ✅ Controller behind NAT (laptop, home, corporate)
79+
- ✅ Multiple clouds (AWS + GCP + Azure)
80+
- ✅ Don't want exposed ports
81+
- ✅ Need encrypted communication
82+
- ✅ Dynamic IPs or ephemeral instances
2983

3084
---
3185

0 commit comments

Comments
 (0)