Mesh Network
Hook uses a WireGuard-based mesh network to provide secure, encrypted communication between all infrastructure nodes. This enables nodes to communicate as if they were on the same local network, regardless of their physical location.Overview
The mesh network provides:- Encrypted tunnels between all nodes using WireGuard
- Private IP addressing (10.100.0.0/24 by default)
- Automatic peer discovery and configuration
- Network isolation for sensitive services
Architecture
Mesh Server (Helm)
The Helm server acts as the mesh network coordinator:Mesh Clients
All other nodes (Corsair, Nameserver, Payload Server) connect as mesh clients:Enabling the Mesh Network
On Helm
The mesh network can be enabled at startup or via gRPC:On Corsair/Other Nodes
Nodes connect to the mesh by specifying the Helm address:Peer Registration
When a node connects to the mesh:- Generate Keys: Client generates WireGuard keypair
- Register: Client sends public key to Helm via gRPC
- Assign IP: Helm assigns a mesh IP from the pool
- Configure: Both sides configure WireGuard peers
- Connect: Tunnel is established
Peer Communication
Peer Server
Each mesh node runs a peer server for direct communication:Ping/Pong
Nodes can ping each other to verify connectivity:Service Access Over Mesh
Internal Services
These services are only accessible over the mesh network:| Service | Port | Description |
|---|---|---|
| PostgreSQL | 5432 | Database (Helm only) |
| NATS | 4222 | Message broker (Helm only) |
| Shell | 61022 | Remote command execution |
| Peer gRPC | 9443 | Mesh peer communication |
Firewall Rules
Helm automatically configures firewall rules to restrict internal services:Mesh Status
Get Mesh Status
- Server configuration
- Network CIDR
- Total and active peer count
- Individual peer status
List Peers
Configuration Persistence
Mesh configuration is saved locally for reconnection:Interface Naming
Hook useshookN interface names (hook0, hook1, etc.):
Next Steps
- Shell Service - Remote access over mesh
- Nameservers - DNS servers on mesh
- Overview - Back to architecture

