Bad peer port config

Open Beginner friendly
#416 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
docker
Domain
networking

Research direction

Open root/defaults/peer.conf at the linked line and inspect how the peer port is configured. Remove the shared peer-port setting, then verify that generated peer configurations no longer force every client to use the same port and preserve the server port configuration.

Written by the indexing model from the issue text.

Description

no-issue-activity

https://github.com/linuxserver/docker-wireguard/blob/843f39c97c859b01a3dac355053d713d983adfb3/root/defaults/peer.conf#L4

Hi, I just finally found the root cause of an ongoing but ephemeral issue and it turned out to be this same port being used by all peers. The port does need to be specified for the server config, but if all peers are set to have the same port then it can introduce issues with NAT. In my case, the server is running in a data center and when two peer/client devices are on the same remote network, they are constantly trying to clobber each other by trying to use the same port to handshake with the server (first established wins and the second exhibits weird behavior while it keeps attempting the handshake).

Since peer-to-peer is explicitly not supported per your README, the easy solution to this is just to remove this line and allow clients to choose their own random port.

Cheers

Dominant language
Dockerfile
Stars
3.6k
Forks
440
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from linuxserver/docker-wireguard

All issues in linuxserver/docker-wireguard

Similar issues

More Networking issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.