Getting a double-VPN setup to work with MTU differences?
Getting a double-VPN setup to work with MTU differences?
Background: I have a cellular ISP and therefore cannot configure the CGNAT. After burning through some dumb ideas (free reverse proxy, docker) I realized I could just use my paid VPN.
My setup is as follows: on the VPN server create a tunnel to AirVPN and start the openvpn daemon. This creates tun0
and tun1
with their own 10.x.x.x/24
subnets. The home network has 192.168.12.0/24
.
It's possible to troubleshoot the MTU with ping -M do -s xxxx y.y.y.y
to the VPN public address and test TCP/UDP sockets with nc -l -u -p 1194
.
I'm not sure if the MTU is variable across servers, but for the server I am on now ping -M do -s 1432 x.x.x.x
is the biggest I can get a response from. 1432+20+8=1460 bytes.
Regardless, connecting to the home VPN through the AirVPN link still causes breakage. Discord seems to be what isn't working, mostly. Everything else has 200 ms latency as expected and not everything pings correctly. Rarely it will tell me the MTU has to be adjusted, sometimes tells me "message too long" and mostly just ignores my ping.
Can someone give me a recommendation for what MTU to be setting in my local OpenVPN server? Should I use mssfix
or tun-mtu
? Should I lower the MTU of the AirVPN connection? What else can I do?
Diagram:
Home -> AirVPN <- (1460 MTU) -> OpenVPN Client & server -> (1300 MTU) -> Home -> Outside World
In the process of doing this I somehow shut my house's WiFi down...
How did you arrive at a 1300B MTU for your openvpn server?
1460B is the MSS for TCP over IPv4 over Ethernet (which has a standard MTU of 1518B) but I can't figure out the 1300B.
Maybe AirVPN is fragmenting your packets to fit the 1300B, and when the AirVPN server doesn't bother you get the message too error. Maybe a limitation on individual servers, which is why it sometimes works.
I assumed there was some overhead so I made the second VPN mtu much lower.