
Exit Routing
Exit nodes advertise routes and open TCP connections to external destinations. Two types of routes are supported:
- CIDR routes: Match destinations by IP address (e.g.,
10.0.0.0/8) - Domain routes: Match destinations by domain name (e.g.,
*.example.com)
Configuration
exit:
enabled: true
routes:
- "10.0.0.0/8"
- "192.168.0.0/16"
- "0.0.0.0/0" # Default route
domain_routes:
- "api.internal.corp" # Exact domain match
- "*.example.com" # Wildcard match
dns:
servers:
- "8.8.8.8:53"
- "1.1.1.1:53"
timeout: 5s
Route Advertisement
Routes are propagated through the mesh:
- Periodic: Every
routing.advertise_interval(default 2m) - On-demand: Via HTTP API
POST /routes/advertise
Trigger Immediate Advertisement
curl -X POST http://localhost:8080/routes/advertise
DNS Resolution
DNS resolution location depends on the route type:
CIDR Routes (DNS at Ingress)
For destinations matching CIDR routes:
- Client connects via SOCKS5 with domain (e.g., example.com)
- Ingress agent resolves domain using the system's DNS resolver
- Ingress performs route lookup using the resolved IP address
- Ingress opens a stream to the exit node with the IP address
- Exit opens TCP connection to the destination IP
Domain Routes (DNS at Exit)
For destinations matching domain routes:
- Client connects via SOCKS5 with domain (e.g., api.internal.corp)
- Ingress checks domain routes first
- If a domain route matches, ingress opens a stream to the exit node with the domain name
- Exit agent resolves domain using the configured DNS servers
- Exit opens TCP connection to the resolved IP
When to Use Domain Routes
Domain routes are ideal for:
- Split-horizon DNS: Internal domains that resolve differently inside vs. outside the network
- Private services: Route
*.internal.corpto an internal exit with access to internal DNS - Geo-specific resolution: Different DNS results based on exit node location
Route Selection
Domain Routes
Domain routes are checked first for domain-based requests:
- Exact match:
api.example.commatches onlyapi.example.com - Wildcard match:
*.example.commatches single-level subdomains likefoo.example.com - If no domain route matches, fall back to CIDR routing
Wildcard matching is single-level only:
*.example.commatchesfoo.example.comandbar.example.com*.example.comdoes NOT matcha.b.example.comorexample.com
CIDR Routes
Uses longest-prefix match:
- Filter routes where CIDR contains destination IP
- Select route with longest prefix (most specific)
- If tied, select lowest metric (hop count)
Example:
1.2.3.4/32beats1.2.3.0/24for 1.2.3.41.2.3.0/24beats0.0.0.0/0for 1.2.3.5
Access Control
Only destinations matching advertised routes are allowed:
exit:
routes:
- "10.0.0.0/8" # Only allow 10.x.x.x
Connections to other IPs will be rejected.
Metrics
muti_metroo_exit_connections_active: Active exit connectionsmuti_metroo_exit_connections_total: Total exit connectionsmuti_metroo_exit_dns_queries_total: DNS queriesmuti_metroo_exit_dns_latency_seconds: DNS latencymuti_metroo_exit_errors_total: Exit errors
Related
- Configuration - Exit - Full configuration reference
- Concepts - Agent Roles - Understanding exit role
- Concepts - Routing - How routes propagate
- Security - Access Control - Route-based access control