Ubuntu – Tweaking network traffic for OpenVPN tunnel

centosnetworkingopenvpnUbuntu

I've set up an OpenVPN server on a VPS running Centos 5.7 via UDP. Clients connect to it on boot and if-up, get issued a 10.5.5.x address. The server runs mail, samba and jabber servers. OpenVPN is set up so that clients can see each other, so ping, jabber, ssh, scp, etc. work. The tun interface is for this subnet only, so normal internet traffic doesn't get routed. All clients are Ubuntu 11.10.

I'm having issues with network traffic though. It seems that whenever there is a larger amount of data to be transferred (scp peer-to-peer, sending larger mail attachments to the server, file transfer via Pidgin/XMPP, VNC peer-to-peer) the activities time out. At least I think they do, because the activity just hangs. For example:

user@somehost:~$ scp Desktop/ss.png root@10.5.5.55:/home/otheruser/Desktop/
ss.png                                      100% 849KB 848.7KB/s 00:00

and it just hangs there. ctrl-c doesn't work. smaller files go trough without a problem. scp'ing that file to the server and then scp'ing it to the intended peer works.

Ping latency over VPN (client to server) varies from 90 to 300 ms, depending on client.

So I'd appreciate some pointers on stuff to read up on regarding tweaking the network settings so that all intended transfers go trough as intended.

Best Answer

This feels like an MTU issue: small files work, large ones don't.

openvpn has a --mtu-test option to probe for the size of the MTU over the link. You can run that.

If it shows an MTU of less than 1500, you might want to look at the "fragment" and/or "mssfix" options.

Look at the docs http://openvpn.net/index.php/manuals/427-openvpn-22.html for MTU-related options/discussion.

Related Topic