Iptables – Slow OpenVPN tunnel

iptablesnetworkingopenvpn

I have a tunnel set up between two AWS regions. Using iperf, I saw that if I connect two machines directly (through the internet), I get about 100mb/s. If I use the tunnel, I get 10mb/s.

Is there a way to speed things up?

Here's my config:

proto tcp-server
port 1996
dev tun-us-east-1
remote <public IP>
route 10.8.0.0 255.255.0.0
ifconfig 10.248.0.1 10.248.0.2
keepalive 10 120
secret ovpn.key
log /var/log/openvpn.log
persist-tun
persist-key

user nobody
group nogroup

The other side is basically the same. I tried using UDP but it's still quite slow. I also tried removing compression and even encryption but no real change.

Best Answer

As suggested by @EEAA, I switched back to UDP. I also added the following to my config file:

comp-lzo no
tun-mtu 1470
mssfix 1430

Now it's super fast!

Related Topic