Skip to main content
Private networking joins one environment to your own mesh. Its sandboxes can then reach what your mesh reaches (a database behind a subnet router, an internal API, a staging box), and your machines can reach the sandboxes by a private IP. Your mesh’s own access rules decide who reaches what, as they do for any other device. Pick your mesh for the setup steps:

Tailscale

An OAuth client or a tagged auth key, and two lines in your tailnet policy.

Headscale

The same, against your own Headscale server.

NetBird

A setup key, and an API token so Zode adds the routes itself.

What runs where

  • A router per host. Each Zode host that runs sandboxes of the environment runs one mesh client for it, in its own network namespace on the host. It joins your mesh as a device named zode-<environment>-<host>.
  • Your credential stays on the router. The auth key, OAuth client or setup key is written once, sealed, and never returned by the API. It never enters a sandbox, so nothing running in one can read it or join your mesh with it.
  • Sandboxes don’t run a mesh client. A sandbox sends mesh traffic to its host’s router. Nothing is installed in the image, and forks and snapshots keep working as before.

Addresses

  • The environment has a private range, an IPv4 /16 you choose (default 10.77.0.0/16). Zode refuses a range that overlaps its own or your mesh’s (including 100.64.0.0/10, which Tailscale and NetBird use).
  • Each host gets a /24 slice of that range the first time the environment runs there, so one host holds up to 254 of the environment’s sandboxes.
  • Each sandbox gets a private IP from its host’s slice. It is kept across stop and start; a fork or a restored snapshot gets its own.
  • Inside the VM, a sandbox still sees itself as 172.16.0.2. Zode translates on the host, which is what keeps forks cheap. A program that needs its mesh address reads ZODE_PRIVATE_IP, set in every zode exec and session:
The console’s sandbox Network tab and GET /v1/sandboxes/{id}/security-groups (private_ip) show it too.

Traffic each way

Sandbox to your mesh. A sandbox reaches the routes your mesh hands its router: other devices, and subnets behind your subnet routers. Which address your mesh sees depends on the mesh: NetBird routing peers only forward traffic from NetBird addresses, so a NetBird router sends its sandboxes’ traffic as its own peer address. Tailscale subnet routes carry the sandbox’s real address, so your ACLs can tell sandboxes apart. Your mesh to a sandbox. Each router announces its host’s slice as a route, so your machines reach a sandbox at its private IP. The route has to be approved on your side: by autoApprovers on Tailscale and Headscale, or as a NetBird network route, which Zode creates when you give it an API token. Each mesh’s page shows how. A sandbox also needs a security group that lets the traffic in. The environment’s default group allows outbound to the mesh but inbound only from other sandboxes in default, so add an inbound rule for your mesh:
icmp@mesh lets ping through; leave it out if you only need the ports.

DNS

Names under the domains you list resolve through your mesh; everything else resolves as before. List your MagicDNS suffix, your NetBird DNS domain, or internal zones such as internal.acme.com:
Host rules in a security group use the same resolver, so tcp:5432@host:db.internal.acme.com works for a name your mesh resolves.

Connect, check, disconnect

zode env network shows each host’s router with ONLINE, ROUTES (what your mesh gives it) and ERROR in your mesh’s own words. The console’s environment Networking tab shows the same, plus the policy lines to paste. Disconnecting logs every router out of your mesh, removes the routes Zode made, and wipes the routers’ state. Sandboxes keep their internet access throughout; only the mesh goes. Owners and admins connect and disconnect. The API is GET and PUT /v1/environments/{id}/network (cidr, domains) and PUT and DELETE /v1/environments/{id}/mesh.

If it doesn’t connect

Limits

  • IPv4 only.
  • 254 sandboxes of one environment per host. The next goes to another host.
  • One mesh per environment. Use two environments to join two meshes.