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.6k stars 329 forks source link

allow to change MTU for all VPNs #2044

Open ak370 opened 5 months ago

ak370 commented 5 months ago

What's the feature 🧐

In certain circumstances MTU needs to be smaller as some networks have issues. Wireguard side seems to have now(link below) MTU parameter but not OpenVPN. Can there be a feature that allows setting lower MTU irrespective of if it is Wireguard or OpenVPN. I resolve OpenVPN MTU limit problem simply executing below after starting the container, however this should be configurable parameter. docker exec f86573009ed6 /sbin/ip link set dev tun0 up mtu 1300

https://github.com/qdm12/gluetun/issues/1650

Extra information and references

No response

qdm12 commented 1 month ago

Does using OPENVPN_MSSFIX=1272 fixes it (1300-28)?

ak370 commented 1 month ago

Does using OPENVPN_MSSFIX=1300 fixes it?

This flag doesn't to change the MTU is still 1500, however unable to verify as it works at the moment without any flags anyway.

2: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 500 link/none

qdm12 commented 1 month ago

See the mssfix documentation at https://openvpn.net/community-resources/reference-manual-for-openvpn-2-6/

Basically the mtu is unchanged, but internal TCP connections will have packets at most as MTU-MSSFIX. I guess your issues are related to TCP (tunneled over UDP), if you have issues with UDP tunneled over UDP, then using the --fragment option might be of interest but that's rather rare so far and I would prefer to no add this option.