[GH-ISSUE #4320] How to set Wireguard to a fixed Port via DOCKER ENV? #9103

Open
opened 2026-08-05 01:20:50 -04:00 by saavagebueno · 0 comments
Owner

Originally created by @robertpenz on GitHub (Aug 11, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/4320

Running Netbird via Docker on a Mikrotik Router I need to set the WireGuard Port to a fixed value so the p2p traffic from other clients go directly to the container without a relay - as the perimeter firewall blocks it otherwise .

Via CLI its netbird up --wireguard-port 51821 but for DOCKER I can't find a ENV variable, I tried NB_WIREGUARD_PORT but that does not work.

The biggest problem is that the ports are random and not as in iface.go DefaultWgPort = 51820.

Originally created by @robertpenz on GitHub (Aug 11, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/4320 Running Netbird via Docker on a Mikrotik Router I need to set the WireGuard Port to a fixed value so the p2p traffic from other clients go directly to the container without a relay - as the perimeter firewall blocks it otherwise . Via CLI its netbird up --wireguard-port 51821 but for DOCKER I can't find a ENV variable, I tried NB_WIREGUARD_PORT but that does not work. The biggest problem is that the ports are random and not as in iface.go DefaultWgPort = 51820.
saavagebueno added the triage-needed label 2026-08-05 01:20:50 -04:00
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#9103