qdm12 / gluetun

VPN client in a thin Docker container for multiple VPN providers, written in Go, and using OpenVPN or Wireguard, DNS over TLS, with a few proxy servers built-in.
https://hub.docker.com/r/qmcgaw/gluetun
MIT License
7.69k stars 359 forks source link

Bug: protonvpn internal port assigned 0 differs from external port assigned #1840

Closed notdeadyett closed 1 year ago

notdeadyett commented 1 year ago

Is this urgent?

No

Host OS

Unraid

CPU arch

x86_64

VPN service provider

ProtonVPN

What are you using to run the container

docker run

What is the version of Gluetun

Latest

What's the problem 🤔

Constantly getting a warning in the logs about the internal port differing from the external port when using protonvpn port forwarding with wireguard.

Share your logs

2023-09-02T00:12:11Z WARN [port forwarding] internal port assigned 0 differs from e
xternal port assigned 50326
2023-09-02T00:12:11Z WARN [port forwarding] internal port assigned 0 differs from e
xternal port assigned 50326
2023-09-02T00:12:56Z WARN [port forwarding] internal port assigned 0 differs from e
xternal port assigned 50326
2023-09-02T00:12:56Z WARN [port forwarding] internal port assigned 0 differs from e
xternal port assigned 50326
2023-09-02T00:13:41Z WARN [port forwarding] internal port assigned 0 differs from e
xternal port assigned 50326
2023-09-02T00:13:41Z WARN [port forwarding] internal port assigned 0 differs from e
xternal port assigned 50326
2023-09-02T00:14:26Z WARN [port forwarding] internal port assigned 0 differs from e
xternal port assigned 50326
2023-09-02T00:14:26Z WARN [port forwarding] internal port assigned 0 differs from e
xternal port assigned 50326
2023-09-02T00:15:11Z WARN [port forwarding] internal port assigned 0 differs from e
xternal port assigned 50326
2023-09-02T00:15:11Z WARN [port forwarding] internal port assigned 0 differs from e
xternal port assigned 50326

Share your configuration

docker run -d -p 8112:8112 --cap-add=NET_ADMIN --restart=always --name=gluetun -e VPN_SERVICE_PROVIDER=custom -e VPN_TYPE=wireguard -e VPN_ENDPOINT_IP=<redacted> -e VPN_ENDPOINT_PORT=51820 -e WIREGUARD_PUBLIC_KEY=<redacted> -e WIREGUARD_PRIVATE_KEY=<redacted> -e WIREGUARD_ADDRESSES="<redacted>" -e VPN_PORT_FORWARDING=on -e VPN_PORT_FORWARDING_PROVIDER=protonvpn qmcgaw/gluetun
privacyguy123 commented 1 year ago

Noticed this bug too - only difference is I have the wg0.conf file passed through as a variable. Not sure what this error message means?

FC777-7 commented 1 year ago

Same here, have that warning

miiraheart commented 1 year ago

I am having the same warning as well

boydwold commented 1 year ago

Same for me.

jgramling17 commented 1 year ago

Same here

maxou2600 commented 1 year ago

Same here

Landrin201 commented 1 year ago

I'm seeing the same; just noticed it today. No idea what's causing it. Also using ProtonVPN.

qdm12 commented 1 year ago

TLDR Something to ignore, and check got changed in c0062fb8078e46466f03437233c8ab503e40231b from checking assignedInternalPort != assignedExternalPort to assignedInternalPort != requestedInternalPort

For context and additional details, gluetun requests internal port 0 and external port 0, and the protonvpn natpmp server responds with an assigned internal port 0 and assigned external port 9876 (where 9876 is any port available). During testing, it didn't seem like the assigned internal port was differing from the assigned external port, but maybe this changed since then. Anyway, it does not matter, now the assigned internal port is left to 0, and what really matters is the assigned external port anyway.

Also @notdeadyett please set a title to the issue next time, this really hardens filtering issues for me.

consenti commented 1 year ago

I updated to latest image, but still see the same error.

Running version latest built on 2023-09-13T14:23:59.922Z (commit c0062fb)

"internal port assigned 41662 differs from internal port requested 0" comes up before writing /tmp/gluetun/forwarded_port

Afterward it goes back to the same error as previously reported. "internal port assigned 0 differs from external port assigned 41662"

notdeadyett commented 1 year ago

I updated to latest image, but still see the same error.

Running version latest built on 2023-09-13T14:23:59.922Z (commit c0062fb)

Actually, I see two errors now 1 - internal port assigned 41662 differs from internal port requested 0 2 - internal port assigned 0 differs from external port assigned 41662

I am seeing the same.

boydwold commented 1 year ago

I get the same warning over and over.

fizzxed commented 1 year ago

I am also getting the previous warnings. I assume its these lines spamming the log: https://github.com/qdm12/gluetun/blob/3449e7a0e17699fb7066c9de173b40cade50faec/internal/provider/protonvpn/portforward.go#L94-L98 since its every 45 seconds. Should the same change be made to these lines? @qdm12

qdm12 commented 1 year ago

Re-fixed in ea25a0ff89b716c4ab7dd79c631b554828c65f9d

Thanks @fizzxed for finding the second log occurence (and also re-creating another issue since I don't monitor closed issues- shame on me!). From now on, it will only log a warning when the assigned external port changes from its previous value.