[Question] Clarification on using the 'RosenpassPort' parameter for static port configuration #2009

Closed
opened 2025-11-20 06:11:08 -05:00 by saavagebueno · 2 comments
Owner

Originally created by @galiev on GitHub (Jun 25, 2025).

Hello Netbird Team,

First of all, thank you for this fantastic project!

I am trying to configure the Netbird client (v0.49.0) to operate on a server behind a restrictive firewall with a default-drop policy. To make this work with Rosenpass enabled, I need to be able to set a static UDP port for the Rosenpass service so I can create a corresponding firewall rule.

While I couldn't find this option in the official documentation, my investigation of the source code led me to the RosenpassPort parameter. I've attempted to use it, but without success, and I would greatly appreciate some clarification.

My Setup
Netbird version: 0.49.0

Operating System: Linux

Firewall: nftables with a default policy drop on the input chain.

What I Tried
I enabled Rosenpass and configured my /etc/netbird/config.json to include the RosenpassPort parameter. Based on the binary's behavior, this appears to be the correct structure for v0.49.0:

{
  "ManagementURL": {
    "Scheme": "https",
    "Host": "netbird.example.com:443"
  },
  // ... other valid config fields
  "RosenpassEnabled": true,
  "RosenpassPort": 33455,
  "RosenpassPermissive": true
}

I added a firewall rule to allow incoming UDP traffic on the specified port: udp dport 33455 accept.

I restarted the Netbird service (sudo systemctl restart netbird).

Observed Outcome
Despite the configuration, the Netbird client appears to ignore the RosenpassPort value and binds to a random, dynamic port instead.

The client log confirms this:

INFO client/internal/rosenpass/manager.go:158: starting rosenpass server on port 54047

And ss shows the process listening on the random port:

# ss -lupn | grep netbird
udp  UNCONN  0  0  *:54047  *:* users:(("netbird",pid=1234,fd=22))

This prevents the firewall rule from working.

Questions:
My analysis of the source code at tag v0.49.0 shows the logic that seems intended for this purpose. The newRosenpass function in engine.go uses cfg.RosenpassPort, and the Start function in manager.go has a fallback to a dynamic port if ListenPort is 0.

Is the RosenpassPort parameter in config.json a supported feature in version 0.49.0, or is it an experimental/internal-only setting at this stage?

If it is supported, could there be a detail I'm missing in the configuration that would make it apply correctly?

Thank you for your time and any guidance you can provide!

Originally created by @galiev on GitHub (Jun 25, 2025). Hello Netbird Team, First of all, thank you for this fantastic project! I am trying to configure the Netbird client (v0.49.0) to operate on a server behind a restrictive firewall with a default-drop policy. To make this work with Rosenpass enabled, I need to be able to set a static UDP port for the Rosenpass service so I can create a corresponding firewall rule. While I couldn't find this option in the official documentation, my investigation of the source code led me to the RosenpassPort parameter. I've attempted to use it, but without success, and I would greatly appreciate some clarification. My Setup Netbird version: 0.49.0 Operating System: Linux Firewall: nftables with a default policy drop on the input chain. What I Tried I enabled Rosenpass and configured my /etc/netbird/config.json to include the RosenpassPort parameter. Based on the binary's behavior, this appears to be the correct structure for v0.49.0: ```json { "ManagementURL": { "Scheme": "https", "Host": "netbird.example.com:443" }, // ... other valid config fields "RosenpassEnabled": true, "RosenpassPort": 33455, "RosenpassPermissive": true } ``` I added a firewall rule to allow incoming UDP traffic on the specified port: udp dport 33455 accept. I restarted the Netbird service (sudo systemctl restart netbird). Observed Outcome Despite the configuration, the Netbird client appears to ignore the RosenpassPort value and binds to a random, dynamic port instead. The client log confirms this: ```bash INFO client/internal/rosenpass/manager.go:158: starting rosenpass server on port 54047 ``` And ss shows the process listening on the random port: ```bash # ss -lupn | grep netbird udp UNCONN 0 0 *:54047 *:* users:(("netbird",pid=1234,fd=22)) ``` This prevents the firewall rule from working. Questions: My analysis of the source code at tag v0.49.0 shows the logic that seems intended for this purpose. The newRosenpass function in engine.go uses cfg.RosenpassPort, and the Start function in manager.go has a fallback to a dynamic port if ListenPort is 0. Is the RosenpassPort parameter in config.json a supported feature in version 0.49.0, or is it an experimental/internal-only setting at this stage? If it is supported, could there be a detail I'm missing in the configuration that would make it apply correctly? Thank you for your time and any guidance you can provide!
Author
Owner

@nazarewk commented on GitHub (Jun 25, 2025):

I'm not seeing any RosenpassPort mention anywhere in the codebase, where did you find it?

@nazarewk commented on GitHub (Jun 25, 2025): I'm not seeing any `RosenpassPort` mention [anywhere in the codebase](https://github.com/search?q=org%253Anetbirdio+%22RosenpassPort%22), where did you find it?
Author
Owner

@galiev commented on GitHub (Jun 25, 2025):

Hello again,

Please feel free to close this issue. I have discovered the source of my confusion, and it was entirely my mistake.

You were correct to question where the RosenpassPort parameter was located. I realize now that I was mistakenly not looking at code from the main branch incorrectly assumed it was also in the main branch.

My apologies for the noise and any time wasted. Thank you for your help and for maintaining this great project.

@galiev commented on GitHub (Jun 25, 2025): Hello again, Please feel free to close this issue. I have discovered the source of my confusion, and it was entirely my mistake. You were correct to question where the RosenpassPort parameter was located. I realize now that I was mistakenly not looking at code from the main branch incorrectly assumed it was also in the main branch. My apologies for the noise and any time wasted. Thank you for your help and for maintaining this great project.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#2009