I have just created an OpenVPN 2.4.4 server at home using Ubuntu Server 16.04-3LTS on a PC as the platform.
It is configured as I usually do and in my tests (using an Android phone) I get very good performance with speeds limited only by the mobile network and when using WiFi by the test router (only capable of 50 Mbit/s).
I also checked here at home with another Win7 laptop connected to the test router by Ethernet cable and then I got 70 Mb/s down and 75 Mb/s up, so the server must be working OK.
In case you wonder:
My main Asus router is connected to a fiber box and my test router (old TP-Link) is also connected to this fiber box on another Ethernet port so they have different WAN addresses. This makes it possible to test the system except for the full speed since the TP-Link is old so it has 100 Mbit Ethernet only and my fiber is at 250 Mbit/s.
This OpenVPN server is going to be used by my brother-in-law, who is currently abroad, in order to access the Swedish sports channels during the Olympics.
Yesterday night when he tested it using his iPad at his temporary home he got a transfer speed of 91 Mb/s download and 60 Mb/s upload.
The server side logs show that all is OK.
But when he next tested with his laptop (running Windows 7) he got a dismal 3 Mb/s download but 68 Mb/s upload.
Without the VPN tunnel he is getting close to 100 Mb/s both ways.
So "something" is not working correctly for downloading, I assume. But what?
I looked in the logs for his laptop attempts (I asked him to send his client log) and this is what I found:
Server log:
Thu Feb 1 07:52:01 2018 us=395383 93.122.xxx.xx:59873 [HakanUbu] Peer Connection Initiated with [AF_INET]93.122.xx.xx:59873
Thu Feb 1 07:52:01 2018 us=395454 HakanUbu/93.122.xxx.xx:59873 MULTI_sva: pool returned IPv4=10.8.0.3, IPv6=(Not enabled)
Thu Feb 1 07:52:01 2018 us=395571 HakanUbu/93.122.xxx.xx:59873 MULTI: Learn: 10.8.0.3 -> HakanUbu/93.122.xxx.xx:59873
Thu Feb 1 07:52:01 2018 us=395604 HakanUbu/93.122.xxx.xx:59873 MULTI: primary virtual IP for HakanUbu/93.122.xxx.xx:59873: 10.8.0.3
Thu Feb 1 07:52:02 2018 us=641069 HakanUbu/93.122.xxx.xx:59873 PUSH: Received control message: 'PUSH_REQUEST'
Thu Feb 1 07:52:02 2018 us=641253 HakanUbu/93.122.xxx.xx:59873 SENT CONTROL [HakanUbu]: 'PUSH_REPLY,route 192.168.119.0 255.255.255.0,redirect-gateway def1 bypass-dhcp,route-gateway 10.8.0.1,topology subnet,ping 10,ping-restart 120,ifconfig 10.8.0.3 255.255.255.0,peer-id 0,cipher AES-256-GCM' (status=1)
Thu Feb 1 07:52:02 2018 us=641299 HakanUbu/93.122.xxx.xx:59873 Data Channel: using negotiated cipher 'AES-256-GCM'
Thu Feb 1 07:52:02 2018 us=641345 HakanUbu/93.122.xxx.xx:59873 Data Channel MTU parms [ L:1550 D:1450 EF:50 EB:406 ET:0 EL:3 ]
Thu Feb 1 07:52:02 2018 us=641695 HakanUbu/93.122.xxx.xx:59873 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Thu Feb 1 07:52:02 2018 us=641733 HakanUbu/93.122.xxx.xx:59873 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Thu Feb 1 07:52:02 2018 us=872911 HakanUbu/93.122.xxx.xx:59873 MULTI: bad source address from client [::], packet dropped
Thu Feb 1 07:56:06 2018 us=951176 HakanUbu/93.122.xxx.xx:59873 [HakanUbu] Inactivity timeout (--ping-restart), restarting
Thu Feb 1 07:56:06 2018 us=951283 HakanUbu/93.122.xxx.xx:59873 SIGUSR1[soft,ping-restart] received, client-instance restarting
Look at the 3rd last line (MULTI: bad source address from client [::]) where it looks like some IPv6 transaction is happening!
The client side log looks like this (there is a 1 hour time difference between our locations):
Thu Feb 01 08:52:00 2018 OpenVPN 2.4.4 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Sep 26 2017
Thu Feb 01 08:52:00 2018 Windows version 6.1 (Windows 7) 64bit
Thu Feb 01 08:52:00 2018 library versions: OpenSSL 1.0.2l 25 May 2017, LZO 2.10
Enter Management Password:
Thu Feb 01 08:52:01 2018 TCP/UDP: Preserving recently used remote address: [AF_INET]81.170.xxx.xxx:1191
Thu Feb 01 08:52:01 2018 UDP link local: (not bound)
Thu Feb 01 08:52:01 2018 UDP link remote: [AF_INET]81.170.xxx.xxx:1191
Thu Feb 01 08:52:01 2018 [BosseOVPN] Peer Connection Initiated with [AF_INET]81.170.xxx.xxx:1191
Thu Feb 01 08:52:02 2018 open_tun
Thu Feb 01 08:52:02 2018 TAP-WIN32 device [Local Area Connection 3] opened: \\.\Global\{B76189C6-EC04-4A83-B7EE-01CCA9B5F0BB}.tap
Thu Feb 01 08:52:02 2018 Set TAP-Windows TUN subnet mode network/local/netmask = 10.8.0.0/10.8.0.3/255.255.255.0 [SUCCEEDED]
Thu Feb 01 08:52:02 2018 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.8.0.3/255.255.255.0 on interface {B76189C6-EC04-4A83-B7EE-01CCA9B5F0BB} [DHCP-serv: 10.8.0.254, lease-time: 31536000]
Thu Feb 01 08:52:02 2018 Successful ARP Flush on interface [27] {B76189C6-EC04-4A83-B7EE-01CCA9B5F0BB}
Thu Feb 01 08:52:02 2018 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Thu Feb 01 08:52:07 2018 Initialization Sequence Completed
Thu Feb 01 08:54:09 2018 SIGTERM[hard,] received, process exiting
So what I wonder is if there is some setting I can apply either in the server conf file or in the client ovpn file to make the Win7 PC perform the same as the iPad does? It seems ridiculously strange that there should be such a big difference in performance!
And I have disabled IPv6 completely on the Ubuntu server via /etc/sysctl.d/99-sysctl.conf!
IPv6 should not be used at all.....
For completeness here are the server and client configs:
port 1191
proto udp
dev tun
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key # This file should be kept secret
dh /etc/openvpn/keys/dh2048.pem
topology subnet
server 10.8.0.0 255.255.255.0 'nopool'
ifconfig-pool 10.8.0.2 10.8.0.127 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.119.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
keepalive 10 120
tls-auth /etc/openvpn/keys/ta.key 0 # This file is secret
cipher AES-256-CBC
comp-lzo
max-clients 20
#user openvpn
#group nogroup
persist-key
persist-tun
status /etc/openvpn/log/openvpn-status.log
log /etc/openvpn/log/openvpn.log
verb 4
mute 10
explicit-exit-notify 1
And here is the client ovpn file with certificates and keys removed:
client
dev tun
proto udp
remote home.xxxxxxxxx.com 1191
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
auth-nocache
remote-cert-tls server
key-direction 1
cipher AES-256-CBC
comp-lzo
verb 1
mute 20