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
6.71k stars 331 forks source link

feat(openvpn): Add OPENVPN_MTU env to change default tun-mtu #2221

Open PseudoResonance opened 2 months ago

PseudoResonance commented 2 months ago

This resolves #2044.

tun-mtu directive will be omitted if OPENVPN_MTU is unset.

Additionally lowers the default AirVPN TunMTU to 1320 to resolve connection issues, such as the following: #1417 #1989

qdm12 commented 2 months ago

Does using for example OPENVPN_MSSFIX=1292 (1320-28, see https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/) fix it instead?

PseudoResonance commented 1 month ago

Yes, the OPENVPN_MSSFIX environment variable was also able to resolve the issue. I could probably just remove the OPENVPN_MTU variable and leave only the AirVPN config change if you'd like.

Edit: Actually, I spoke too soon... I missed the logs about the DNS list downloads failing. It doesn't seem to work.

Edit: Never mind, it appears to be working again? I'm not sure what changed, but I'll leave it running for a bit and see.

qdm12 commented 1 month ago

Edit: Never mind, it appears to be working again? I'm not sure what changed, but I'll leave it running for a bit and see.

Yes take your time and let's find out.

I was changing your code actually to have a common VPN_MTU common for Wireguard and OpenVPN (and remove WIREGUARD_MTU), and default it to 1320 for all. However, I was a bit skeptical this would break OpenVPN setups using the default MTU (I think 1500?). It might also be problematic if the MSSFIX option is used (in that case we should default it to 1500 for retro-compatibility???). Anyway a bit messy in the end, so if we can leave it using OPENVPN_MSSFIX that would be great. Maybe something to write into #1113 (add VPN_MTU, remove OPENVPN_MSSFIX+WIREGUARD_MTU)

PseudoResonance commented 1 month ago

After around a month, I think it's been working well with just MSSFIX set. It did have issues a few times for some reason, but after it restarted once or twice it worked. I think the behavior was similar with my MTU flag too though.