Hi all,
I've recently been trying to find out why some users of our openvpn setup are having regular drop outs.
We run the server on ubuntu trusty, and were using the default package in their repos (2.3 I think). Our server is on an Gigabit Virgin Media Fibre connection.
At this stage, my own connection was dropping out every 1-2 minutes when I used it, I have 100Mbps Virgin Media Fibre at home. I'm using Fedora, and currently have openvpn-2.4.5-1.fc27.x86_64 installed.
I made the decision to upgrade the server side software to the build.openvpn.net repo which gave me 2.4.4-trusty0
This solved my problems with VPN and mine is now rock solid, and only drops out very occasionally, even on a 4g hotspot.
However, at this point, some of our users started reporting issues where their VPN was dropping out periodically. Some of these users were on openSUSE, ubuntu 16.04 and OSX using Tunnelblick latest stable.
A sample of our VPN server config is:
port 1194
proto udp
dev tun
ca ca.crt
cert vpn.crt
key vpn.key
dh dh2048.pem
server 10.10.4.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 10.10.8.0 255.255.248.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 10.10.10.3"
push "dhcp-option DNS 10.10.10.6"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DOMAIN domain.com"
keepalive 10 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log-append /var/log/openvpn.log
verb 3
reneg-sec 0
Also, our client config:
remote vpn.domain.com
proto udp
port 1194
comp-lzo
verb 3
dev tun
persist-tun
persist-key
client
cipher BF-CBC
ca ca.crt
cert user.crt
key user.key
auth-user-pass
reneg-sec 0
Around the time of the user dropping out I would see messages like the following:
TLS Error: local/remote TLS keys are out of sync
These lines would repeat, sometimes a user would drop connection, other times it would be fine. I found an article from some years ago saying that this is common with UDP openvpn as the client can't be notified when the server has restarted. I don't believe the server had been restarted, but as a test I created a TCP VPN, which was mostly the same, but had no comp-lzo enabled. Again for my connection this worked fine, but some users still saw sporadic drops. One user reported that if he were downloading any large file while on the VPN it made it more unstable.
We also looked in to whether this was caused by MTU settings, the user who saw some major issues found an article that suggested finding the highest value of MTU that worked by doing a ping check and using that value as the mssfix in the config. We tried this, and when he tested he found he couldn't get ping to work until he set his MTU around 500, at this value the VPN wouldn't even connect. I know this user has a slightly poor internet connection (they are on ADSL on fairly poor lines) but I would hope the VPN to be stable even on fairly poor internet connections.
At this point I am running out of things to try, but I have some questions:
- Should different versions of openvpn client/server cause stability issues? Since some users use tunnelblick keeping the versions matching is quite difficult.
- Is there anything else I can try to help our users gain a solid VPN connection using openvpn? I have now been asked to start looking for alternatives to openvpn, as the stability issues is making it unusable for some of our users. But I would rather not replace it if it can be fixed.
I am aware that comp-lzo is deprecated in 2.5 and we need to move away from it. But I don't see any point fixing that unless I know I am going to continue to support openvpn at this point.