Egress routing
Egress routing lets mesh devices reach external services (databases, APIs, SaaS) through another device’s IP. The external service sees that device’s address — not yours.
This is different from direct mesh access (device.mesh:port), which reaches services on mesh devices. Egress routing reaches services outside the mesh through a mesh device.
When to use it
Section titled “When to use it”- IP allowlisting — MongoDB Atlas, AWS RDS, or Stripe only allows your server’s IP
- Regional access — A service is region-locked; route through a device in the right region
- VPC reachability — A database is only reachable from a specific network
Example: MongoDB Atlas
Section titled “Example: MongoDB Atlas”# On the VM with the allowlisted IP:jalth route add "*.mongodb.net" --name atlas
# Or from any device, specify the gateway:jalth route add "*.mongodb.net" --name atlas --via production-vmEvery enrolled device can now connect to Atlas using their normal connection string. Atlas sees the VM’s IP.
More examples
Section titled “More examples”jalth route add "*.rds.amazonaws.com" --name aws-db --via db-gatewayjalth route add "api.stripe.com" --name stripe --via us-east-vmjalth route lsjalth route remove atlasRequirements
Section titled “Requirements”The --via device must have a cloudflared tunnel (from jalth serve or jalth ssh enable). Route management requires operator or admin role.
How it works
Section titled “How it works”- Worker creates a tunnel hostname route on the gateway device
- Split tunnel is updated to include
100.80.0.0/16(egress routing range) - DNS queries for the hostname pattern resolve through the gateway’s tunnel
- Traffic exits from the gateway device’s network