Closed mrtnd closed 2 years ago
Just tested on a raspberry pi 4 running ubuntu server. Using docker-compose this time and the result is the same. The default port is used instead.
docker-compose:
SERVERPORT=51820 ports:
- 56820:51820/udp
logs:
External server port is set to 51820. Make sure that port is properly forwarded to port 51820 inside this container
peer config:
Endpoint = IP/DOMAIN:51820
docker ps:
0.0.0.0:56820->51820/udp, :::56820->51820/udp
The processes inside the container have no way of knowing what host port you're mapping. That's why we have an env var named SERVERPORT
. You need to set that to whatever external port you're exposing publicly so the client confs use that.
The processes inside the container have no way of knowing what host port you're mapping. That's why we have an env var named
SERVERPORT
. You need to set that to whatever external port you're exposing publicly so the client confs use that.
ohh i got it all wrong... my bad. I thought that the SERVERPORT
is the port that the server is listening on inside the container.
External Port is not set in the client config and the log shows the default port as well.
Expected Behavior
When changing the External port to some other number, That port should be set properly in the client config. I'm talking about the port that you map into the container
Current Behavior
Port not set. Default Port is used instead, therefore tunnel is not working. Manual change in the config fixes the problem.
Steps to Reproduce
Environment
OS: Windows CPU architecture: x86_64 How docker service was installed:
official docker desktop for windows. using wsl2
Command used to create docker container (run/create/compose/screenshot)
docker run -d --name=wireguard --cap-add=NET_ADMIN --cap-add=SYS_MODULE -e PUID=1000 -e PGID=1000 -e TZ=Europe/London -e SERVERURL=<IP/DOMAIN> -e SERVERPORT=51820 -e PEERS=<2_peers> -e PEERDN S=auto -e INTERNAL_SUBNET=10.13.13.0 -e ALLOWEDIPS=0.0.0.0/0,::0/0 -p 55820:51820/udp -v wireguard:/config -v /lib/modules:/lib/modules --sysctl="net.ipv4.conf.all.src_valid_mark=1" --restart unless-stopped li nuxserver/wireguard
Docker logs
and this is the peer_config:
[Interface] Address = 10.13.13.3 PrivateKey = privkey ListenPort = 51820 DNS = 10.13.13.1
[Peer] PublicKey = pubkey Endpoint = IP/DOMAIN:51820 AllowedIPs = 0.0.0.0/0,::0/0
output of docker ps: