Skip to main content
The Routes API allows you to configure network routes, enabling peers to access external networks, subnets, or act as exit nodes for internet traffic.

List All Routes

Returns a list of all configured routes.
string
Unique route identifier
string
Route network identifier for grouping HA routes
string
Network type: IPv4, IPv6, or domain
string
Route description
boolean
Whether the route is active
string
Peer ID acting as the routing peer
array
Peer group IDs for HA routing (alternative to peer)
string
Network range in CIDR format (conflicts with domains)
array
Domain list to dynamically resolve (max 32, conflicts with network)
integer
Route priority (lower number = higher priority, range: 1-9999)
boolean
Whether to masquerade (NAT) traffic to this route
array
Group IDs that can use this route
boolean
Keep route after domain resolution fails
array
Group IDs with access control permissions

Get a Route

Retrieve detailed information about a specific route.
string
required
The unique identifier of the route
Example

Create a Route

Create a new network route.
string
required
Route description
string
required
Network identifier for grouping HA routes (1-40 characters)
boolean
required
Whether the route is active
string
Peer ID to use as routing peer (cannot be used with peer_groups)
array
Peer group IDs for HA routing (cannot be used with peer)
string
Network range in CIDR format (cannot be used with domains)
array
List of domains to resolve (max 32, cannot be used with network)
integer
required
Route priority (1-9999, lower = higher priority)
boolean
required
Enable NAT for traffic to this route
array
required
Group IDs that can use this route
boolean
required
Keep route after domain resolution fails
array
Group IDs with access control permissions
boolean
Skip auto-application for exit node routes (0.0.0.0/0)

Update a Route

Update an existing route configuration.
string
required
The unique identifier of the route
Example

Delete a Route

Remove a route from the network.
string
required
The unique identifier of the route
Example

Route Types

Subnet Routes

Route traffic to specific IP subnets:
Use cases:
  • Access cloud VPCs
  • Connect to office LANs
  • Reach private data centers

Domain Routes

Dynamically route traffic to resolved domains:
Use cases:
  • Route to dynamic cloud services
  • Access internal services by domain
  • Support wildcard domain routing
Domain routes are resolved periodically. Set keep_route: true to maintain connectivity even if resolution temporarily fails.

Exit Nodes

Route all internet traffic through a peer:
Use cases:
  • Secure public WiFi connections
  • Access region-specific content
  • Centralize internet egress

High Availability Routing

Use multiple routing peers for redundancy:
Peers in the group automatically provide failover.

Route Priority

Control route selection with metrics:

High Priority

metric: 1-100Preferred routes

Medium Priority

metric: 101-1000Normal routes

Low Priority

metric: 1001-9999Backup/exit nodes

Masquerading (NAT)

Enable masquerading to NAT traffic:
Required when:
  • Routing peer doesn’t have routes back to NetBird network
  • Acting as an exit node
  • Accessing external networks that don’t know about NetBird IPs

Access Control

Limit which groups can use the route:
  • groups: Who can use the route
  • access_control_groups: Who can manage the route

Best Practices

Use specific metrics - Assign appropriate priorities based on route importance
Enable masquerading - Always enable for exit nodes and external networks
Group related routes - Use network_id to organize related routes
Use HA groups - Deploy multiple routing peers for critical routes
Monitor domain resolution - Check domain routes resolve correctly
Limit access - Only give route access to groups that need it