{"id":116,"date":"2017-04-12T00:00:00","date_gmt":"2017-04-12T00:00:00","guid":{"rendered":"http:\/\/ssdnodes.billabailey.com\/2017\/04\/12\/an-idiot-and-his-vpn\/"},"modified":"2025-05-18T13:08:08","modified_gmt":"2025-05-18T13:08:08","slug":"an-idiot-and-his-vpn","status":"publish","type":"post","link":"https:\/\/www.ssdnodes.com\/blog\/an-idiot-and-his-vpn\/","title":{"rendered":"Should Setting up a VPN Be This Hard?"},"content":{"rendered":"<p>In the last days of March, the U.S. government overturned <a href=\"http:\/\/www.bbc.com\/news\/world-us-canada-39436287\" target=\"_blank\" rel=\"noopener\">rules aimed at protecting the privacy<\/a> of users of internet service providers (ISP). With the rules gone, ISPs no longer need to obtain permission to sell user data. For a lot of people, that's a little scary.<\/p>\n<p>Now, I recognize that ISPs are not selling my own specific data, but rather my data in aggregate with probably thousands of other customers just like me. I also know that they're not snooping in on HTTPS-secured traffic. I also know that tools like <a href=\"http:\/\/www.theverge.com\/2017\/3\/30\/15127360\/internet-noise-browsing-tool-advertising-isp\" target=\"_blank\" rel=\"noopener\">&quot;Internet Noise&quot;<\/a> are less actual solutions to the problem and more one-off experiments to occupy a developer over their weekend.<\/p>\n<p>Tech blogs and journalists have been touting the value of a virtual private network (VPN) ever since. I've been hearing about them for years, but mostly as a means to 1) get past region-blocked content on Netflix or 2) ensuring a secure connection when using hotel\/airport WiFi. I knew that neither of those two applications appeal to me, and I knew that I didn't want to run my VPN with some company operating out of the Seychelles.<\/p>\n<p>Because that's just boring.<\/p>\n<h2>Finding the right solution<\/h2>\n<p>I'm not completely militant about securing (or obscuring) my internet traffic with a VPN\u2014if I was truly worried about that, I'd have started a long time ago, or would be using something like Tor instead. More than anything, these recent changes are a catalyst to convince me to finally poke around something that I've been curious about for years.<\/p>\n<p>All this is to say I'm okay with an imperfect solution. I'm okay with only marginal protection. And I'm okay with failure, <em>but only if it's my fault<\/em>.<\/p>\n<p>Matt, the CEO of SSD Nodes (and my boss), recommended that I try out <a href=\"https:\/\/github.com\/OpenVPN\/openvpn\" target=\"_blank\" rel=\"noopener\">OpenVPN<\/a> over any of the other solutions. He's got good reasons to do so\u2014it's a trusted solution that's been around for 15 years.<\/p>\n<p>At first, I was a little horrified by the OpenVPN tutorials that I found floating around online. I'm a <em>decent<\/em> Linux administrator\u2014I've used a VPS for hosting personal sites for years and have personally walked through all of the tutorials on this blog to ensure they work properly\u2014but I'm nothing special.<\/p>\n<p>I did find <a href=\"https:\/\/github.com\/Nyr\/openvpn-install\" target=\"_blank\" rel=\"noopener\">openvpn-install<\/a>, which purports to set up the VPN with a single command. At the time, I figured it simply wasn't for me.<\/p>\n<p>When searching beyond OpenVPN for something a little more streamlined, I found <a href=\"https:\/\/github.com\/trailofbits\/algo\" target=\"_blank\" rel=\"noopener\">algo<\/a>, a &quot;a set of Ansible scripts that simplify the setup of a personal IPSEC VPN.&quot; As part of their release annoucement, they published a blog post that touted Algo as <a href=\"http:\/\/blog.trailofbits.com\/2016\/12\/12\/meet-algo-the-vpn-that-works\/\" target=\"_blank\" rel=\"noopener\">&quot;the VPN that works&quot;<\/a>. I have to admit, I was convinced by their marketing.<\/p>\n<h2>The Algo installation<\/h2>\n<p>Since I work for <a href=\"https:\/\/www.ssdnodes.com\">SSD Nodes<\/a>, my provider choice is simple. I opted for the <a href=\"https:\/\/www.ssdnodes.com\/pricing\/\">cheapest server<\/a>, knowing that 2TB of bandwidth is far, far more than I need\u2014my ISP says I use about 250GB of bandwidth per month.<\/p>\n<p>Installation was incredibly easy. I <a href=\"https:\/\/www.ssdnodes.com\/blog\/connecting-vps-ssh-security\/\">copied by public SSH key<\/a> over to the new server and followed the instructions on the GitHub repository. No issues and I was given a folder with config files and certificates to work from.<\/p>\n<pre><code class=\"language-bash hljs\">ok: [xxx.xx.xx.xx] =&gt; {\n    <span class=\"hljs-string\">\"msg\"<\/span>: [\n        [\n            <span class=\"hljs-string\">\"\"#                          Congratulations!                            #\"\"<\/span>,\n            <span class=\"hljs-string\">\"\"#                     Your Algo server is running.                     #\"\"<\/span>,\n            <span class=\"hljs-string\">\"\"#    Config files and certificates are in the .\/configs\/ directory.    #\"\"<\/span>,\n            <span class=\"hljs-string\">\"\"#              Go to https:\/\/whoer.net\/ after connecting               #\"\"<\/span>,\n            <span class=\"hljs-string\">\"\"#        and ensure that all your traffic passes through the VPN.      #\"\"<\/span>,\n            <span class=\"hljs-string\">\"\"#          Local DNS resolver and Proxy IP address: 172.16.0.1         #\"\"<\/span>,\n            <span class=\"hljs-string\">\"\"<\/span>\n        ],\n        <span class=\"hljs-string\">\"    \"#                The p12 and SSH keys password is xxxxxxxxx             #\"n\"<\/span>,\n        <span class=\"hljs-string\">\"    \"<\/span>,\n        <span class=\"hljs-string\">\"    \"<\/span>\n    ]\n}\n<\/code><\/pre>\n<p>My initial hangup was with adding the VPN to Linux Mint's Network Manager, as even though I installed <code>strongswan<\/code> and <code>network-manager-strongswan<\/code>, it didn't appear in the Network Manager GUI. Apparently this is a <a href=\"https:\/\/wiki.strongswan.org\/issues\/1429\" target=\"_blank\" rel=\"noopener\">known bug<\/a> that's fixed in 1.4.x of the plugin.<\/p>\n<p>Thanks to this <a href=\"https:\/\/ubuntuforums.org\/showthread.php?t=2327303\" target=\"_blank\" rel=\"noopener\">Ubuntu Forums thread<\/a>, I realized it was time to build some packages from source.<\/p>\n<pre><code class=\"language-bash hljs\">wget http:\/\/download.strongswan.org\/strongswan-5.5.2.tar.bz2\ntar xjf strongswan-5.5.2.tar.bz2\n<span class=\"hljs-built_in\">cd<\/span> strongswan-5.5.2\n\n.\/configure \u2013sysconfdir=\/etc \u2013prefix=\/usr \u2013libexecdir=\/usr\/lib \n\u2013<span class=\"hljs-built_in\">disable<\/span>-aes \u2013<span class=\"hljs-built_in\">disable<\/span>-des \u2013<span class=\"hljs-built_in\">disable<\/span>-md5 \u2013<span class=\"hljs-built_in\">disable<\/span>-sha1 \u2013<span class=\"hljs-built_in\">disable<\/span>-sha2 \n\u2013<span class=\"hljs-built_in\">disable<\/span>-fips-prf \u2013<span class=\"hljs-built_in\">disable<\/span>-gmp \u2013<span class=\"hljs-built_in\">enable<\/span>-openssl \u2013<span class=\"hljs-built_in\">enable<\/span>-nm \u2013<span class=\"hljs-built_in\">enable<\/span>-agent \n\u2013<span class=\"hljs-built_in\">enable<\/span>-eap-gtc \u2013<span class=\"hljs-built_in\">enable<\/span>-eap-md5 \u2013<span class=\"hljs-built_in\">enable<\/span>-eap-mschapv2 \u2013<span class=\"hljs-built_in\">enable<\/span>-eap-identity\nmake\nmake install\n\nwget https:\/\/download.strongswan.org\/NetworkManager\/NetworkManager-strongswan-1.4.1.tar.bz2\ntar xjf NetworkManager-strongswan-1.x.x.tar.bz2\n<span class=\"hljs-built_in\">cd<\/span> NetworkManager-strongswan-1.x.x\n\n<span class=\"hljs-comment\"># build the NetworkManager strongsSwan plugin (if you changed prefix\/libexecdir above, set \u2013with-charon=\/path\/to\/charon-nm)<\/span>\n.\/configure \u2013sysconfdir=\/etc \u2013prefix=\/usr \u2013with-charon=\/usr\/lib\/ipsec\/charon-nm\nmake\nmake install\n<\/code><\/pre>\n<p>After all this, plus a few additional installations to get <code>strongswan<\/code> and its plugin to configure, I was able to configure the VPN via Network Manager. Almost there, right?<\/p>\n<p>Of course, it didn't work. Neither did installing the <code>.mobileconfig<\/code> on my macOS machine. I simply couldn't connect to the VPN, and as-is, Algo's documentation and troubleshooting details are a little <em>scarce<\/em>. A few GitHub issues seemed to suggest that while Algo could be <em>installed<\/em> on an Ubuntu 16.04 server, the same OS can't currently be used as a client.<\/p>\n<p>After about an hour of poking around, I gave up.<\/p>\n<h2>openvpn-install<\/h2>\n<p>I tried first with <a href=\"https:\/\/github.com\/Nyr\/openvpn-install\" target=\"_blank\" rel=\"noopener\">Nyr's script<\/a>, which I mentioned earlier, but had no luck with it whatsoever. I couldn't say exactly where the installation went wrong, but I was unable to connect to the VPN.<\/p>\n<p>Next up, a fork of Nyr's script from <a href=\"https:\/\/github.com\/Angristan\/OpenVPN-install\" target=\"_blank\" rel=\"noopener\">Angristan<\/a>, which purports to be an updated, more secure version of the original. I can get down with that. Installation was pretty simple. I made sure to enable TUN\/TAP before going any further\u2014Matt warned me that's where most VPN installations run afoul.<\/p>\n<pre><code class=\"language-bash hljs\">apt-get update\nwget https:\/\/raw.githubusercontent.com\/Angristan\/OpenVPN-install\/master\/openvpn-install.sh\nchmod +x openvpn-install.sh\n.\/openvpn-install.sh\n<\/code><\/pre>\n<p>I had an issue with the <code>openvpn<\/code> server service not running right off the bat, but I fixed that thanks to an <a href=\"http:\/\/askubuntu.com\/questions\/747023\/systemd-fails-to-start-openvpn-in-lxd-managed-16-04-container\" target=\"_blank\" rel=\"noopener\">Ask Ubuntu thread<\/a>. I commented out the <code>LimitNPROC<\/code> line in <a href=\"mailto:code&gt;\/lib\/systemd\/system\/openvpn@.service&lt;\/code\">code>\/lib\/systemd\/system\/openvpn@.service<\/code<\/a>, ran <code>systemctl daemon-reload<\/code>, and then <code>systemctl start openvpn@server<\/code>.<\/p>\n<p>The script spat out a user.ovpn file. I just needed to pipe the contents of that file onto my local machine.<\/p>\n<pre><code class=\"language-bash hljs\">ssh root@xxx.xx.xx.xxx <span class=\"hljs-string\">\"cat client.ovpn\"<\/span> &gt; client.ovpn\n<\/code><\/pre>\n<p>I imported that file into Network Manager and connected to the VPN immediately. Success!<\/p>\n<h2>The next steps<\/h2>\n<p>Do I feel more secure as I browse the web? I'm not sure. Do I feel accomplished? Somewhat.<\/p>\n<p>There's absolutely more to be done here\u2014perhaps in a future blog post:<\/p>\n<ol>\n<li>Figure out why Algo isn't working for me<\/li>\n<li>Harden the existing VPN server<\/li>\n<li>Figure out if I can install Tomato\/dd-wrt onto my router to route all traffic through the VPN, rather than install clients on every machine<\/li>\n<li>Investigate other solutions:\n<ul>\n<li><a href=\"https:\/\/www.lowendtalk.com\/discussion\/44964\/vpn-everywhere-ipsec-without-l2tp-with-strongswan-even-in-openvz\" target=\"_blank\" rel=\"noopener\">IPsec without L2TP with strongSwan<\/a><\/li>\n<li><a href=\"http:\/\/wiki.buyvm.net\/doku.php\/ipsec\" target=\"_blank\" rel=\"noopener\">Setting up an IPSEC tunnel<\/a><\/li>\n<li><a href=\"http:\/\/wiki.loopop.net\/doku.php?id=server:vpn:strongswanonopenvz\" target=\"_blank\" rel=\"noopener\">Pure IPSec VPN on OpenVZ<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>I suppose the entire point of this post, and all the work I put into it, is to prove how immature this little market is still. There's a growing demand for hosting VPNs via a VPS, but, thus far, all of the implementations are a little sticky\u2014experienced Linux administrators might not have many problems, but relative beginners like me are going to struggle. At best, we'll put together half-baked, probably-insecure implementations that <em>might<\/em> be better than going without a VPN.<\/p>\n<p>And that's the big question: Is doing <em>something<\/em>, however poorly implemented, better than nothing? Or could it possibly be worse? When I started writing this, I said that I was okay with failure. But now that my VPN is actually set up, I'm not quite so sure.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the last days of March, the U.S. government overturned rules aimed at protecting the privacy of users of internet service providers (ISP). With the rules gone, ISPs no longer need to obtain permission to sell user data. For a lot of people, that&#8217;s a little scary.<\/p>\n","protected":false},"author":20,"featured_media":117,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[18],"tags":[255],"class_list":["post-116","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","tag-vpn"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/comments?post=116"}],"version-history":[{"count":3,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/116\/revisions"}],"predecessor-version":[{"id":13014,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/116\/revisions\/13014"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media\/117"}],"wp:attachment":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media?parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/categories?post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/tags?post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}