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 aszode-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 groupzode-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 toAll, 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
- NetBird cloud
- Self-hosted
--api-token to add the routes yourself.
6. Check it
ONLINE, and ROUTES lists what your policies give it. Then try both directions:
zode env network staging --domains netbird.cloud. Reaching a sandbox also needs a security group with an inbound @mesh rule.