While using OpenVPN, measurements on server-side upstream (tun0
and eth0
) and client-side downstream (Networx) agree that my connection is at 16 Mbit/s.
But, all of my PC applications are seeing exactly half of that speed.
[Server] <--16 Mbit/s--> [Client PC] <--8 Mbit/s--> [PC apps (e.g. Steam)]
What's up?
The Linux VPN server is using the default example configuration, except I'm using TCP, using a different port, changed cipher to AES-128, and I'm using fast-io
and tcp-nodelay
.
I also ran echo 1 > /proc/sys/net/ipv4/tcp_low_latency
server-side.
For the Windows client, I disabled Nagle's algorithm. The rest follows the server settings (TCP, different ports, etc.)
All of those settings are in an effort to reduce latency which seems to work (200ms vs 35ms).
Server config:
# Base stuff
port XXXXX
dev tun
proto tcp
# Security stuff
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
tls-auth ta.key 0
key-direction 0
cipher AES-128-CBC
auth SHA256
user nobody
group nogroup
persist-key
persist-tun
verb 3
status openvpn-status.log
# Client rules
client-to-client # Allows clients to see each other
duplicate-cn # One config file for all clients
# Networking stuff
keepalive 5 120
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 208.67.222.222"
# Optimization stuff
sndbuf 0
rcvbuf 0
comp-lzo
tcp-nodelay
fast-io
Client OVPN file:
client
dev tun
proto tcp
tcp-nodelay
fast-io
remote X.X.X.X XXXXX
remote X.X.X.X XXXXX
resolv-retry infinite
nobind
persist-key
persist-tun
user nobody
group nogroup
remote-cert-tls server
cipher AES-128-CBC
auth SHA256
key-direction 1
comp-lzo
verb 3
sndbuf 0
rcvbuf 0
<ca>
XXXXXXXXXXXXXXXXXx
</ca>
<cert>
XXXXXXXXXXXXXXXXXx
</cert>
<key>
XXXXXXXXXXXXXXXXXx
</key>
<tls-auth>
XXXXXXXXXXXXXXXXXx
</tls-auth>