Legacy Archive (2014): Originally written in Chinese on doubixie.com and translated into English for this edition. All archive posts · Home

Notes on Setting Up a Reliable VPN

Original Chinese title: 稳定翻墙小计

The Problem

  • To me, the GFW used to just mean occasionally hopping over to take a look around—until a few days ago, when Dropbox suddenly got blocked too. As my main cloud storage tool, losing it basically brought my workflow to a halt. Without Dropbox, keeping files synced across multiple environments is a massive headache.
  • I first considered domestic cloud drives. I have a Baidu Netdisk account, which I normally just use for movies and photos. I once tried putting my QQ chat history .msc files on Baidu Cloud, only to discover its sync strategy can’t handle incremental updates properly: every single time I chatted with someone, it created a dated conflict file. By contrast, Dropbox’s incremental sync is awesome and handles it seamlessly. With Baidu Cloud, I’d have to turn off sync whenever QQ was open and manually sync everything after closing QQ.
  • That’s completely anti-human—and besides, I don’t really trust domestic cloud drives anyway—so I still wanted to stick with Dropbox.
  • At first I tried routing Dropbox through GoAgent as a proxy, but it wouldn’t update, kept throwing errors, and GoAgent itself was getting more and more unstable.
  • On Moonlight Blog I saw a workaround using OpenDNS. That actually did let Dropbox update, except changing the DNS on the campus network broke access to internal campus sites. Had to give up on that too.
  • Finally, I went with an approach shared by some guru on Zhihu: buy an overseas VPS and set up a personal VPN once and for all. A junior labmate recommended DigitalOcean’s SSD VPS: $5/month for 512MB RAM, a 20GB SSD, and 1TB of bandwidth—more than enough for my needs. That’s the route I took.

DigitalOcean

  • Nothing too tricky on this step. If you don’t have a foreign credit card, don’t enter your card info directly during sign-up—I have a dual-currency card, and it got rejected upon submission.
  • Cleverly, I used my credit card to register a PayPal account instead, since DigitalOcean accepts PayPal. Payment went right through. When spinning up the droplet, just pick the lowest tier—the $5/month plan.
  • For the OS, I picked CentOS 6.4 x64. Given the limited RAM, 32-bit probably would’ve been better, though since it’s only running a VPN, it doesn’t really matter.

Setting Up the VPN

  • I went with a PPTP VPN. The main downside of this protocol is that one IP normally only supports a single connection, though most routers seem to handle this better—even my basic TP-Link router lets multiple devices connect to the VPN through one IP.
  • I won’t paste a full tutorial here; a quick Google search brings up tons of guides. The main things to watch out for are the Linux firewall rules and packet forwarding settings.

Watch Out for ISP Quirks (Especially Certain Broadband Providers)

  • When setting up a VPN on PPPoE (dial-up broadband), you might hit weird issues like losing internet completely the moment the VPN connects. After three days of troubleshooting and endless Googling and Baidu searches, we realized the ISP was tampering with the traffic. Here are two workarounds:
    • Use CCProxy. This domestic tool is surprisingly solid and has been verified to work across different broadband ISPs.
    • If you prefer sticking with a regular VPN, there’s another trick: install the VPN inside a virtual machine using NAT and shared networking to get past the ISP’s restrictions. Essentially, it disguises the VPN connection as a regular process from the host machine. So far, this completely bypasses the PPPoE limitation.
    • Of course, you can also just use out-of-the-box solutions like OpenVPN.

That’s Pretty Much It~