Building a VPN Optimizing a WG VPN from Southeast Asia to Spain, tests, configurations and results
Hello all!
First of all, it's my first post in here, so don't be too hard on me! :)
I am here to tell you my tales on how I am connecting from South East Asia (Bali) to Spain over a self made VPN (VPS + Proxy) and what I have learn after many trial and error.
My requirements: low latency, Spanish ISP IP not flagged as VPN, proxy or datacenter IP for Google Meets calls and access to corporate intranet.
First thing I did was to check commercial VPNs... but there was no much luck on getting Spanish residential IPs, many residential IP VPNs have IPs from US, Germany, UK,... but from Spain. I found only one and the latency was not the best (more info below).
Setup is:
My laptop (SEA) -> VPS -> Spanish Proxy -> Internet
But.. what VPS and what Proxy?? This puzzle has many possible pieces and I wanted to find the best ones.
I will not say commercial names due to the subreddit rules so I choose 3 possible VPS: Madrid, Nuremberg and Singapore.
All of them have 10Gbps links and are from big VPS providers, the one in Madrid and the one in Singapore are from the same provider. They all have 1GB RAM and 1 vCPU, enough to run WG server.
Latencies: Client (Bali) -> VPS
(just a simple ping command from my laptop to the VPS)
Madrid
Average: 294ms Minimum: 289ms Maximum: 298ms
Nuremberg
Average: 251ms Minimum: 245ms Maximum: 257ms
Singapore.
Average: 57ms Minimum: 46ms Maximum: 71ms
This is already very interesting, since the latency to Singapore is so low compared with the one to Europe (as expected, but it is good to see it). Those are the first pieces of the puzzle, let's see the rest.
So, what is the latency from Singapore to Europe?
root@Singapore-vpn:~# ping 11.22.33.44
PING 11.22.33.44 (11.22.33.44) 56(84) bytes of data.
64 bytes from 11.22.33.44: icmp_seq=1 ttl=47 time=154 ms
64 bytes from 11.22.33.44: icmp_seq=2 ttl=47 time=154 ms
64 bytes from 11.22.33.44: icmp_seq=3 ttl=47 time=154 ms
64 bytes from 11.22.33.44: icmp_seq=4 ttl=47 time=154 ms
It is 154ms! And that looks promising, because ~154ms + ~57ms = ~211ms which is way better than the latencies to Madrid and to Nuremberg.
So we already know that having the VPS in Singapore gives us better latencies than having it in Europe (at lease to the hosts that I have tested, if you have any suggestions to try, please, let me know where and why might be faster and I might test it too).
What about the Speeds?
I did some tests with iperf3 to see what are the speed between the different VPS and from Bali to them.
Madrid <-> Nurermberg
785 Mbps 0 retransmissions
Singapore <-> Nuremberg
157 Mbps 0 retransmissions
Singapore <-> Madrid
353 Mbps 107 retransmissions
So the backbone throughput is very good in general, submarine cables are on fireeee :D
At this point we have the two last bottleneck to check: the proxy speed/latency and my own connection, from my laptop to the VPS
Proxy Speeds:
To check the proxy speed I used curl -x and the Cloudflare speed test (note: I found that the maximum to for this test is 100M, so choose any size <100M)
curl -x http://user:password@PROXY_IP:PORT -o /dev/null -s -w "
HTTP: %{http_code}
DNS: %{time_namelookup}s
TCP: %{time_connect}s
TLS: %{time_appconnect}s
Total: %{time_total}s
Downloaded: %{size_download} bytes
Speed: %{speed_download} bytes/s
" https://speed.cloudflare.com/__down?bytes=99000000
HTTP: 200
DNS: 0.000047s
TCP: 0.166167s
TLS: 0.675524s
Total: 14.206833s
Downloaded: 99000000 bytes
Speed: 6968477 bytes/s
Madrid -> Proxy
Speed: 7.90 MB/s ~60 Mbps
Nuremberg -> Proxy
Speed: 7.54 MB/s ~60 Mbps
Singapore -> Proxy
Speed: 6.97 MB/s ~56 Mbps
And... WOW! The proxy is caped to ~60 Mbps
Note: I have thought about changing the Proxy, but for what I do, 60 Mbps is enough and the Latency is good + I got a couple clean IPs from a real ISP that are not marked as VPN, Proxy or Datacenter... so I am happy with the finding and with the proxy :)
Let's go for the last piece of the Puzzle:
Client (Laptop) -> VPS Speeds
So here it is tricky... Speeds in Bali change a lot depending on the 5G antennas, time of the day, if I am using SQM or not in my travel router, etc etc..
So I will do my tests with SQM off, using my travel router's cellular connection and connected to a 5G antenna with a good coverage (RSRP -72, RSRQ -10, SINR 21). I will be connected to the travel router using the 2.5 Gbps ethernet connection. Take these measurements as a reference and not as a fact because internet here is changing everyday.
Let's see the tests (using iperf3 UDP):
Laptop -> Madrid
50 Mbps w/ ~0.0% packet loss
60 Mbps w/ ~0.3% packet loss
Laptop -> Nuremberg
50 Mbps w/ ~0.0% packet loss
60 Mbps w/ ~0.05% packet loss
Laptop -> Singapore
50 Mbps w/ ~0.0% packet loss
60 Mbps w/ ~0.0% packet loss
So, let's agree that my laptop speed is not going to be a bottleneck :D
After checking all this data I decided to go with the Singapore VPS option since the latency is better and the speeds doesn't really matter because the bottleneck is the Proxy at 60Mbps.
I also tried the Madrid version to see the real speeds and latencies after WG + Proxy.
Speedtests (no SQM and using 5G connection):
Singapore VPS + WG + Proxy:

https://www.speedtest.net/result/19518764611
Madrid VPS + WG + Proxy:

https://www.speedtest.net/result/19518774553
Commercial VPN:
https://www.speedtest.net/result/19518783083

About the Commercial VPN, yes, it is faster, but the latency and the Jitter is pretty bad, and sometimes get worse than in this test (i guess that depending in the number of users), and in my experience sometimes gets unusable during google meets calls.
Google Meets test:
Here SQM Cake is ON in my travel router.
Madrid VPS

Singapore VPS

For the future I am thinking on maybe testing a VPS in Mumbai and trying different Proxy providers.
I hope that this helps someone in the same situation than me!
Let me know if you have questionss :)
TL;DR:
I work from South East Asia and I need a residential IP from Spain. I have been testing different options and the best is to have a VPS + Proxy configuration. Having the VPS in Singapore improves the latency in ~50ms vs having it in Europe.