We are running a OpenVPN VPN over a BGAN satellite link where ping times are about 3 seconds. We use it in a tun configuration, and we're running on Linux (CentOS). It is primarily email that will be sent over the link, but as soon as the mail contains large attachments, the VPN seems to stall.
The "I can ping through the tunnel, but any real work causes it to lock up. Is this an MTU problem?" question in the OpenVPN FAQ seems to describe my problem exactly, but using mssfix
and fragment
still does not seem to do much to improve the situation.
My main test is to copy a 2MB file over the VPN with scp. It will copy about 192kbytes, and then report a - stalled - state. If I wait a couple of seconds it will start copying again, and then stall again after another couple of kbytes.
This stalling occurs whether or not I've set the fragment
or mssfix
options in my OpenVPN configuration (although setting fragment 1000
did seem to reduce the stalling, but not eliminate it). The OpenVPN mtu-test
reported 1542 as the MTU size.
I've searched the internet for more advice on how and when to use mssfix
and fragment
, but I only find pages saying the same as the FAQ, and not giving details as to how and when to use which parameters.
My questions then is:
- When do I use
mssfix
andfragment
? - Do I use
mssfix
andfragment
in combination? - If
mssfix
andfragment
are the solution, what are thetun-mtu
,link-mtu
andmtu-disc
parameters for?
Furthermore, I've been using the tool iperf to measure the bandwidth. Without the VPN, it constantly measures in the order of 210Kbits/sec.
When using iperf over the VPN ($ iperf -c remoteserver -t60 -i5
), it would start at 10Kbits/sec, then steadily go up until it reports 1.2Mbits/sec, and then it will seem to stall, where it reports 0kbits/sec for a number of iterations (I think the 1.2Mbits/sec may be because of some OpenVPN buffering or so on)
Is iperf the best way to measure the bandwidth?
Any help with this situation will be greatly appreciated.