{"id":1830,"date":"2018-05-11T00:24:28","date_gmt":"2018-05-10T18:54:28","guid":{"rendered":"https:\/\/judepereira.com\/blog\/?p=1830"},"modified":"2018-05-11T00:33:21","modified_gmt":"2018-05-10T19:03:21","slug":"ios-mac-ipsec","status":"publish","type":"post","link":"https:\/\/judepereira.com\/blog\/ios-mac-ipsec\/","title":{"rendered":"How to tunnel all traffic from your iOS device to your own server via IPSec"},"content":{"rendered":"<p><strong>TL;DR:<\/strong> A DigitalOcean droplet, strongSwan, and a custom Configuration Profile for iOS routes all the traffic from my iPhone via my droplet. Why? Just because I can.<\/p>\n<p><strong>Note:<\/strong> This setup <strong>does not<\/strong> require you to download Apple Configurator and switch your iPhone into Supervised mode (we will create a configuration profile by hand instead, and install it on the iPhone).<\/p>\n<h2>Configure strongSwan by following all the instructions <a href=\"https:\/\/www.vultr.com\/docs\/using-strongswan-for-ipsec-vpn-on-centos-7\" target=\"_blank\" rel=\"noopener\">here<\/a><\/h2>\n<ol>\n<li>Ignore the part about configuring the firewall, we&#8217;ll do this later<\/li>\n<li>Ensure strongswan starts on boot via chkconfig\n<pre><code class=\"language-bash\">chkconfig --add strongswan\r\nchkconfig strongswan on\r\n# Verify\r\nchkconfig --list strongswan<\/code><\/pre>\n<\/li>\n<li>You don&#8217;t need to install any certificates on your iPhone\/iPad\/Mac as we&#8217;re using a pre-shared key (PSK) instead of a certificate based client authentication mechanism<\/li>\n<\/ol>\n<h2>Allow traffic to be forwarded from your server by adding the two <em>iptables<\/em> rules <a href=\"https:\/\/wiki.strongswan.org\/projects\/strongswan\/wiki\/ForwardingAndSplitTunneling#Hosts-on-the-Internet\" target=\"_blank\" rel=\"noopener\">here<\/a><\/h2>\n<p>Be sure to modify the network in the two <em>iptables<\/em> commands (it should match the one specified in your strongSwan config)<\/p>\n<h2>Save the two rules which you&#8217;ve just added<\/h2>\n<pre><code class=\"language-bash\">service iptables save<\/code><\/pre>\n<h2>Open up UDP ports 500 and 4500 for your instance if required (AWS\/DigitalOcean\/etc)<\/h2>\n<p><a href=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32.png?ssl=1\" class=\"highslide-image\" onclick=\"return hs.expand(this);\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1832\" data-permalink=\"https:\/\/judepereira.com\/blog\/ios-mac-ipsec\/screen-shot-2018-05-10-at-20-34-32\/\" data-orig-file=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32.png?fit=2060%2C270&amp;ssl=1\" data-orig-size=\"2060,270\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"DigitalOcean&#8217;s Firewall\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32.png?fit=300%2C39&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32.png?fit=1024%2C134&amp;ssl=1\" class=\"aligncenter size-large wp-image-1832\" src=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32.png?resize=525%2C69&#038;ssl=1\" alt=\"\" width=\"525\" height=\"69\" srcset=\"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32.png?resize=1024%2C134&amp;ssl=1 1024w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32.png?resize=150%2C20&amp;ssl=1 150w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32.png?resize=300%2C39&amp;ssl=1 300w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32.png?resize=768%2C101&amp;ssl=1 768w, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2018-05-10-at-20.34.32.png?w=2000&amp;ssl=1 2000w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/a><\/p>\n<h2>Adapt the following Configuration Profile for your iOS device<\/h2>\n<style>.gist table { margin-bottom: 0; }<\/style>\n<div style=\"tab-size: 8\" id=\"gist89480654\" class=\"gist\">\n<div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n<div class=\"gist-data\">\n<div class=\"js-gist-file-update-container js-task-list-container\">\n<div id=\"file-vpnprofile-xml\" class=\"file my-2\">\n<div itemprop=\"text\"\n      class=\"Box-body p-0 blob-wrapper data type-xml  \"\n      style=\"overflow: auto\" tabindex=\"0\" role=\"region\"\n      aria-label=\"VPNProfile.xml content, created by judepereira on 02:02PM on May 10, 2018.\"\n    ><\/p>\n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n<p>  <template class=\"js-file-alert-template\"><\/p>\n<div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n    <span><br \/>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.<br \/>\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a><br \/>\n    <\/span><\/p>\n<div data-view-component=\"true\" class=\"flash-action\">        <a href=\"{{ revealButtonHref }}\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters<br \/>\n<\/a>\n<\/div>\n<\/div>\n<p><\/template><br \/>\n<template class=\"js-line-alert-template\"><br \/>\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\"><br \/>\n    <svg aria-hidden=\"true\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n<\/span><\/template><\/p>\n<table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"VPNProfile.xml\">\n<tr>\n<td id=\"file-vpnprofile-xml-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n<td id=\"file-vpnprofile-xml-LC1\" class=\"blob-code blob-code-inner js-file-line\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n<td id=\"file-vpnprofile-xml-LC2\" class=\"blob-code blob-code-inner js-file-line\">&lt;!DOCTYPE plist PUBLIC &quot;-\/\/Apple\/\/DTD PLIST 1.0\/\/EN&quot; &quot;http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd&quot;&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n<td id=\"file-vpnprofile-xml-LC3\" class=\"blob-code blob-code-inner js-file-line\">&lt;plist version=&quot;1.0&quot;&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n<td id=\"file-vpnprofile-xml-LC4\" class=\"blob-code blob-code-inner js-file-line\">&lt;dict&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n<td id=\"file-vpnprofile-xml-LC5\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;key&gt;PayloadContent&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n<td id=\"file-vpnprofile-xml-LC6\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;array&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L7\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n<td id=\"file-vpnprofile-xml-LC7\" class=\"blob-code blob-code-inner js-file-line\">\t\t&lt;dict&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L8\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n<td id=\"file-vpnprofile-xml-LC8\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;key&gt;UserDefinedName&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L9\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"9\"><\/td>\n<td id=\"file-vpnprofile-xml-LC9\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;string&gt;MY_PROFILE_NAME&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L10\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"10\"><\/td>\n<td id=\"file-vpnprofile-xml-LC10\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;key&gt;PayloadDisplayName&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L11\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"11\"><\/td>\n<td id=\"file-vpnprofile-xml-LC11\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;string&gt;MY_PROFILE_NAME&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L12\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"12\"><\/td>\n<td id=\"file-vpnprofile-xml-LC12\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;key&gt;PayloadIdentifier&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L13\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"13\"><\/td>\n<td id=\"file-vpnprofile-xml-LC13\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;string&gt;MY_DOMAIN.vpn.always&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L14\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"14\"><\/td>\n<td id=\"file-vpnprofile-xml-LC14\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;key&gt;PayloadUUID&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L15\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"15\"><\/td>\n<td id=\"file-vpnprofile-xml-LC15\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;string&gt;84590314-C064-4E06-85DB-B5F6B2B7C71F&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L16\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"16\"><\/td>\n<td id=\"file-vpnprofile-xml-LC16\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;key&gt;VPNType&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L17\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"17\"><\/td>\n<td id=\"file-vpnprofile-xml-LC17\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;string&gt;IPSec&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L18\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"18\"><\/td>\n<td id=\"file-vpnprofile-xml-LC18\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;key&gt;IPSec&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L19\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"19\"><\/td>\n<td id=\"file-vpnprofile-xml-LC19\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;dict&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L20\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"20\"><\/td>\n<td id=\"file-vpnprofile-xml-LC20\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;key&gt;RemoteAddress&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L21\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"21\"><\/td>\n<td id=\"file-vpnprofile-xml-LC21\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;string&gt;MY_STRONGSWAN_SERVER_IP_ADDRESS&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L22\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"22\"><\/td>\n<td id=\"file-vpnprofile-xml-LC22\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;key&gt;AuthenticationMethod&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L23\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"23\"><\/td>\n<td id=\"file-vpnprofile-xml-LC23\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;string&gt;SharedSecret&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L24\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"24\"><\/td>\n<td id=\"file-vpnprofile-xml-LC24\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;key&gt;XAuthEnabled&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L25\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"25\"><\/td>\n<td id=\"file-vpnprofile-xml-LC25\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;integer&gt;1&lt;\/integer&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L26\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"26\"><\/td>\n<td id=\"file-vpnprofile-xml-LC26\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;key&gt;XAuthName&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L27\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"27\"><\/td>\n<td id=\"file-vpnprofile-xml-LC27\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;string&gt;MY_ACCOUNT_NAME&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L28\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"28\"><\/td>\n<td id=\"file-vpnprofile-xml-LC28\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;key&gt;XAuthPassword&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L29\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"29\"><\/td>\n<td id=\"file-vpnprofile-xml-LC29\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;string&gt;MY_ACCOUNT_PASSWORD&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L30\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"30\"><\/td>\n<td id=\"file-vpnprofile-xml-LC30\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;key&gt;LocalIdentifierType&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L31\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"31\"><\/td>\n<td id=\"file-vpnprofile-xml-LC31\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;string&gt;KeyID&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L32\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"32\"><\/td>\n<td id=\"file-vpnprofile-xml-LC32\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;\/dict&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L33\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"33\"><\/td>\n<td id=\"file-vpnprofile-xml-LC33\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;key&gt;OnDemandEnabled&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L34\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"34\"><\/td>\n<td id=\"file-vpnprofile-xml-LC34\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;integer&gt;1&lt;\/integer&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L35\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"35\"><\/td>\n<td id=\"file-vpnprofile-xml-LC35\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;key&gt;OnDemandRules&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L36\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"36\"><\/td>\n<td id=\"file-vpnprofile-xml-LC36\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;array&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L37\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"37\"><\/td>\n<td id=\"file-vpnprofile-xml-LC37\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;dict&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L38\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"38\"><\/td>\n<td id=\"file-vpnprofile-xml-LC38\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t&lt;key&gt;Action&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L39\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"39\"><\/td>\n<td id=\"file-vpnprofile-xml-LC39\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t&lt;string&gt;Connect&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L40\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"40\"><\/td>\n<td id=\"file-vpnprofile-xml-LC40\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;\/dict&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L41\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"41\"><\/td>\n<td id=\"file-vpnprofile-xml-LC41\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;\/array&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L42\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"42\"><\/td>\n<td id=\"file-vpnprofile-xml-LC42\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;key&gt;OverridePrimary&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L43\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"43\"><\/td>\n<td id=\"file-vpnprofile-xml-LC43\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;true\/&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L44\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"44\"><\/td>\n<td id=\"file-vpnprofile-xml-LC44\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;key&gt;IPv4&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L45\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"45\"><\/td>\n<td id=\"file-vpnprofile-xml-LC45\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;dict&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L46\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"46\"><\/td>\n<td id=\"file-vpnprofile-xml-LC46\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;key&gt;OverridePrimary&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L47\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"47\"><\/td>\n<td id=\"file-vpnprofile-xml-LC47\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t&lt;integer&gt;1&lt;\/integer&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L48\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"48\"><\/td>\n<td id=\"file-vpnprofile-xml-LC48\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;\/dict&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L49\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"49\"><\/td>\n<td id=\"file-vpnprofile-xml-LC49\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;key&gt;PayloadType&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L50\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"50\"><\/td>\n<td id=\"file-vpnprofile-xml-LC50\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;string&gt;com.apple.vpn.managed&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L51\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"51\"><\/td>\n<td id=\"file-vpnprofile-xml-LC51\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;key&gt;PayloadVersion&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L52\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"52\"><\/td>\n<td id=\"file-vpnprofile-xml-LC52\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t&lt;integer&gt;1&lt;\/integer&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L53\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"53\"><\/td>\n<td id=\"file-vpnprofile-xml-LC53\" class=\"blob-code blob-code-inner js-file-line\">\t\t&lt;\/dict&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L54\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"54\"><\/td>\n<td id=\"file-vpnprofile-xml-LC54\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;\/array&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L55\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"55\"><\/td>\n<td id=\"file-vpnprofile-xml-LC55\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;key&gt;PayloadDisplayName&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L56\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"56\"><\/td>\n<td id=\"file-vpnprofile-xml-LC56\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;string&gt;VPN Configuration&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L57\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"57\"><\/td>\n<td id=\"file-vpnprofile-xml-LC57\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;key&gt;PayloadIdentifier&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L58\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"58\"><\/td>\n<td id=\"file-vpnprofile-xml-LC58\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;string&gt;MY_INITIALS.488B9D52-412A-458B-9701-92A5DA7CDA16&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L59\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"59\"><\/td>\n<td id=\"file-vpnprofile-xml-LC59\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;key&gt;PayloadRemovalDisallowed&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L60\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"60\"><\/td>\n<td id=\"file-vpnprofile-xml-LC60\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;false\/&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L61\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"61\"><\/td>\n<td id=\"file-vpnprofile-xml-LC61\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;key&gt;PayloadType&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L62\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"62\"><\/td>\n<td id=\"file-vpnprofile-xml-LC62\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;string&gt;Configuration&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L63\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"63\"><\/td>\n<td id=\"file-vpnprofile-xml-LC63\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;key&gt;PayloadUUID&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L64\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"64\"><\/td>\n<td id=\"file-vpnprofile-xml-LC64\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;string&gt;CF1A90EC-2A3E-4C88-B935-045C5882621D&lt;\/string&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L65\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"65\"><\/td>\n<td id=\"file-vpnprofile-xml-LC65\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;key&gt;PayloadVersion&lt;\/key&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L66\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"66\"><\/td>\n<td id=\"file-vpnprofile-xml-LC66\" class=\"blob-code blob-code-inner js-file-line\">\t&lt;integer&gt;1&lt;\/integer&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L67\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"67\"><\/td>\n<td id=\"file-vpnprofile-xml-LC67\" class=\"blob-code blob-code-inner js-file-line\">&lt;\/dict&gt;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-vpnprofile-xml-L68\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"68\"><\/td>\n<td id=\"file-vpnprofile-xml-LC68\" class=\"blob-code blob-code-inner js-file-line\">&lt;\/plist&gt;<\/td>\n<\/tr>\n<\/table>\n<\/div><\/div>\n<\/p><\/div>\n<\/div><\/div>\n<div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/judepereira\/64607167c67f823b7b478e6aa58cb3d3\/raw\/42d0593dfdd9d889f6523dbb95ee707f4fac4c7a\/VPNProfile.xml\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a><br \/>\n        <a href=\"https:\/\/gist.github.com\/judepereira\/64607167c67f823b7b478e6aa58cb3d3#file-vpnprofile-xml\" class=\"Link--inTextBlock\"><br \/>\n          VPNProfile.xml<br \/>\n        <\/a><br \/>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n<\/p><\/div>\n<\/div>\n<p>Replace the following variables with reasonable values for your setup:<\/p>\n<pre>MY_PROFILE_NAME                  - Only used for display purposes\r\nMY_DOMAIN                        - Just for scoping\r\nMY_STRONGSWAN_SERVER_IP_ADDRESS  - Your server's IPv4 address\r\nMY_ACCOUNT_NAME                  - See \/etc\/strongswan\/ipsec.secrets\r\nMY_ACCOUNT_PASSWORD              - See \/etc\/strongswan\/ipsec.secrets\r\nMY_INITIALS                      - Your initials (eg: JP)<\/pre>\n<p>Once you&#8217;ve updated the content of the XML file above, rename the file to <em>VPNConfig.mobileconfig<\/em>. Then, either AirDrop it to your iPhone\/iPad, or transfer it by some other means.<\/p>\n<p>Since we&#8217;re using a PSK, as soon as you install the profile, it&#8217;ll prompt you for the PSK. This can again be found in\u00a0<em>\/etc\/strongswan\/ipsec.secrets<\/em>.<\/p>\n<p>All done! :)<\/p>\n<p>Cheers on your newly established, always on VPN tunnel between your iOS device and your server!<\/p>\n<p>The Configuration Profile was inspired from Thomas&#8217;s blog post <a href=\"https:\/\/thomas-witt.com\/auto-connect-your-ios-device-to-a-vpn-when-joining-an-unknown-wifi-d1df8100c4ba\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>TL;DR: A DigitalOcean droplet, strongSwan, and a custom Configuration Profile for iOS routes all the traffic from my iPhone via my droplet. Why? Just because I can. Note: This setup does not require you to download Apple Configurator and switch your iPhone into Supervised mode (we will create a configuration profile by hand instead, and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[10],"tags":[532,613,617,616,252,614,615],"class_list":["post-1830","post","type-post","status-publish","format-standard","hentry","category-linux","tag-ios","tag-ipsec","tag-l2tp","tag-private","tag-security","tag-strongswan","tag-vpn"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pqtyx-tw","jetpack-related-posts":[{"id":1713,"url":"https:\/\/judepereira.com\/blog\/a-letter-to-tim-cook-regarding-ios-10-with-love-for-apple\/","url_meta":{"origin":1830,"position":0},"title":"A letter to Tim Cook regarding iOS 10, with love for Apple","author":"Jude Pereira","date":"June 17, 2016","format":false,"excerpt":"Tim, iOS has always been known for it's user interface, until recently. Your new take on notifications have not only made them very loud, and unsettling, but do not flow with the entire look and feel of Apple: No Mr. Tim, no. My notifications aren't waiting for me. They're crying\u2026","rel":"","context":"In &quot;life!&quot;","block_context":{"text":"life!","link":"https:\/\/judepereira.com\/blog\/category\/living-a-wonder\/"},"img":{"alt_text":"No Mr. Tim, no. My notifications will not be waiting for me. They're crying out for my attention.","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-06-17-at-08.49.59-614x1024.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-06-17-at-08.49.59-614x1024.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-06-17-at-08.49.59-614x1024.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":1635,"url":"https:\/\/judepereira.com\/blog\/discover-my-second-ios-app\/","url_meta":{"origin":1830,"position":1},"title":"Discover &#8211; my second iOS app","author":"Jude Pereira","date":"July 5, 2015","format":false,"excerpt":"iTunes Genius is a great feature. However, it lacks music discovery outside your own music library. Sure, you can always do a Google search for similar tunes, but let's face it - who has time to do this anymore? There weren't any great music discovery apps on the App Store\u2026","rel":"","context":"In &quot;ios&quot;","block_context":{"text":"ios","link":"https:\/\/judepereira.com\/blog\/category\/code\/ios\/"},"img":{"alt_text":"Highlights of Discover","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/feature-both-small.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/feature-both-small.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/feature-both-small.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/feature-both-small.png?resize=700%2C400 2x"},"classes":[]},{"id":1685,"url":"https:\/\/judepereira.com\/blog\/compile-less-on-the-fly-for-your-exploded-war-in-intellij\/","url_meta":{"origin":1830,"position":2},"title":"Compile LESS on the fly for your exploded WAR in IntelliJ","author":"Jude Pereira","date":"February 5, 2016","format":false,"excerpt":"At CleverTap, we've recently started using LESS for dynamic CSS. While it has it's upsides, the biggest downside\u00a0was that most of our developers couldn't use the hot deploy feature for their local deployments. After an hour or so, we came up with a neat solution. \u00a0 There are two parts\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"External Tool configuration for compiling LESS files before deployment","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/Screen-Shot-2016-02-05-at-01.32.45-1024x494.png?resize=525%2C300 1.5x"},"classes":[]},{"id":1675,"url":"https:\/\/judepereira.com\/blog\/sending-notifications-via-apples-new-http2-api-using-jetty-9-3-6\/","url_meta":{"origin":1830,"position":3},"title":"Sending notifications via Apple&#8217;s new HTTP\/2 API (using Jetty 9.3.6)","author":"Jude Pereira","date":"January 9, 2016","format":false,"excerpt":"HTTP\/2 is still very much new to Java, and as such, there are just two libraries who support it - Jetty (from 9.3), and Netty (in alpha). If you're going the Jetty way (as I have), you'll need to add their ALPN library to your boot classpath. Note: Jetty 9.3.x\u2026","rel":"","context":"In &quot;another snippet | code&quot;","block_context":{"text":"another snippet | code","link":"https:\/\/judepereira.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1778,"url":"https:\/\/judepereira.com\/blog\/letstuneup-a-music-chart-with-arjit-singh-in-the-lead\/","url_meta":{"origin":1830,"position":4},"title":"LetsTuneup: A music chart with Arjit Singh in the lead","author":"Jude Pereira","date":"April 28, 2017","format":false,"excerpt":"LetsTuneup has grown tremendously, and with it, we've introduced new features too. We identified that a few of our users couldn't use the app to it's full extent because they didn't have music on their devices. We've solved that. Users can now pick their favourite artists, powered by a location\u2026","rel":"","context":"In &quot;android&quot;","block_context":{"text":"android","link":"https:\/\/judepereira.com\/blog\/category\/code\/android\/"},"img":{"alt_text":"Arjit Singh in the lead, with Eminem, Linking Park, Coldplay and Pink Floyd following close","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/artists.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1734,"url":"https:\/\/judepereira.com\/blog\/why-matchbox-and-how-it-connects-people-through-music\/","url_meta":{"origin":1830,"position":5},"title":"Why Matchbox, and how it connects people through music","author":"Jude Pereira","date":"January 21, 2017","format":false,"excerpt":"There's no doubt that music defines us. It influences our moods, for example, making us happy by releasing a chemical named dopamine. It can affect what we wear, what we eat, and perhaps even who we enjoy being together with. It affects\u00a0our thought process too (it's well known that ambient\u2026","rel":"","context":"In &quot;android&quot;","block_context":{"text":"android","link":"https:\/\/judepereira.com\/blog\/category\/code\/android\/"},"img":{"alt_text":"Matchbox showing the top 10 artists","src":"https:\/\/i0.wp.com\/judepereira.com\/blog\/wp-content\/uploads\/IMG_7195-300x210.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1830","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/comments?post=1830"}],"version-history":[{"count":10,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1830\/revisions"}],"predecessor-version":[{"id":1843,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/posts\/1830\/revisions\/1843"}],"wp:attachment":[{"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/media?parent=1830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/categories?post=1830"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/judepereira.com\/blog\/wp-json\/wp\/v2\/tags?post=1830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}