|
| 1 | +==================================== |
| 2 | +Netbird Plugin Setup Guide |
| 3 | +==================================== |
| 4 | + |
| 5 | +Introduction |
| 6 | +============ |
| 7 | + |
| 8 | +This guide explains how to install and configure the **Netbird** plugin on OPNsense. |
| 9 | +Netbird is a peer-to-peer VPN that simplifies secure networking between devices. |
| 10 | +The plugin allows OPNsense to join a Netbird network, providing routing, DNS resolution, |
| 11 | +and firewalling capabilities. |
| 12 | + |
| 13 | +Limitations |
| 14 | +=========== |
| 15 | + |
| 16 | +- **Netbird Policies Do Not Create Firewall Rules on OPNsense** |
| 17 | + - The policies set in the Netbird management console **do not** automatically create firewall rules on OPNsense. |
| 18 | + - You need to manually configure the required firewall rules on the assigned ``wt0`` interface in OPNsense to allow or restrict traffic as needed. |
| 19 | + |
| 20 | +Installation |
| 21 | +============ |
| 22 | + |
| 23 | +The Netbird plugin can be installed directly from the official OPNsense repository. |
| 24 | + |
| 25 | +Installing via Web UI |
| 26 | +--------------------- |
| 27 | + |
| 28 | +1. Navigate to **System** → **Firmware** → **Plugins**. |
| 29 | +2. Locate ``os-netbird`` in the list. |
| 30 | +3. Click the **+** button to install the plugin. |
| 31 | + |
| 32 | +Configuration |
| 33 | +============= |
| 34 | + |
| 35 | +After installation, navigate to **VPN** → **Netbird** to configure the plugin. |
| 36 | + |
| 37 | +Required Settings |
| 38 | +----------------- |
| 39 | + |
| 40 | +- **Management Server URL** |
| 41 | + - The URL of the Netbird management server (self-hosted or Netbird Cloud). |
| 42 | + - Example: ``https://netbird.example.com``. |
| 43 | + |
| 44 | +- **Setup Key** |
| 45 | + - Generated in the Netbird management server. |
| 46 | + - Used to register OPNsense as a Netbird peer. |
| 47 | + |
| 48 | +- **Optional Hostname** |
| 49 | + - Defines how OPNsense appears in the Netbird management console. |
| 50 | + - Example: ``opnsense-router``. |
| 51 | + |
| 52 | +General Settings |
| 53 | +---------------- |
| 54 | + |
| 55 | +- **Port (Default: 51820)** |
| 56 | + - The default WireGuard port. |
| 57 | + - Change this if another WireGuard server is already using the port. |
| 58 | + - Ensure this port is open on the **WAN interface** (Firewall rules required), otherwise only a relayed connection will be possible. |
| 59 | + |
| 60 | +- **Disable Server Routes** |
| 61 | + - When enabled, OPNsense **will not act as a routing peer**, preventing other Netbird peers from accessing networks behind OPNsense. |
| 62 | + |
| 63 | +- **Disable Client Routes** |
| 64 | + - When enabled, OPNsense **will not use Netbird routes** to reach remote networks. |
| 65 | + |
| 66 | +- **Disable Netbird DNS Lookups** |
| 67 | + - When enabled, OPNsense **will not resolve Netbird hostnames** (e.g., ``demo.netbird.selfhosted``) to IP addresses. |
| 68 | + |
| 69 | +- **Enable Rosenpass** |
| 70 | + - Enables **post-quantum encryption** using Rosenpass on top of WireGuard for enhanced security. |
| 71 | + - When enabled, this OPNsense peer will attempt to use Rosenpass for encrypted connections. |
| 72 | + |
| 73 | +- **Rosenpass Permissive Mode** |
| 74 | + - When enabled, this peer will **prefer** Rosenpass for connections to other Rosenpass-enabled peers but will also allow connections to peers **without** Rosenpass. |
| 75 | + - When disabled, this peer will **only** connect to other peers that support Rosenpass, rejecting connections from non-Rosenpass peers. |
| 76 | + |
| 77 | +- **CARP Interface** |
| 78 | + - Defines how Netbird behaves in a high-availability (HA) setup using CARP. |
| 79 | + - **None**: If set to "None", Netbird will execute ``netbird up`` automatically and enable auto-connect. |
| 80 | + - **Specific Interface**: If an interface is selected, auto-connect is **disabled**, and Netbird must be manually started on the **MASTER** node by triggering a CARP event or executing ``netbird up`` manually. |
| 81 | + |
| 82 | +- **CARP VHID** |
| 83 | + - Sets the **Virtual Host ID (VHID)** for CARP when using Netbird in a high-availability (HA) setup. |
| 84 | + - This ID helps distinguish multiple CARP instances on the same network. |
| 85 | + - It should match the **VHID** used in the OPNsense HA configuration for proper failover behavior. |
| 86 | + |
| 87 | +After configuring the required settings, click **Save** and restart the Netbird service. |
| 88 | + |
| 89 | +Assigning the Interface |
| 90 | +======================= |
| 91 | + |
| 92 | +To enable firewalling, NAT, or routing, you need to assign the **wt0** interface. |
| 93 | + |
| 94 | +1. Go to **Interfaces** → **Assignments**. |
| 95 | +2. Locate the unassigned ``wt0`` interface. |
| 96 | +3. Enter a name in the description field (e.g., **Netbird**). |
| 97 | +4. Click **Add** to assign it. |
| 98 | +5. Click on the **Netbird** interface to configure it. |
| 99 | +6. Check "Enable Interface" |
| 100 | +7. optionally but recommended: Check "Prevent interface removal" |
| 101 | +8. don't set any IP address or gateway |
| 102 | +9. Click **Save** |
| 103 | +10. Click on **Apply changes** |
| 104 | + |
| 105 | +Why Assign ``wt0``? |
| 106 | +------------------- |
| 107 | + |
| 108 | +- Allows **incoming traffic from Netbird peers** (e.g., access to the OPNsense Web UI). |
| 109 | +- Required for **firewalling, NAT, or advanced routing**. |
| 110 | + |
| 111 | +Network Address Translation (NAT) |
| 112 | +================================= |
| 113 | + |
| 114 | +If you want OPNsense to act as an **exit node** for Netbird peers: |
| 115 | + |
| 116 | +1. Go to **Firewall** → **NAT** → **Outbound**. |
| 117 | +2. Set the mode to **Hybrid NAT**. |
| 118 | +3. Add a rule to **translate traffic from Netbird (``wt0``) to the WAN interface**. |
| 119 | +4. Save and apply changes. |
| 120 | + |
| 121 | +Firewall Rules |
| 122 | +============== |
| 123 | + |
| 124 | +Firewall rules depend on your use case. |
| 125 | +However, some considerations: |
| 126 | + |
| 127 | +- If **Rosenpass** is enabled, you may need to allow **incoming UDP traffic** on high ports (30,000–65,535). |
| 128 | +- Define rules on the ``wt0`` interface to control peer access. |
| 129 | + |
| 130 | +Accessing Logs |
| 131 | +============== |
| 132 | + |
| 133 | +Netbird logs can be accessed via the Web UI: |
| 134 | + |
| 135 | +1. Navigate to **VPN** → **Netbird** → **Log File**. |
| 136 | +2. Use logs to troubleshoot connection or routing issues. |
| 137 | + |
| 138 | +Conclusion |
| 139 | +========== |
| 140 | + |
| 141 | +The Netbird plugin for OPNsense provides a powerful way to integrate Netbird’s VPN capabilities. |
| 142 | +By assigning ``wt0``, setting up NAT, and configuring firewall rules, OPNsense can serve as a routing peer |
| 143 | +or an exit node for Netbird networks. |
0 commit comments