Skip to main content
Each Zode host that runs the environment’s sandboxes joins your NetBird network as a peer named zode-<environment>-<host>. It is the routing peer for that host’s slice of the environment’s range. Read How private networking works first.
NetBird routing peers only forward traffic from NetBird addresses, so your peers see a sandbox’s traffic coming from its router’s NetBird address, not from the sandbox’s private IP. Write your NetBird policies for the routers’ group. Traffic the other way, from your peers to a sandbox, keeps the addresses on both ends.

1. A group for Zode’s routers

Under Access Control > Groups, create a group such as zode-routers. The setup key below puts every router in it, so one policy covers every host.

2. Policies

Under Access Control > Policies, allow the routers to reach what sandboxes need, for example: The first lets sandboxes reach your database. The second lets your engineers reach sandboxes through the routes in step 4. NetBird drops anything no policy allows, so a missing policy is the usual reason a connection hangs.

3. A setup key

Under Setup Keys, create a key that is reusable, with auto-assigned group zode-routers. Making it ephemeral is optional: NetBird then removes a router’s peer after it has been offline for a while, which keeps your peer list tidy. If peer approval is on for your account, approve each zode-<environment>-<host> peer when it first appears, or a router stays offline.

4. An API token, so Zode adds the routes

Your peers reach a sandbox through a NetBird network route for its host’s slice, with that host’s router as the routing peer. Give Zode a token and it adds one route per host as routers come up, without masquerade and distributed to All, and removes them when you disconnect. Create a service user with the Network admin or Admin role under Team > Service Users, and a personal access token for it. Without a token, zode env network lists each host’s slice and router, and you add the routes by hand under Network Routes.

5. Connect

Leave out --api-token to add the routes yourself.

6. Check it

Each host’s router shows ONLINE, and ROUTES lists what your policies give it. Then try both directions:
For NetBird DNS names, add your DNS domain: zode env network staging --domains netbird.cloud. Reaching a sandbox also needs a security group with an inbound @mesh rule.

Disconnect

Every router logs out, its state is wiped, and the routes Zode made are removed. Delete the setup key, the service user’s token and the group when you no longer need them.