<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by James Beedy on Medium]]></title>
        <description><![CDATA[Stories by James Beedy on Medium]]></description>
        <link>https://medium.com/@jamesbeedy?source=rss-1ba1eb15d15c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*TjFKlePVWk4H7lHx.</url>
            <title>Stories by James Beedy on Medium</title>
            <link>https://medium.com/@jamesbeedy?source=rss-1ba1eb15d15c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:11:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jamesbeedy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Multi-Gateway MicroCloud with LXD + PFSense + ExpressVPN]]></title>
            <link>https://medium.com/@jamesbeedy/multi-gateway-microcloud-with-lxd-pfsense-expressvpn-21a455cfc5d3?source=rss-1ba1eb15d15c------2</link>
            <guid isPermaLink="false">https://medium.com/p/21a455cfc5d3</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[pfsense]]></category>
            <category><![CDATA[vpn]]></category>
            <dc:creator><![CDATA[James Beedy]]></dc:creator>
            <pubDate>Fri, 09 Jun 2017 19:54:17 GMT</pubDate>
            <atom:updated>2017-06-09T21:19:20.798Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3UblZ6URBgi01wyt2Fb8ew.jpeg" /></figure><p>This tutorial will detail the process of creating multiple ExpressVPN clients on PFSense, and routing local traffic to a desired VPN connection based on simple traffic routing rules. For some icing on the cake, we will add LXD containers to the different vlans/address spaces, and show that the container’s egress traffic is routed to the appropriate gateway.</p><p>Aside: As much as this write up is technology centric e.g. “this is how it’s done with technology x, y, and z” (PFSense, Expressvpn, and LXD in our case), my goal is such that the general idea of what is going on behind the scenes here may serve as a jumping point for new types of VPN routing orchestration using container technologies and open source software. * A future post will detail how you can deploy the entire gig yourself, in a single command!</p><p>I subscribe to a service called <a href="https://expressvpn.com/">ExpressVPN</a> for my VPN needs. ExpressVPN offers a wide array of VPN servers across the globe to connect to. I’ve had excellent service, and great support from them over the years.</p><p>For a routing/firewall appliance I use a technology called PFSense, which sits at the top of my network stack (at home, and at work). PFSense is the most robust top of the stack network utility I know of. I couldn’t be more pleased with my experience.</p><p># The Problem</p><p>Despite the amazing tech, I seemed to be hitting my head for quite some time trying to interface the two technologies; I couldn’t for the life of me figure out how to create an ExpressVPN OpenVPN client interface on my PFSense box (I got really close many times I swear). I knew it was probably the client side “extra options” that were tripping me up, as I had the rest of the process dialed from what I could tell.</p><p>I wanted to connect my PFSense router/firewall to ExpressVPN as a client to route egress traffic at the top of the stack over the ExpressVPN connection, instead of having a multiple clients connecting separately to ExpressVPN from behind my firewall.</p><p># The Solution</p><p>After fumbling around for a while, I created a ticket with the ExpressVPN support team to “Support PFSense” (I did this via the in-site live chat, so I have no record of the exact date) — somewhere around a year ago.</p><p>Just last month, I was surprised to see a stream come across one of my feeds with the title “How to set up pfSense with ExpressVPN (OpenVPN)”.</p><p>This is exactly what I had been waiting for. An article had been posted in the <a href="https://www.expressvpn.com/support/vpn-setup/pfsense-with-expressvpn-openvpn/">ExpressVPN support documentation detailing the process needed to get PFSense connected to ExpressVPN as a client</a>! This was really exciting news to me, and sent me in to a bit of a networking frenzy. I immediately started creating ExpressVPN clients on my PFSense box, and testing methods of routing local traffic out different ExpressVPN/OpenVPN client interfaces.</p><p>The description below will explicate whats needed to start to *extend* this functionality once it’s already in place.</p><p># Lets Dig In</p><p>Aside: I will be using ovpn files from ExpressVPN, but the process we are about to divulge is generic in the sense that you could use your own VPN servers, and any box with a network stack as the client.</p><p>Ok, lets get started.</p><p>To follow this tutorial will need to have a <a href="https://pfsense.org/">PFSense</a> box provisioned, and a account with <a href="https://expressvpn.com/">ExpressVPN</a>.</p><p>Go ahead and familiarize yourself with the process of setting up ExpressVPN client interfaces on your PFSense box <a href="https://www.expressvpn.com/support/vpn-setup/pfsense-with-expressvpn-openvpn/">here</a>.</p><p>When you initially setup PFSense, you should have (at a minimum) a WAN and a LAN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*neVjPXCcUXlEfFtv8dKaNg.png" /></figure><p>After you have followed the ExpressVPN docs on adding OpenVPN client interfaces, you should have ≥ 1 OpenVPN client running, and OpenVPN client interface created. I’ve created two clients below, one connecting to a server in LasVegas, and the other in Seattle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XtgKA2xez7rxZ0lcTYDxRw.png" /></figure><p>You can see the corresponding interfaces created here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hVkh4G7KL6OHmhS6df_5sA.png" /></figure><p>and here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VSA1f3UpQvFIkDMJxuaNXg.png" /></figure><p>At this point, I have a client interface connected to a VPN in Seattle, and another interface connected to a VPN in Las Vegas. Time to create some VLANS on our LAN!</p><p>Use PFSense to add some VLANS on your lan interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FWvnYw-P1f7oUledSXQIWA.png" /></figure><p>Next, enable the VLAN interfaces as static interfaces in PFSense, assign the network address space you would like to use for the VLAN networks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cq5KVepNAlTju2KmRTRzPA.png" /></figure><p>Your PFSense interfaces should now resemble the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CAwZ8Wg48BOlrcO-CH0ZdQ.png" /></figure><p>We now have interfaces for our two ExpressVPN clients, our WAN, LAN, and the two VLANS created on the LAN.</p><p>For the purposes of this article, lets say we want all traffic originating from VLAN_200 to use the EXPRESSVPN_SEATTLE interface as its egress gateway, and similarly all traffic originating from VLAN_201 to use the EXPRESSVPN_LASVEGAS interfaces as its egress gateway.</p><p>Time to route some traffic!</p><p>I have (per the ExpressVPN tutorial) created the following outbound NAT routing in PFSense:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hG__9YwYBTcY_nAjoLaSgA.png" /></figure><p>And a rule for each interface specifying the gateway to use for the type of traffic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7LqNFZsvd0l6myw0FbR8Pg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-T0C5BME8WfTTxP5Z8jIDA.png" /></figure><p># Hooking Up LXD</p><p>I’ve plugged an Ubuntu 16.04 server in to my LAN (meaning it gets an ip address from the PFSense DHCP server in the 192.168.254.0/24 space). Following which I modified the /etc/network/interfaces file to create two VLAN interfaces off of the LAN interface (one for 200 and one for 201), and a bridge on each VLAN interface. This will allow us to spin up LXD instances connected to the bridges, to get them onto the respective VLAN.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f86384c816695baa444ba755ae5d947a/href">https://medium.com/media/f86384c816695baa444ba755ae5d947a/href</a></iframe><p>Now we need to create two lxd profiles, one that will add our LXD to lxdbr1 to get on the address space routing out the Seattle gateway via VLAN_200 (10.0.200.0/24), and another that will add our containers on to VLAN_201 address space via lxdbr2 (10.0.201.0/24), routing egress to the LasVegas gateway.</p><p>Lets create the two LXD profiles with the following commands:</p><pre>lxc profile create seattle</pre><pre>lxc profile create las-vegas</pre><p>Then edit each profile lxd profile edit &lt;profile-name&gt;, such that each each profile maps eth0 to the correct bridge on the correct VLAN.</p><p>Your LXD profiles should resemble the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/77d14bebeb38c6f210bbfae9a1461059/href">https://medium.com/media/77d14bebeb38c6f210bbfae9a1461059/href</a></iframe><p>Now lets launch a few LXD instances (specifying our profile with the -p), and make sure they get on the correct address space and gateway!</p><p>lxc launch ubuntu:16.04 las-vegas0 -p las-vegas</p><p>and</p><p>lxc launch ubuntu:16.04 seattle0 -p seattle</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c850cd0675a64ce97af53545d0bbdd67/href">https://medium.com/media/c850cd0675a64ce97af53545d0bbdd67/href</a></iframe><p>Here we see the two LXD instances have been added to the intended VLANS and address spaces. When the curl ipinfo.io command is issued to determine the public gateway from each LXD, we can see we got a different public gateway address in the response for each instance of the command being ran on each LXD, and a different gateway (my Comcast public ip) when the curl ipinfo.io command is ran from the host on the LAN.</p><p>This construct can be easily extended/modified to fit a number of different use cases that don’t necessarily entail forwarding your egress gateway somewhere crazy. Site-to-site VPN where you have multiple physical locations, is one mutation I can think of :)</p><p>You could go just about any direction from here, what would you do next?</p><p>~BDX</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21a455cfc5d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using JAAS to Deploy LXD Containers to Virtualbox VMS on OS X]]></title>
            <link>https://medium.com/@jamesbeedy/using-jaas-to-deploy-lxd-containers-to-virtualbox-vms-on-os-x-a06a8046756a?source=rss-1ba1eb15d15c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a06a8046756a</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[container-orchestration]]></category>
            <category><![CDATA[juju]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[James Beedy]]></dc:creator>
            <pubDate>Fri, 02 Jun 2017 04:28:37 GMT</pubDate>
            <atom:updated>2017-06-02T16:23:07.937Z</atom:updated>
            <content:encoded><![CDATA[<p>Canonical has a new service out called JAAS (Juju as a service), more information on JAAS<a href="https://jujucharms.com/jaas"> here</a>. In short, JAAS helps ease the process of deploying and maintaining multi-vendor production workloads at scale, and can also be used to facilitate the developer workflow as I will detail below.</p><p>I’ve recently found myself using JAAS for a lot of 1-off solutions that probably aren’t exactly *supported* use cases, but JAAS keeps popping up as what seems to be the simplest and most fitting solution so I’ve been going with it.</p><p>One such use case for JAAS is the “localhost dev” use case.</p><p>Using JAAS, developing Juju deployed applications on OS X couldn’t get easier!</p><p>I’ll give a quick overview here with a few steps that will get you up and running in a matter of minutes.</p><p>The setup workflow is as follows:</p><ol><li>Add a new JAAS model</li><li>Add the Virtualbox vm to the model</li><li>Deploy lxd-proxy to the vm using Juju</li><li>Deploy an application to a lxd container on the vm</li><li>Use the lxd-proxy “forward-traffic” action to add a PREROUTING rule to reach the application running on the lxd container through the VM from the OS X host</li></ol><p>So long as you are registered with JAAS, and have an Ubuntu 16.04 or later virtual machine running on your localhost that you can ssh into, you should be ready to get up and running with the following commands. For the purpose of this example we will use the lxd-proxy charm which can be found in the charmstore <a href="https://jujucharms.com/u/jamesbeedy/lxd-proxy/9">here</a> (lxd-proxy layer can be found on github <a href="https://github.com/jamesbeedy/layer-lxd-proxy">here</a>).</p><pre>$ juju add-model local-dev-osx aws/us-east-1</pre><pre>$ juju add-machine ssh:myuser@myvirtualboxvmip #(gets machine # 0)</pre><pre>$ juju deploy ubuntu vbox-host --to 0</pre><pre>$ juju deploy cs:~jamesbeedy/lxd-proxy-9</pre><pre>$ juju add-relation vbox-host lxd-proxy</pre><pre># Deploy any application to LXD on the virtual machine <br>$ juju deploy elasticsearch --to lxd:0 #(gets ip 10.0.0.119 on port 9200)</pre><pre># Forward the traffic from port 9000 on the vbox <br># vm to port 9200 on the elasticsearch LXD container<br>$ juju run-action lxd-proxy/0 forward-traffic \<br>    source-port=9000 dest-port=9200 host=10.0.0.119</pre><p>Now you can connect to the elasticsearch LXD via the local ip address of the virtualbox vm on port 9000. WOOHOO!</p><p>Moreover, this workflow is most useful when you need to iterate locally on Juju deployed applications. With a few slight modifications, you can make this paint for any picture by proxying to your own applications.</p><p>Lastly, JAAS is not a requirement here. This same process can be preformed using your own Juju controllers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a06a8046756a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>