Skip to content

Commit 840498a

Browse files
committed
Add NetBird package
1 parent 167a4bd commit 840498a

File tree

18 files changed

+1159
-1
lines changed

18 files changed

+1159
-1
lines changed

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,35 @@
1-
# pfsense-netbird
1+
# NetBird Package for pfSense
2+
3+
![My Logo](assets/netbird.png)
4+
5+
## Build Instructions
6+
7+
Use **FreeBSD 15.0-CURRENT** as your base system for building the package.
8+
9+
### Steps:
10+
11+
```
12+
git clone [email protected]:netbirdio/pfsense-netbird.git
13+
cd pfSense-pkg-NetBird/
14+
make
15+
make package
16+
```
17+
18+
The `make package` command will generate a file like:
19+
20+
```
21+
/work/pkg/pfSense-pkg-NetBird-<version>.pkg
22+
```
23+
24+
You can then transfer this file to your pfSense system and install it manually.
25+
26+
## Installation on pfSense
27+
28+
To install the package manually on pfSense:
29+
30+
```
31+
pkg remove pfSense-pkg-NetBird-<version>
32+
pkg add pfSense-pkg-NetBird-<version>.pkg
33+
```
34+
35+
Once installed, **NetBird** will appear under the **VPN** menu in the pfSense Web UI.

assets/netbird.png

194 KB
Loading

netbird/Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
PORTNAME= netbird
2+
DISTVERSIONPREFIX= v
3+
DISTVERSION= 0.47.0
4+
CATEGORIES= security net net-vpn
5+
6+
MAINTAINER= [email protected]
7+
COMMENT= Peer-to-peer VPN that seamlessly connects your devices
8+
WWW= https://netbird.io/
9+
10+
LICENSE= BSD3CLAUSE
11+
LICENSE_FILE= ${WRKSRC}/LICENSE
12+
13+
NOT_FOR_ARCHS= i386
14+
NOT_FOR_ARCHS_REASON= "no 32-bit builds supported"
15+
16+
RUN_DEPENDS= ca_root_nss>0:security/ca_root_nss
17+
18+
USES= go:1.23,modules
19+
USE_RC_SUBR= netbird
20+
21+
GO_MODULE= github.com/netbirdio/netbird
22+
GO_TARGET= ./client:netbird
23+
GO_BUILDFLAGS= -tags freebsd -o ${PORTNAME} -ldflags "\
24+
-s -w -X github.com/netbirdio/netbird/version.version=${PORTVERSION}"
25+
26+
WRKSRC= ${WRKDIR}/netbird-${PORTVERSION}
27+
28+
PLIST_FILES= bin/netbird
29+
30+
.include <bsd.port.mk>

netbird/files/netbird.in

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
#
3+
# PROVIDE: netbird
4+
# REQUIRE: SERVERS
5+
# KEYWORD: shutdown
6+
#
7+
8+
. /etc/rc.subr
9+
10+
name="netbird"
11+
netbird_env="IS_DAEMON=1"
12+
pidfile="/var/run/${name}.pid"
13+
command="/usr/sbin/daemon"
14+
daemon_args="-P ${pidfile} -r -t \"${name}: daemon\""
15+
command_args="${daemon_args} /usr/local/bin/netbird service run --config /var/db/netbird/config.json --log-level info --daemon-addr unix:///var/run/netbird.sock --log-file /var/log/netbird/client.log"
16+
17+
run_rc_command "$1"
18+

netbird/pkg-descr

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
NetBird is an open-source WireGuard-based overlay network combined with
2+
Zero Trust Network Access, providing secure and reliable connectivity
3+
to internal resources.
4+
5+
Key features:
6+
- Zero-config VPN: Easily create secure connections between devices without
7+
manual network setup.
8+
- Built on WireGuard: Leverages WireGuard's high-performance encryption for
9+
fast and secure communication.
10+
- Self-hosted or Cloud-managed: Users can deploy their own NetBird management
11+
server or use NetBird Cloud for centralized control.
12+
- Access Control & Routing: Fine-grained access control policies and automatic
13+
network routing simplify connectivity.
14+
- This FreeBSD port provides the NetBird client daemon and CLI tools, allowing
15+
FreeBSD systems to join a NetBird mesh network and securely communicate with
16+
other peers.
17+
18+
For more details, visit: https://netbird.io

