Routing traffic to private networks
NetBird provides fast and reliable end-to-end encryption between peers in your network. You can install the agent on every desktop, VM, container, or physical server and have a fast, secure peer-to-peer mesh network. That is the desired configuration, but some cases do not allow for agent installation or can slow down migration from legacy systems:
- Side-by-side migrations where part of your network is already using NetBird but needs to access services that are not.
- Systems that have limited operating system access. e.g., IoT devices, printers, and managed services.
- Legacy networks where an administrator is unable to install the agent on all nodes.
In these cases, you can configure network routes assigning routing peers to connect existing infrastructure. Routing peers will forward packets between your NetBird peers and your other networks; they can masquerade traffic going to your data centers or embedded devices, reducing the need for external route configuration and agent installation.
If you want to see the Network Routes feature in action, try our managed version at https://app.netbird.io/routes.
It's free and simple! :)
A network route describes the network you want to connect with your NetBird peers. It has an identifier, a network range, a routing peer, and some parameters available for managing priority and masquerading.
Network routes is available for NetBird v0.9.0 or later.
Network identifiers and ranges
Network identifiers are names for each network you want to route traffic from your peers, and ranges are IP ranges declared in CIDR notation which refers to an external network. The combination of identifiers and these ranges makes a single network.
A routing peer is a node that will route packets between your routed network and the other NetBird peers.
Only Linux OS nodes can be assigned as routing peers.
High availability routes
A highly available route is a combination of multiple routes with the same network identifier and ranges. They have different routing peers offering high-available paths for communication between your peers and external networks. Nodes connected to routing peers will choose one of them to route packets to external networks based on connection type and defined metrics.
Masquerade hides other NetBird network IPs behind the routing peer local address when accessing the target Network range. This option allows access to your private networks without configuring routes on your local routers or other devices.
If you don't enable this option, you must configure a route to your NetBird network in your external network infrastructure.
Metric and priority
Metric defines prioritization when choosing the main routing peer in a high availability network. Lower metrics have higher priority.
Distribution groups define that peers that belong to groups set in this field will receive the network route.
It doesn't remove the need for the routing peer to be connected to these peers
Managing network routes
A network route describes a network you want to connect with your NetBird peers. It has an identifier, a network range, a routing peer, and some parameters available for managing priority and masquerading.
Creating a network route
Network Routes tab and click the
Add Route button to create a new route.
That will open a route configuration screen where you can add the information about the network you want to route:
Now you can enter the details of your route. In the example below, we are creating a route with the following information:
- Network identifier:
Production VPC in Frankfurt
- Network range:
- Routing peer:
- Distribution Groups:
Once you fill in the route information, you can click on the
Save button to save your new route.
Done! Now every peer connected to your routing peer will be able to send traffic to your external network.
Creating highly available routes
To avoid a single point of failure when managing your network, we recommend installing NetBird on every resource. However, you still want to ensure a reliable connection to your private network when running NetBird on every machine is not feasible. NetBird Network Routes feature has a High Availability (HA) mode, allowing one or more NetBird peers to serve as routing peers for the same private network.
To enable high-available mode, you can click on
Configure and select a new peer in the
Add additional routing peer field, then select the distribution groups and click on
In the following screenshot, we are adding the peer
aws-nb-europe-router-az-b to the
This way, nodes connected to both peer
aws-nb-europe-router-az-a and peer
aws-nb-europe-router-az-b would have a highly available connection with the network
Currently, there is no limitation in the number of routes that form a highly available route. Each connected peer will pick one routing peer to use as the router for a network; this decision is based on metric prioritization and connection attributes like direct or relayed connections.
Filtering routes distribution with groups
You can select as many distribution groups as you want for your network route. You can update them at the routing peer or high-availability group level. Keep in mind to link them to peers and, if required, to add access control rules ensuring connectivity between these peers and the routing peers of your route
Routes without masquerading
If you want more transparency and would like to manage your external network routers, you may choose to disable masquerade for your network routes. In this case, the routing peer won't hide any NetBird peer IP and will forward the packets to the target network transparently.
That will require a routing configuration on your external network router pointing your NetBird network back to your routing peer. This way, devices that don't have the agent installed can communicate with your NetBird peers.