ss11 22 Posted ... Hello, Using the advanced config generator I can see there is a MTU setting but it is labeled as "Wireguard only" and the default is set to 1320. This is perfectly valid for a good WireGuard setup. The problem is with OpenVPN, there is no MTU setting. There is a textarea box that allows you to enter any OpenVPN custom directives and is marked with "use with caution" - that still does it but is a 1`tun-mtu` pulled from server or something like this? Example, if I use OpenVPN and connect to the AirVPN server using IPv4 ingress and UDP protocol, IPv6 works flawlessly. If I use OpenVPN and connect to the AirVPN server using IPv6 ingress and UDP protocol, it complains about MTU and I need to add tun-mtu 1400 in client OpenVPN config file, then it works flawlessly. OpenVPN manual says it adds 80 bytes header on average, which allows us a NET clean max MTU of 1420. If this is the case, why don't we make the default for OpenVPN client configs to include `tun-mtu 1400` ? Are there any setbacks here? I guess 1500 is the maximum MTU everywhere, in best cases. Older ISPs with less advanced terminal devices even can do 1492 maximum, if they don't use PPP jumbo frames, so I guess a `tun-mtu 1400` for OpenVPN configs and 1320 MTU for WireGuard configs does the job flawlessly. Opinions? Quote Share this post Link to post
Staff 10715 Posted ... Hello, The MTU field in the Config Generator is for WireGuard only. For OpenVPN, the generated profiles set neither tun-mtu nor mssfix, and neither do our servers, so both ends run the OpenVPN defaults: tun-mtu 1500 and, from OpenVPN 2.6 on, mssfix 1492 mtu. Is tun-mtu pulled from the server? Yes, with OpenVPN 2.6 or newer and with OpenVPN3-based clients. The client says it accepts a pushed MTU, the server pushes "tun-mtu 1500", and that value replaces the tun-mtu in your profile on the tunnel interface. To keep your own value, put both lines in the custom directives box (in Eddie: Preferences > OpenVPN directives): tun-mtu 1400 pull-filter ignore "tun-mtu" After connecting, check the interface MTU ("ip link" on Linux, "netsh interface ipv4 show subinterfaces" on Windows). Without the pull-filter line, tun-mtu 1400 still does something. On OpenVPN 2.6+, a tun-mtu other than 1500 also makes OpenVPN clamp the TCP MSS so that packets fit in 1400 bytes, and the clamp stays after the server pushes 1500. That is probably why your change helped. Overhead: over UDP with AES-256-GCM or CHACHA20-POLY1305, OpenVPN adds 24 bytes (28 with the newer data format in OpenVPN 2.7), plus 8 bytes of UDP header and 20 bytes of IPv4 or 40 bytes of IPv6 header. That makes about 52-56 bytes over IPv4 and 72-76 over IPv6, so a full 1500-byte packet leaves as about 1576 bytes over IPv6. 1420 just fits a 1500-byte path over IPv6. 1400 also fits a 1492-byte PPPoE line over IPv6. Why IPv6 entry fails on the same line where IPv4 entry works: oversized IPv4 packets are normally fragmented and delivered, while many networks and firewalls drop IPv6 fragments. The default "mssfix 1492 mtu" already counts the IPv6 header and keeps TCP within 1492 bytes, but it does not help in three cases: On Linux and FreeBSD with DCO, the kernel module ignores mssfix, and only the interface MTU counts. Windows DCO does apply it. OpenVPN 2.5 and older use a default (1450, without "mtu") that produces 1498-byte IPv6 packets, which is too much for a PPPoE line. mssfix only touches TCP, so UDP traffic (QUIC, for example) and ICMP are not covered. Tell us your OS, your client and its version, whether DCO is active, and the exact log line about the MTU, and we can tell you which case applies. Why not tun-mtu 1400 in every profile: On every OpenVPN 2.6+ client, the pushed 1500 would replace it on the interface unless we also added the pull-filter, and then everybody would get the smaller MTU. Most users connect over IPv4, or over IPv6 paths without problems. For them 1400 means about 7% more packets for the same bulk TCP transfer (MSS 1360 instead of 1460) and no benefit. Our side of the tunnel stays at 1500, so a lower value on your side does not limit large UDP packets coming from the server to you. TCP is covered by the MSS clamp. For now we keep the defaults. Where a path needs a lower value, use the two lines above in your profile, or connect over IPv4: as you noticed, IPv6 inside the tunnel works the same. To measure your path MTU, disconnect from the VPN and ping the entry IP from the "remote" line of your profile (our servers answer ping): Linux, IPv6: ping -6 -M do -s 1452 <entry IPv6> (1452 + 48 = 1500 bytes) Linux, IPv4: ping -M do -s 1472 <entry IPv4> (1472 + 28 = 1500 bytes) Windows, IPv4: ping -f -l 1472 <entry IPv4> macOS, IPv4: ping -D -s 1472 <entry IPv4> Windows has no don't-fragment switch for IPv6 pings, so only the IPv4 test is meaningful on Windows. Lower -s (or -l) until replies come back. The path MTU is that size plus 48 for IPv6, or plus 28 for IPv4. The largest safe tun-mtu over UDP is about the path MTU minus 76 for IPv6, or minus 56 for IPv4. If large pings just time out, with no "message too long" or "packet too big" error, something on the path filters ICMP. That is exactly the case where path MTU discovery fails and a manual tun-mtu is needed. Kind regards Quote Share this post Link to post
ss11 22 Posted ... Hey @Staff thank you for your reply. makes total sense. here is what happened. I use OpenVPN on a computer that acts just as the router. It used to run Debian Bullseye (aka openvpn 2.5.x). To that router I have a Windows 10 machine, that has only a NAT IPv4 address and ULA (Unique Local Link Local IPv6 address). There is no OpenVPN software on the Windows machine itself, the Debian router acts as the gateway and does NAT / NATv6 via iptables rules and IP forwarding. Both Debian Bullseye router and Windows client had MTU 1500 set for tun interface (router) and Ethernet interface (Windows client -> talking to the router). There was no `tun-mtu` directive in the OpenVPN config file whatsoever. It used to work flawlessly without any problems for IPv6 on the Windows client. However, since Bullseye is end of life I have upgraded to Debian Bookworm, thus OpenVPN 2.6.x. And that is when internet became broken for the Windows machine, most probably because of the tun-mtu 1500 you said it gets pulled from the server. I have added `tun-mtu 1400` to OpenVPN client config file on the router and left MTU 1500 on the Windows client, and it works flawlessly. However after reading your post I checked the Debian Bookworm OpenVPN 2.6.x MTU for the OpenVPN tun0 interface and it is the same 1500 regardless I've set `tun-mtu 1400` in .ovpn config file. So I am certain it is because OpenVPN clamp the TCP MSS related to lower than 1500 MTU value, but what is the ideal permanent fix for this, since `tun-mtu 1400` in my client config file will not protect me from a packet coming from the server side? Quote Share this post Link to post