{"id":8249,"date":"2019-01-17T01:18:25","date_gmt":"2019-01-17T01:18:25","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=8249"},"modified":"2019-03-08T01:50:35","modified_gmt":"2019-03-08T01:50:35","slug":"turn-a-raspberry-pi-3b-into-a-pritunl-vpn","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/01\/17\/turn-a-raspberry-pi-3b-into-a-pritunl-vpn\/","title":{"rendered":"Turn a Raspberry Pi 3B+ into a PriTunl VPN"},"content":{"rendered":"<div class=\"os-article__top\">\n<div class=\"os-article__top-inner\">\n<div class=\"panel-pane pane-entity-field pane-node-field-article-subhead\">\n<div class=\"field field-name-field-article-subhead field-type-text-long field-label-hidden\">\n<div class=\"field-items\">\n<h2>PriTunl is a VPN solution for small businesses and individuals who want private access to their network.<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"image-full-size\" style=\"font-size: 1rem;\" src=\"https:\/\/opensource.com\/sites\/default\/files\/styles\/image-full-size\/public\/lead-images\/life-raspberrypi_0.png?itok=Kczz87J2\" width=\"520\" height=\"292\" \/><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"os-article__image\">\n<div class=\"panel-pane pane-entity-field pane-file-field-file-image-caption\">\n<div class=\"field field-name-field-file-image-caption field-type-text-long field-label-inline clearfix\">\n<div class=\"field-label\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"os-article__middle\">\n<div class=\"panel-pane pane-entity-field pane-node-body\">\n<div class=\"field field-name-body field-type-text-with-summary field-label-hidden\">\n<div class=\"field-items\">\n<div class=\"field-item even\">\n<p><a href=\"https:\/\/pritunl.com\/\" target=\"_blank\" rel=\"noopener\">PriTunl<\/a>\u00a0is a fantastic VPN terminator solution that&#8217;s perfect for small businesses and individuals who want a quick and simple way to access their network privately. It&#8217;s open source, and the basic free version is more than enough to get you started and cover most simple use cases. There is also a paid enterprise version with advanced features like Active Directory integration.<\/p>\n<h2 id=\"special-considerations-with-pritunl-on-raspberry-pi-3b\">Special considerations on Raspberry Pi 3B+<\/h2>\n<p>PriTunl is generally simple to install, but this project\u2014turning a Raspberry Pi 3B+ into a PriTunl VPN appliance\u2014adds some complexity. For one thing, PriTunl is supplied only as AMD64 and i386 binaries, but the 3B+ uses ARM architecture. This means you must compile your own binaries from source. That&#8217;s nothing to be afraid of; it can be as simple as copying and pasting a few commands and watching the terminal for a short while.<\/p>\n<p>Another problem: PriTunl seems to require 64-bit architecture. I found this out when I got errors when I tried to compile PriTunl on my Raspberry Pi&#8217;s 32-bit operating system. Fortunately, Ubuntu&#8217;s beta version of 18.04 for ARM64 boots on the Raspberry Pi 3B+.<\/p>\n<p>Also, the Raspberry Pi 3B+ uses a different bootloader from other Raspberry Pi models. This required a complicated set of steps to install and update the necessary files to get a Raspberry Pi 3B+ to boot.<\/p>\n<h2 id=\"installing-pritunl\">Installing PriTunl<\/h2>\n<p>You can overcome these problems by installing a 64-bit operating system on the Raspberry Pi 3B+ before installing PriTunl. I&#8217;ll assume you have basic knowledge of how to get around the Linux command line and a Raspberry Pi.<\/p>\n<p>Start by opening a terminal and downloading the Ubuntu 18.04 ARM64 beta release by entering:<\/p>\n<pre><span class=\"geshifilter\"><code class=\"bash geshifilter-bash\"><span class=\"co4\">$\u00a0<\/span><span class=\"kw2\">wget<\/span>\u00a0http:<span class=\"sy0\">\/\/<\/span>cdimage.ubuntu.com<span class=\"sy0\">\/<\/span>releases<span class=\"sy0\">\/<\/span><span class=\"nu0\">18.04<\/span><span class=\"sy0\">\/<\/span>beta<span class=\"sy0\">\/<\/span>ubuntu-<span class=\"nu0\">18.04<\/span>-beta-preinstalled-server-arm64+raspi3.img.xz<\/code><\/span><\/pre>\n<p>Unpack the download:<\/p>\n<pre><span class=\"geshifilter\"><code class=\"bash geshifilter-bash\"><span class=\"co4\">$\u00a0<\/span>xz\u00a0<span class=\"re5\">-d<\/span>\u00a0ubuntu-<span class=\"nu0\">18.04<\/span>-beta-preinstalled-server-arm64+raspi3.xz<\/code><\/span><\/pre>\n<p>Insert the SD card you&#8217;ll use with your Raspberry Pi into your desktop or laptop computer. Your computer will assign the SD card a drive letter\u2014something like\u00a0<strong>\/dev\/sda<\/strong>\u00a0or\u00a0<strong>\/dev\/sdb<\/strong>. Enter the\u00a0<strong>dmesg<\/strong>\u00a0command and examine the last lines of the output to find out the card&#8217;s drive assignment.<\/p>\n<p><strong><em>Be VERY CAREFUL with the next step! I can&#8217;t stress that enough; if you get the drive assignment wrong, you could destroy your system.<\/em><\/strong><\/p>\n<p>Write the image to your SD card with the following command, changing\u00a0<strong>&lt;DRIVE&gt;<\/strong>\u00a0to your SD card&#8217;s drive assignment (obtained in the previous step):<\/p>\n<pre><span class=\"geshifilter\"><code class=\"bash geshifilter-bash\"><span class=\"co4\">$\u00a0<\/span><span class=\"kw2\">dd<\/span>\u00a0<span class=\"re2\">if<\/span>=ubuntu-<span class=\"nu0\">18.04<\/span>-beta-preinstalled-server-arm64+raspi3.img\u00a0<span class=\"re2\">of<\/span>=<span class=\"sy0\">&lt;<\/span>DRIVE<span class=\"sy0\">&gt;<\/span>\u00a0<span class=\"re2\">bs<\/span>=8M<\/code><\/span><\/pre>\n<p>After it finishes, insert the SD card into your Pi and power it up. Make sure the Pi is connected to your network, then log in with username\/password combination ubuntu\/ubuntu.<\/p>\n<p>Enter the following commands on your Pi to install a few things to prepare to compile PriTunl:<\/p>\n<pre><span class=\"geshifilter\"><code class=\"bash geshifilter-bash\"><span class=\"co4\">$\u00a0<\/span><span class=\"kw2\">sudo<\/span>\u00a0<span class=\"kw2\">apt-get<\/span>\u00a0<span class=\"re5\">-y<\/span>\u00a0<span class=\"kw2\">install<\/span>\u00a0build-essential\u00a0<span class=\"kw2\">git<\/span>\u00a0bzr python python-dev python-pip net-tools openvpn bridge-utils psmisc golang-go libffi-dev mongodb<\/code><\/span><\/pre>\n<p>There are a few changes from the standard PriTunl source\u00a0<a href=\"https:\/\/github.com\/pritunl\/pritunl\" target=\"_blank\" rel=\"noopener\">installation instructions on GitHub<\/a>. Make sure you are logged into your Pi and\u00a0<strong>sudo<\/strong>\u00a0to root:<\/p>\n<pre><span class=\"geshifilter\"><code class=\"bash geshifilter-bash\"><span class=\"co4\">$\u00a0<\/span><span class=\"kw2\">sudo<\/span>\u00a0<span class=\"kw2\">su<\/span>\u00a0-<\/code><\/span><\/pre>\n<p>This should leave you in root&#8217;s home directory. To install PriTunl version 1.29.1914.98, enter (per GitHub):<\/p>\n<div class=\"geshifilter\">\n<div class=\"bash geshifilter-bash\"><span class=\"kw3\">export<\/span>\u00a0<span class=\"re2\">VERSION<\/span>=1.29.1914.98<br \/>\n<span class=\"kw2\">tee<\/span>\u00a0<span class=\"re5\">-a<\/span>\u00a0~<span class=\"sy0\">\/<\/span>.bashrc\u00a0<span class=\"co2\">&lt;&lt; EOF<br \/>\nexport GOPATH=\\$HOME\/go<br \/>\nexport PATH=\/usr\/local\/go\/bin:\\$PATH<br \/>\nEOF<\/span><br \/>\n<span class=\"kw3\">source<\/span>\u00a0~<span class=\"sy0\">\/<\/span>.bashrc<br \/>\n<span class=\"kw2\">mkdir<\/span>\u00a0pritunl\u00a0<span class=\"sy0\">&amp;&amp;<\/span>\u00a0<span class=\"kw3\">cd<\/span>\u00a0pritunl<br \/>\ngo get\u00a0<span class=\"re5\">-u<\/span>\u00a0github.com<span class=\"sy0\">\/<\/span>pritunl<span class=\"sy0\">\/<\/span>pritunl-dns<br \/>\ngo get\u00a0<span class=\"re5\">-u<\/span>\u00a0github.com<span class=\"sy0\">\/<\/span>pritunl<span class=\"sy0\">\/<\/span>pritunl-web<br \/>\n<span class=\"kw2\">sudo<\/span>\u00a0<span class=\"kw2\">ln<\/span>\u00a0<span class=\"re5\">-s<\/span>\u00a0~<span class=\"sy0\">\/<\/span>go<span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span>pritunl-dns\u00a0<span class=\"sy0\">\/<\/span>usr<span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span>pritunl-dns<br \/>\n<span class=\"kw2\">sudo<\/span>\u00a0<span class=\"kw2\">ln<\/span>\u00a0<span class=\"re5\">-s<\/span>\u00a0~<span class=\"sy0\">\/<\/span>go<span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span>pritunl-web\u00a0<span class=\"sy0\">\/<\/span>usr<span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span>pritunl-web<br \/>\n<span class=\"kw2\">wget<\/span>\u00a0https:<span class=\"sy0\">\/\/<\/span>github.com<span class=\"sy0\">\/<\/span>pritunl<span class=\"sy0\">\/<\/span>pritunl<span class=\"sy0\">\/<\/span>archive<span class=\"sy0\">\/<\/span><span class=\"re1\">$VERSION<\/span>.tar.gz<br \/>\n<span class=\"kw2\">tar<\/span>\u00a0<span class=\"re5\">-xf<\/span>\u00a0<span class=\"re1\">$VERSION<\/span>.tar.gz<br \/>\n<span class=\"kw3\">cd<\/span>\u00a0pritunl-<span class=\"re1\">$VERSION<\/span><br \/>\npython2 setup.py build<br \/>\npip\u00a0<span class=\"kw2\">install<\/span>\u00a0<span class=\"re5\">-r<\/span>\u00a0requirements.txt<br \/>\npython2 setup.py\u00a0<span class=\"kw2\">install<\/span>\u00a0<span class=\"re5\">&#8211;prefix<\/span>=<span class=\"sy0\">\/<\/span>usr<span class=\"sy0\">\/<\/span><span class=\"kw3\">local<\/span><\/div>\n<\/div>\n<p>Now the MongoDB and PriTunl systemd units should be ready to start up. Assuming you&#8217;re still logged in as root, enter:<\/p>\n<div class=\"geshifilter\">\n<div class=\"bash geshifilter-bash\">systemctl daemon-reload<br \/>\nsystemctl start mongodb pritunl<br \/>\nsystemctl\u00a0<span class=\"kw3\">enable<\/span>\u00a0mongodb pritunl<\/div>\n<div><\/div>\n<\/div>\n<p>That&#8217;s it! You&#8217;re ready to hit PriTunl&#8217;s browser user interface and configure it by following PriTunl&#8217;s\u00a0<a href=\"https:\/\/docs.pritunl.com\/docs\/configuration-5\" target=\"_blank\" rel=\"noopener\">installation and configuration instructions<\/a>\u00a0on its website.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Related Stories:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.linuxtoday.com\/it_management\/2009123101335scswnt\">Networking with OpenVPN<\/a>(Jan 01, 2010)<\/li>\n<li><a href=\"https:\/\/www.linuxtoday.com\/security\/2008081801135psswnt\">OpenVPN Counters Censorship<\/a>(Aug 18, 2008)<\/li>\n<li><a href=\"https:\/\/www.linuxtoday.com\/infrastructure\/2004012701526rvsvsw\">OSNews: Introduction to OpenVPN<\/a>(Jan 27, 2004)<\/li>\n<li><a href=\"https:\/\/www.linuxtoday.com\/it_management\/2011022700235ossvnt\">Troubleshooting OpenVPN 2: Configurations<\/a>(Feb 27, 2011)<\/li>\n<li><a href=\"https:\/\/www.linuxtoday.com\/security\/2009022703235osswnt\">Virtual Private Network and OpenVPN<\/a>(Feb 28, 2009)<\/li>\n<li><a href=\"https:\/\/www.linuxtoday.com\/infrastructure\/2011061500341rvnt\">Install and Configure OpenVPN Server on Linux<\/a>(Jun 15, 2011)<\/li>\n<\/ul>\n<p><a href=\"http:\/\/www.linuxtoday.com\/security\/turn-a-raspberry-pi-3b-into-a-pritunl-vpn-190114085012.html\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PriTunl is a VPN solution for small businesses and individuals who want private access to their network. PriTunl\u00a0is a fantastic VPN terminator solution that&#8217;s perfect for small businesses and individuals who want a quick and simple way to access their network privately. It&#8217;s open source, and the basic free version is more than enough to &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/01\/17\/turn-a-raspberry-pi-3b-into-a-pritunl-vpn\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Turn a Raspberry Pi 3B+ into a PriTunl VPN&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8249","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/8249","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=8249"}],"version-history":[{"count":2,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/8249\/revisions"}],"predecessor-version":[{"id":10673,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/8249\/revisions\/10673"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=8249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=8249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=8249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}