netbird/pkg-message

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{ type: install
3+
message: <<EOM
4+
At this time this code is new, unvetted, possibly buggy, and should be
5+
considered "experimental". It might contain security issues. We gladly
6+
welcome your testing and bug reports, but do keep in mind that this code
7+
is new, so some caution should be exercised at the moment for using it
8+
in mission critical environments.
9+
EOM
10+
}
11+
]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
/usr/local/bin/php -f /etc/rc.packages %%PORTNAME%% ${2}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
if [ "${2}" != "POST-INSTALL" ]; then
4+
exit 0
5+
fi
6+
7+
${PKG_ROOTDIR}/usr/local/bin/php -f ${PKG_ROOTDIR}/etc/rc.packages %%PORTNAME%% ${2}
Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
3+
<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
4+
<packagegui>
5+
<copyright>
6+
<![CDATA[
7+
/*
8+
* netbird.xml
9+
*
10+
* part of pfSense (https://www.pfsense.org)
11+
* Copyright (c) 2022-2025 Rubicon Communications, LLC (Netgate)
12+
* All rights reserved.
13+
*
14+
* Licensed under the Apache License, Version 2.0 (the "License");
15+
* you may not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing, software
21+
* distributed under the License is distributed on an "AS IS" BASIS,
22+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23+
* See the License for the specific language governing permissions and
24+
* limitations under the License.
25+
*/
26+
]]>
27+
</copyright>
28+
<name>netbird</name>
29+
<version>%%PKGVERSION%%</version>
30+
<title>VPN/NetBird</title>
31+
<include_file>/usr/local/pkg/netbird/netbird.inc</include_file>
32+
<aftersaveredirect>/pkg_edit.php?xml=netbird.xml</aftersaveredirect>
33+
<menu>
34+
<name>NetBird</name>
35+
<section>VPN</section>
36+
<configfile>netbird.xml</configfile>
37+
<url>/pkg_edit.php?xml=netbird/netbird_auth.xml</url>
38+
</menu>
39+
<menu>
40+
<name>NetBird</name>
41+
<section>Status</section>
42+
<configfile>netbird.xml</configfile>
43+
<url>/netbird_status.php</url>
44+
</menu>
45+
<tabs>
46+
<tab>
47+
<text>Authentication</text>
48+
<url>pkg_edit.php?xml=netbird/netbird_auth.xml</url>
49+
</tab>
50+
<tab>
51+
<text>Settings</text>
52+
<url>pkg_edit.php?xml=netbird.xml</url>
53+
<active/>
54+
</tab>
55+
<tab>
56+
<text>Status</text>
57+
<url>netbird_status.php</url>
58+
</tab>
59+
</tabs>
60+
<fields>
61+
<field>
62+
<name>General</name>
63+
<type>listtopic</type>
64+
</field>
65+
<field>
66+
<fielddescr>WireGuard Port</fielddescr>
67+
<fieldname>wireguardport</fieldname>
68+
<description>
69+
<![CDATA[
70+
Wireguard interface listening port
71+
]]>
72+
</description>
73+
<type>input</type>
74+
<default_value>51820</default_value>
75+
<required/>
76+
</field>
77+
78+
<field>
79+
<name>Firewall</name>
80+
<type>listtopic</type>
81+
</field>
82+
<field>
83+
<fielddescr>Allow Configuration</fielddescr>
84+
<fieldname>allowfirewallconfig</fieldname>
85+
<description>
86+
<![CDATA[
87+
Allow the client to manage and enforce firewall rules
88+
]]>
89+
</description>
90+
<sethelp>
91+
<![CDATA[
92+
If disabled the client won't modify firewall rules
93+
]]>
94+
</sethelp>
95+
<type>checkbox</type>
96+
<default_value>on</default_value>
97+
</field>
98+
<field>
99+
<fielddescr>Block Inbound Connection</fielddescr>
100+
<fieldname>blockinboundconn</fieldname>
101+
<description>
102+
<![CDATA[
103+
Block all inbound connections to the local machine and any routed networks
104+
]]>
105+
</description>
106+
<sethelp>
107+
<![CDATA[
108+
This overrides any policies received from the management service
109+
]]>
110+
</sethelp>
111+
<type>checkbox</type>
112+
</field>
113+
114+
<field>
115+
<name>SSH</name>
116+
<type>listtopic</type>
117+
</field>
118+
<field>
119+
<fielddescr>Enable</fielddescr>
120+
<fieldname>enablessh</fieldname>
121+
<description>
122+
<![CDATA[
123+
Allows incoming SSH connections
124+
]]>
125+
</description>
126+
<type>checkbox</type>
127+
</field>
128+
129+
<field>
130+
<name>DNS</name>
131+
<type>listtopic</type>
132+
</field>
133+
<field>
134+
<fielddescr>Enable</fielddescr>
135+
<fieldname>enabledns</fieldname>
136+
<description>
137+
<![CDATA[
138+
Allows the client to configure DNS settings
139+
]]>
140+
</description>
141+
<type>checkbox</type>
142+
<default_value>on</default_value>
143+
</field>
144+
145+
<field>
146+
<name>Routing</name>
147+
<type>listtopic</type>
148+
</field>
149+
<field>
150+
<fielddescr>Access LAN</fielddescr>
151+
<fieldname>accesslan</fieldname>
152+
<description>
153+
<![CDATA[
154+
Allow access to local networks (LAN) when using this peer as a router or exit node
155+
]]>
156+
</description>
157+
<type>checkbox</type>
158+
<default_value>on</default_value>
159+
</field>
160+
<field>
161+
<fielddescr>Accept Client Routes</fielddescr>
162+
<fieldname>allowclientroutes</fieldname>
163+
<description>
164+
<![CDATA[
165+
Accept and process client routes received from the management
166+
]]>
167+
</description>
168+
<type>checkbox</type>
169+
<default_value>on</default_value>
170+
</field>
171+
<field>
172+
<fielddescr>Allow Server Routes</fielddescr>
173+
<fieldname>allowserverroutes</fieldname>
174+
<description>
175+
<![CDATA[
176+
Enable this peer to act as a router for server routes received from the management
177+
]]>
178+
</description>
179+
<type>checkbox</type>
180+
<default_value>on</default_value>
181+
</field>
182+
183+
<field>
184+
<name>Post-Quantum</name>
185+
<type>listtopic</type>
186+
</field>
187+
<field>
188+
<fielddescr>Enable Rosenpass</fielddescr>
189+
<fieldname>enablerosenpass</fieldname>
190+
<description>
191+
<![CDATA[
192+
Enable the Rosenpass to provide post-quantum secure connections
193+
]]>
194+
</description>
195+
<sethelp>
196+
<![CDATA[
197+
Experimental
198+
]]>
199+
</sethelp>
200+
<type>checkbox</type>
201+
</field>
202+
<field>
203+
<fielddescr>Rosenpass Permissive Mode</fielddescr>
204+
<fieldname>rosenpasspermissive</fieldname>
205+
<description>
206+
<![CDATA[
207+
Enable this peer to accept WireGuard connections from peers that do not have Rosenpass enabled
208+
]]>
209+
</description>
210+
<sethelp>
211+
<![CDATA[
212+
Experimental
213+
]]>
214+
</sethelp>
215+
<type>checkbox</type>
216+
</field>
217+
218+
<field>
219+
<name>Logging</name>
220+
<type>listtopic</type>
221+
</field>
222+
<field>
223+
<fielddescr>Syslog Logging</fielddescr>
224+
<fieldname>syslogenable</fieldname>
225+
<description>
226+
<![CDATA[
227+
Enable syslog output
228+
]]>
229+
</description>
230+
<type>checkbox</type>
231+
<default_value>on</default_value>
232+
</field>
233+
<field>
234+
<fielddescr>Syslog Settings</fielddescr>
235+
<fieldname>loglevel</fieldname>
236+
<description>Set the syslog logging level</description>
237+
<type>select</type>
238+
<default_value>info</default_value>
239+
<options>
240+
<option><name>INFO</name><value>info</value></option>
241+
<option><name>DEBUG</name><value>debug</value></option>
242+
</options>
243+
<required/>
244+
</field>
245+
246+
</fields>
247+
<note>
248+
<![CDATA[
249+
Changes to these settings may temporarily disrupt connections and access to NetBird.
250+
]]>
251+
</note>
252+
253+
<custom_php_after_head_command>
254+
<![CDATA[netbird_display_connection_info();]]>
255+
</custom_php_after_head_command>
256+
<custom_php_validation_command>
257+
<![CDATA[netbird_validate_input($_POST, $input_errors);]]>
258+
</custom_php_validation_command>
259+
<custom_php_resync_config_command>
260+
<![CDATA[netbird_resync_config();]]>
261+
</custom_php_resync_config_command>
262+
</packagegui>

0 commit comments

Comments
 (0)