-
-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Relay public thread - Q&A and Issues discussions #2566
Comments
Status information to confirm relay usage: Peers detail:
relay-test-ip-172-20-1-178-rly.netbird.selfhosted:
NetBird IP: 100.89.101.6
Public key: CdRpcUnzq2LM9v97VnU7JiiqE0Y4wXp379mXju0efjk=
Status: Connected
-- detail --
Connection type: Relayed
ICE candidate (Local/Remote): -/-
ICE candidate endpoints (Local/Remote): -/-
Relay server address: rels://relay-eu1.stage.netbird.io <--------------- indicates the relay used to connect to the remote peer
Last connection update: 2 seconds ago
Last WireGuard handshake: 3 seconds ago
Transfer status (received/sent) 92 B/180 B
Quantum resistance: false
Routes: -
Latency: 0s
relay-test-ip-172-20-14-148.netbird.selfhosted:
NetBird IP: 100.89.212.227
Public key: bhSrOMLvN+5cMnjWyL4gB+o9En2a1AvAGWNB5N+gEGw=
Status: Connected
-- detail --
Connection type: P2P
ICE candidate (Local/Remote): host/srflx
ICE candidate endpoints (Local/Remote): 192.168.178.38:51820/1.2.3.4:51820
Relay server address: rels://relay-eu2.stage.netbird.io. <--------------- indicates the relay used to connect to the remote peer ( there is a bug which this needs to be cleaned after P2P connection)
Last connection update: 2 seconds ago
Last WireGuard handshake: 3 seconds ago
Transfer status (received/sent) 92 B/180 B
Quantum resistance: false
Routes: 34.160.111.145/32
Latency: 28.5755ms
OS: darwin/arm64
Daemon version: 0.29.0
CLI version: 0.29.0
Management: Connected to [https://test.stage.netbird.io:443](https://test.stage.netbird.io/)
Signal: Connected to [https://signal.stage.netbird.io:443](https://signal.stage.netbird.io/)
Relays:
[stun:test.stage.netbird.io:3478] is Available
[turn:test.stage.netbird.io:3478?transport=udp] is Available
[rels://relay-eu1.stage.netbird.io] is Available. <--------------- indicates the relay used by your local client (the home relay)
Nameservers:
[8.8.8.8:53, 8.8.4.4:53] for [.] is Available
FQDN: maycons-macbook-pro-2-1.netbird.selfhosted
NetBird IP: 100.89.107.107/16
Interface type: Userspace
Quantum resistance: false
Routes: -
Peers count: 2/2 Connected |
Hi, I have some questions about the new relay which are not clear to me.
Thanks in advance and also many thanks for your awesome work in building this great software stack! |
@landmass-deftly-reptile-budget:
NB_EXPOSED_ADDRESS=rels://relay.example.com:443 # update the port configuration to match it
NB_LETSENCRYPT_DOMAINS=relay.example.com # should match the exposed address
NB_LETSENCRYPT_DATA_DIR=/etc/letsencrypt # mount this directory for persistency
[email protected]
#NB_LETSENCRYPT_AWS_ROUTE53=true # in case you want to use route 53 for issuing the certificate It also supports certificate files with: NB_TLS_CERT_FILE=/etc/certificates/cert.crt
NB_TLS_KEy_FILE=/etc/certificates/cert.key Once this is done, add the exposed address to the
|
Hello, I have 2 questions. I am undecided whether to upgrade or not.
|
Is it okay to update to 0.29.0 without actually running the new relay image and changing management.json? |
For new relay to work is there any new openwrt package released? |
Is it okay to use same domain for management, signal, coturn and relay? Example: If i use domain netbird.domain.com and i want to use this domain for all services but with different port is that okay? |
If I don't care about old clients, I can ignore TURN completely, right? Otherwise, this sounds very promising, especially with Kubernetes, the port ranges of TURN have always made the setup a bit more complex. I will definitely give it a try and report back. STUN will continue to be used in the future? |
I have used the automatic setup script, so I am probably using the default values for ports, so what do I need to specify here for PORT in the compose file? |
It can be found in the setup.env file. |
Hello, Is it possible to run the relay behind nginx acting as a proxy? I have tried by adding the following to my nginx configuration file, but it results in clients recieving a 400 error when trying to establish a connection to the relay. A direct connection without nginx in front works perfectly fine.
|
try add these:
and delete the directive:
|
@ismail0234 some of the benefits of the new relay over Coturn:
The main idea is to have a more efficient relay system for NetBird. Turn/Coturn is a really good system for short-term connections. As a connection via VPN usually lasts many hours or days, we need a more efficient system that can easily be scaled. |
Yes it is. You don't need to update or configure anything if you don't want. It should be fully compatible with older versions of the management.json file. |
We will look into updating the openwrt version. |
Yes it is possible. |
I added them but I am still getting the same error. I don't know if it is of any help but this is what I added to the docker-compose.yml file:
And this is what I added to management.json:
|
@MDMeridio001 it seems like you are using nginx for SSL termination too, in that case, try this: - NB_EXPOSED_ADDRESS=rels://netbird.mydomain.com:443 and "Relay": {
"Addresses": ["rels://netbird.mydomain.com:443"],
"CredentialsTTL": "24h",
"Secret": "<MYSECRET>"
}, |
I completely forgot I needed to add "rels://", thank you so much, it's working fine now. |
Assuming a brand new deployment and all clients running 0.29+ where does coturn fit in the picture ? Can we just run coturn with |
@rgdev With a new deployment, it is very likely that Coturn will only be used with mobile clients until we update them. |
Excuse my confusion, but since you say that you still use STUN for peer discovery, and at the same time Coturn won’t be used when the mobile apps are updated. Does that mean that the STUN service is baked into the new Relay now (or the management service) ? (Would we be ultimately able to remove Coturn from docker compose and the management.json ?) |
I am updating
But I'm not backporting to And to be honest someone open a issue openwrt/packages#24569 (comment) on |
@mlsmaycon Thanks for the explanation. Do you think about optimization on the api side? The api slows down after 200 peers connected to the system. After 500 peers, it slows down a lot. Each request takes more than 1-2 seconds. In the test measurements I made, these are the response times returned from the api according to the number of peers connected to the system. 20 Peers: 200-300 ms |
Hey folks, we have a new release, 0.29.1. This release improves the relay with better authentication messages. To ensure your system is working properly, you should upgrade your relay and management servers before upgrading your clients. |
Works like a charm, thanks! |
Thanks for improving the relay functionality. |
A short example for traefik which is working fine for me: docker-compose.yml
relay.env
management.json
|
Relay compose file
management.json
netbird.subdomain.conf
I use SWAG reverse proxy which just bundles nginx and lets encrypt, my config files are above. I'm trying to add the new relay service. When I fire up my docker client/agent I get this error in the logs for it: UPDATE: the current relay location I have now works. |
@ismail0234 Github, but feel free to reach out on Slack for a faster iteration. |
For People that are using Caddy (based on the zitadel starter script) Caddyfile:
relay.env
managment.json
docker-compose.yml
|
I followed the above settings for Caddy (as I've used the Zitadel starter script once upon a time), but when a node with the latest client tries to connect I get the following: 2024-09-12T19:35:10Z DEBG client/internal/connect.go:176: connecting to the Management service netbird.mydomain.se:443 Not really sure what I'm missing EDIT: Ah, I messed up and didn't pull / restart all the containers. :) |
To confirm: With the new relay, I still need to have the Coturn instance for STUN at this time? But I can deploy out multiple relay instances, update the config file accordingly, and it will use those? |
Could there be a guide to deploying them on Kubernetes? Thank you! |
To my understanding, it looks like it's just it's own container. So you'd just spin them up, map the port, and then update the management.json file and rebuild the containers |
Relay on k8s (behind a ingress-nginx reverse since it's websockets) : Ingress
Service
Deployment
The deployment references a |
Relay performance question... |
Hey @marcportabellaclotet-mt can you check with different MTU configurations for the NetBird interface on both ends of the connection? Also, can you share which tool you used for the test? |
I am using iperf and speedtest. |
@marcportabellaclotet-mt |
I am testing the relay service in the same network where netbird client is hostes, so there is no BW restriction.
|
@marcportabellaclotet-mt, the wireguard interface created by NetBird has an MTU of 1280, which can influence the performance and concurrent transfer of other peers' connections in the relay. A good starting test could be to update your peer's MTU size to 1420 for the wt0 or utun100(macOS) interfaces and test again. |
Thanks for answering @mlsmaycon . I will try some debug during the weekend. |
Thanks @pugnobellum adding the /relay onto the proxy pass location fixed my issue. |
It possible to use cloud hosted Netbird (free tier), but self hosted relay? |
hi maycom, i want to confirm if running a relay service alongside Coturn will cause connection issues on the user client or maybe connection between service? Currently, many of my users are still using versions below 29 |
Just if someone uses Caddy as reverse proxy, here is my config, that works fine with the relay container.
In the mangement.json I appended:
The part
is, of course, optional. I wanted to make the Management API and UI accessible for a known IP address only. |
thankyou @thorstenkramm
i can confirm this config is working if you using caddy, for me i prefer using relay instead of http://127.0.0.1 and change rel:// to rels:// in management.json Caddyfile
docker-compose.yaml
management.json
relay.env
|
I recommend continuing to use COTURN as the relay. COTURN can be further developed as needed to meet NETBIRD's requirements. The reasons are as follows: QoS Control Issues: Merging all requests into a single TCP connection can make Quality of Service (QoS) difficult to manage effectively. The complexity of relay networks is influenced by factors such as firewalls and QoS. Proprietary protocols may encounter unusual issues, such as being blocked, in complex network environments. While many relay solutions exist, currently only TURN can be effectively deployed in telecom-grade solutions. Similar to VXLAN and EVPN, which require collaboration among various vendors to implement based on a standard, TURN stands out as the viable option for reliable relay networks. Developing low-level communication protocols requires many years of accumulation. I believe that adding features at the application layer is much more cost-effective than investing in technologies that may fail during the R&D phase. |
What is the benefit of enabling TLS compared to leaving it off? So other than somebody hijacking your DNS to point to a malicious relay while at the same time having stolen the relay secret, why should I enable TLS? |
Same question here. A self-host-able DERP like relay server is very critical for low latency access. |
I wonder essentially the same, what a the recommendation to best secure the Relay service. Normally we put the management cluster behind a Reverse Proxy/API gateway + waf & API protection (with support for grpc). but this configuration will increase latency and create problems for Relay trafic. so what needs to be protected in the relay service, and what is the official recommendation for security layers to add in production ? |
Problem: Relayed connections not working ProblemI have two peers, both on Debian 12 Linux with Netbird version 0.30.1 Both peers show
But there is no working connection between the peers. No ping. No nothing. What makes me wonder is the connection status to the management host.
I have a couple of other peers. They are all connected via P2P and all works flawlessly. The management host is an MS Azure VM.
Relay appears to be the latest version, too. (No
Caddy reverse proxyIt all runs behind a caddy reverse proxy.
QuestionsHow to investigate further
Is the status of the management host Any help is much appreciated. |
Back to the stun topic, is it planned to remove the stun requirement in the future, to make the deployment simpler? Will relay service be able to manage the p2p discovery by itself? |
@wehagy can you please let me know where can i find Latest openwrt packages |
@rudradevpal you can find the most up-to-date |
I'm experiencing issues with proxying the relay service with caddy, but I am able to do so with nginx, and I was wondering if anyone had configuration advice. The relay service is using self signed certificates, so the Caddyfile looks like this:
And I'm getting this consistently in my logs -- both caddy and the relay service
|
Hello folks, this issue is open to any questions or problems regarding the new relay implementation.
The text was updated successfully, but these errors were encountered: