<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex</title>
    <description>The latest articles on DEV Community by Alex (@afeiszli).</description>
    <link>https://dev.to/afeiszli</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F668905%2F1678fa06-55cb-4d6e-ae3f-f1f24d63951d.jpeg</url>
      <title>DEV Community: Alex</title>
      <link>https://dev.to/afeiszli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/afeiszli"/>
    <language>en</language>
    <item>
      <title>Tailscale vs WireGuard</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Mon, 07 Aug 2023 18:03:25 +0000</pubDate>
      <link>https://dev.to/afeiszli/tailscale-vs-wireguard-1plf</link>
      <guid>https://dev.to/afeiszli/tailscale-vs-wireguard-1plf</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;WireGuard is a next-gen, open source VPN protocol. It is easy to implement, provides extremely fast speeds, and has modern cryptography.&lt;/p&gt;

&lt;p&gt;Tailscale is a VPN service built on top of the WireGuard protocol. It provides secure networking for teams and individuals, allowing them to create a network amongst their devices across various platforms.&lt;/p&gt;

&lt;p&gt;In this article we’ll compare and contrast Tailscale and WireGuard, and introduce Netmaker, another VPN service built on WireGuard. Or, scroll to the bottom and get a side-by-side comparison of all three.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why WireGuard?
&lt;/h2&gt;

&lt;p&gt;For decades, businesses have relied on old, slow, but reliable VPN implementations like OpenVPN, IPsec, SSTP, and others. VPNs have tended to be clunky, and as such, businesses have started to migrate to new patterns like zero trust and SASE, that eliminate the VPN altogether.&lt;/p&gt;

&lt;p&gt;When WireGuard was released in 2020, it changed the value proposition of VPNs. It is so fast that it can be used for data-intensive workloads with minimal impact on performance. It is so efficient, it requires minimal processing power. It is so simple that a basic VPN between two machines can be set up in minutes. And it is an extremely secure implementation, using state-of-the art cryptography and symmetric key encryption. Not to mention, it is open source.&lt;/p&gt;

&lt;p&gt;This is why, for most IT administrators implementing a low-level VPN from scratch, WireGuard is really the only choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Tailscale?
&lt;/h2&gt;

&lt;p&gt;With all these advantages, WireGuard is still a low-level protocol. This is by design. Jason Donenfeld has stated that he wants to keep WireGuard small and simple, and prefers to let others build more complex tools and platforms on top of the protocol.&lt;/p&gt;

&lt;p&gt;Because of this, WireGuard lacks many of the features that users of more “standard” VPNs have become accustomed to. Things like user authentication, access controls, and a central server to manage the VPN. Enter Tailscale.&lt;/p&gt;

&lt;p&gt;Tailscale takes the WireGuard protocol and wraps it in their own client application. Users register with Tailscale, set up an account, and can enroll clients in a private network. Connections between devices are done using WireGuard, but Tailscale manages more advanced aspects like users and device discovery. Using Tailscale’s UI, users can set up advanced access controls for a whole organization, and shape their network accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of Tailscale over WireGuard
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Device Discovery:&lt;/strong&gt; With Tailscale, you simply use the Tailscale client to authenticate with your network, and then you are immediately given access to all the other devices in the network. With WireGuard, this would be a manual effort. You would need to modify all of the WireGuard clients in the network to account for the new machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Network Management:&lt;/strong&gt; Tailscale gives you a nice UI to log into, which allows you to view all of the devices in your network, and make configurations as necessary, which are automatically applied to the network. With WireGuard alone, this is again a manual effort. Any change to the network must be applied to each device individually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User Management:&lt;/strong&gt; Tailscale allows you to match devices to users, and use SSO to join a network. With WireGuard alone, there is no concept of “users”, just devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advanced Features:&lt;/strong&gt; There are many standard things a VPN administrator might like to do, which again are a manual process with pure WireGuard. Things like routing to an external network, private DNS, and access controls. All of these are included in Tailscale.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of WireGuard over Tailscale
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Cost:&lt;/strong&gt; While Tailscale offers a substantial free tier for personal use, using Tailscale in a business setting will not be free. Based on the setup, it could cost you $18 per user per month.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Ownership:&lt;/strong&gt; Tailscale is a SaaS platform, meaning your devices are registered to a 3rd party. While theoretically your data is fully encrypted and invisible to Tailscale, it can still be concerning to have your sensitive info on a 3rd party platform. Additionally, traffic will regularly route through Tailscale’s relay servers, rather than directly between your devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Low Level Configuration:&lt;/strong&gt; While WireGuard is fully customizable, there is no simple way to integrate Tailscale with a regular WireGuard network, or to customize a Tailscale interface as if it were a WireGuard interface. If you would like to create your own WireGuard interfaces, or manage a Tailscale device as if it were WireGuard, you’re probably out of luck. This will be frustrating to some users who wish to do some low-level tweaking of their device settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speed:&lt;/strong&gt; Lastly, Tailscale is slower than a pure WireGuard approach. Tailscale defaults to a non-kernel implementation of WireGuard, which has security benefits, but the tradeoff is speed. Also, your traffic is often routed through Tailscale’s relay servers, and some users have found this adds significant latency to their setups.&lt;/p&gt;

&lt;h2&gt;
  
  
  Netmaker
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.netmaker.io/"&gt;Netmaker&lt;/a&gt; is a third option which combines some of the more powerful features of Tailscale with a more native WireGuard approach. Like Tailscale, Netmaker offers user management, device management, advanced features, and a central UI / control plane for administrators. But Netmaker also has some additional advantages, for those who prefer pure WireGuard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages of Netmaker over Tailscale
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cost:&lt;/strong&gt; Netmaker has a completely free community version, and a paid SaaS version, which starts at just $1 per device per month.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data Ownership:&lt;/strong&gt; In addition to a SaaS offering, Netmaker allows you to “self host” the control plane and relay servers, giving you complete data ownership.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Low Level Configuration:&lt;/strong&gt; Netmaker has a “Client Gateway” feature, which allows you to generate and “hook in” pure WireGuard config files, meaning you can customize a WireGuard interface however you want, and integrate it into your network.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speed:&lt;/strong&gt; Netmaker defaults to kernel WireGuard, taking full advantage of WireGuard’s native speed benefits. You can see some speed tests &lt;a href="https://techoverflow.net/2022/08/19/iperf-benchmark-of-zerotier-vs-netmaker-vs-tailscale-vs-direct-switched-connection/"&gt;here&lt;/a&gt; and &lt;a href="https://www.netmaker.io/resources/battle-of-the-vpns-which-one-is-fastest-speed-test"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Limitations
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;User Management:&lt;/strong&gt; Netmaker’s user authentication and authorization is simple, and does not currently offer the level of control or integration that Tailscale offers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Client Application:&lt;/strong&gt; Netmaker’s client is available for Windows, Mac, Linux, and FreeBSD, but the Windows and Mac experience is much less polished than Tailscale. There is also currently no iOS or Android application, and users must use the standard WireGuard client to access a Netmaker network from their mobile devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Verdict
&lt;/h2&gt;

&lt;p&gt;Tailscale and WireGuard are both excellent solutions but cater to different needs. If you're looking for a simple, secure, and easy-to-use VPN for larger networks or teams, Tailscale is a fantastic choice. It removes much of the hassle associated with setting up and managing a VPN.&lt;/p&gt;

&lt;p&gt;On the other hand, if you need to perform low-level customizations, want complete control of your implementation, and do not want to pay, WireGuard is the way to go. It is also probably the best approach if you only have a few devices in your network, which will remain relatively static.&lt;/p&gt;

&lt;p&gt;Netmaker offers a healthy mix of both options, making it an excellent choice for users who want full WireGuard speed, data control, and a degree of customization, while still getting a management platform and client application to simplify their implementation.&lt;/p&gt;

&lt;p&gt;All of these options are secure, efficient, and modern VPN solutions. Your choice will depend on your specific requirements, technical expertise, and budget. By understanding the strengths and weaknesses of each, you can choose the right tool that aligns with your network needs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ButuIQmj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://uploads-ssl.webflow.com/64149f8bba6c132029e75004/64d38b95570ad1b8c7cefb4d_WireGuard-Tailscale-Netmaker-Comparison.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ButuIQmj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://uploads-ssl.webflow.com/64149f8bba6c132029e75004/64d38b95570ad1b8c7cefb4d_WireGuard-Tailscale-Netmaker-Comparison.png" alt="A comparison of Tailscale, WireGuard, and Netmaker" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vpn</category>
      <category>networking</category>
      <category>network</category>
      <category>security</category>
    </item>
    <item>
      <title>Tailscale vs ZeroTier</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Tue, 01 Aug 2023 12:18:16 +0000</pubDate>
      <link>https://dev.to/afeiszli/tailscale-vs-zerotier-1m79</link>
      <guid>https://dev.to/afeiszli/tailscale-vs-zerotier-1m79</guid>
      <description>&lt;p&gt;Businesses have migrated towards a “remote first” and “cloud first” posture. In this world, traditional corporate firewalls with physical routers and switches are going away. Additionally, the rise of IoT and Edge Computing has made networking more complex, with corporate devices often deployed in public networks.&lt;/p&gt;

&lt;p&gt;Companies have had to adapt. Traditional VPNs just don’t getting the job done, and new patterns like “zero trust” and SASE have taken their place. One alternative is the “mesh VPN” (Tailscale’s term) or “SD-WAN” (ZeroTier’s term), which bring the best of VPN’s and modern networking together to provide fast, point-to-point networks coupled with fine-grained access controls, giving businesses the best of both worlds.&lt;/p&gt;

&lt;p&gt;In this article we’ll compare and contrast Tailscale and ZeroTier, and introduce Netmaker, another comparable platform. Or, scroll to the bottom and get a side-by-side comparison of all three.&lt;/p&gt;

&lt;h1&gt;
  
  
  Overview
&lt;/h1&gt;

&lt;p&gt;Tailscale is a VPN service built on the WireGuard protocol. It provides secure networking for teams and individuals, allowing them to create a network amongst their devices across various platforms. Tailscale’s core advantage is its simplicity — A single user can hit the ground running in just minutes.&lt;/p&gt;

&lt;p&gt;ZeroTier is a VPN platform that uses their own custom protocol to connect devices securely across the internet. ZeroTier’s advanced network virtualization capabilities allow you to “treat the entire planet like one data center.”&lt;/p&gt;

&lt;h1&gt;
  
  
  Similarities
&lt;/h1&gt;

&lt;p&gt;At their core, ZeroTier and Tailscale are both very similar. Both are platforms that allow you to enroll and manage devices in a secure, peer-to-peer VPN network.&lt;/p&gt;

&lt;h3&gt;
  
  
  Endpoint Management
&lt;/h3&gt;

&lt;p&gt;‍Both Tailscale and ZeroTier give every device in your network a private IPv4 address, which is reachable from anywhere, simplifying network management and remote access to devices. Both platforms also let you edit and make changes to each device in your network.&lt;/p&gt;

&lt;h3&gt;
  
  
  Peer-to-Peer Networks
&lt;/h3&gt;

&lt;p&gt;‍ Both platforms also give you a peer-to-peer network by default, meaning every device has a direct connection to every other device, which is great for speed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Access Controls
&lt;/h3&gt;

&lt;p&gt;‍Both Tailscale and ZeroTier allow you to define policies that control the reachability of devices and the flow of traffic across your network.&lt;/p&gt;

&lt;h2&gt;
  
  
  Differences
&lt;/h2&gt;

&lt;p&gt;While ZeroTier and Tailscale are very similar, and can often be used to accomplish the same use cases, they do have some differences, both technical and non-technical, which could make the difference for some users.&lt;/p&gt;

&lt;h3&gt;
  
  
  Protocol
&lt;/h3&gt;

&lt;p&gt;‍Tailscale uses a userspace WireGuard protocol for its clients, while ZeroTier uses their own in-house protocol. Both are secure and performant, but there are advantages to using an “industry standard” like WireGuard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Self-Hosting
&lt;/h3&gt;

&lt;p&gt;Tailscale is a pure SaaS and you cannot “self-host” their control plane. Additionally, data will pass through their relay (DERP) servers fairly regularly. As a workaround, some users use Headscale, a project that lets you use Tailscale clients with a self-hosted server. ZeroTier has some self-hosting options, but you cannot use their UI if you do this, making it somewhat inconvenient, but still possible, to self-host.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pricing
&lt;/h3&gt;

&lt;p&gt;‍Both offer substantial free tiers, but ZeroTier prices by “node pack”, meaning you are buying the ability to deploy 25 nodes at a time, which is pretty simple to calculate. Tailscale meanwhile offers several “tiers” with different features, and charges per-user, with each user getting 10 or 20 devices included. Trying to figure out what you will end up paying is much more difficult for a Tailscale setup.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configurability and Ease-of-Use
&lt;/h3&gt;

&lt;p&gt;‍ZeroTier allows you to manage multiple networks, CIDR’s, IP’s, multicasting, and more. As mentioned above, you can also self-host portions of their platform which you cannot with Tailscale.&lt;/p&gt;

&lt;p&gt;Tailscale, meanwhile, is focused on a simple user experience. You don’t have as many options as ZeroTier, but it is much easier to use, especially for users with limited networking knowledge.&lt;/p&gt;

&lt;h3&gt;
  
  
  User Management
&lt;/h3&gt;

&lt;p&gt;‍Tailscale has a much more well-defined user management schema, and is more suited to the standard “corporate VPN” use case of end-user devices.&lt;/p&gt;

&lt;h3&gt;
  
  
  Device Management
&lt;/h3&gt;

&lt;p&gt;‍ZeroTier has more low-level configuration options, which make it better at integrating devices like servers and VM’s.&lt;/p&gt;

&lt;h1&gt;
  
  
  Netmaker
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://www.netmaker.io/" rel="noopener noreferrer"&gt;Netmaker&lt;/a&gt;  is a third option which combines some of the more powerful features of ZeroTier with the ability to run kernel WireGuard.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Protocol:&lt;/strong&gt;  Similar to Tailscale, Netmaker is based on WireGuard, which makes it cryptographically modern, standard, secure, and fast.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speed:&lt;/strong&gt;  Netmaker has shown to be faster than ZeroTier and Tailscale, due to its use of kernel WireGuard (Tailscale uses userspace WireGuard, which is slower). You can view two different speed tests  &lt;a href="https://techoverflow.net/2022/08/19/iperf-benchmark-of-zerotier-vs-netmaker-vs-tailscale-vs-direct-switched-connection/" rel="noopener noreferrer"&gt;here&lt;/a&gt;  and  &lt;a href="https://medium.com/netmaker/battle-of-the-vpns-which-one-is-fastest-speed-test-21ddc9cd50db" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flexibility:&lt;/strong&gt;  Netmaker is highly configurable. You can create your own relays, egress gateways, WireGuard gateways, and set up access controls to create many different types of networks besides the standard “mesh VPN.” You can also fully self-host Netmaker, unlike both Tailscale and ZeroTier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Price:&lt;/strong&gt;  Netmaker has a substantial free tier, and unlike both ZeroTier and Tailscale, who’s pricing can be confusing, the paid tier starts at just $1 per device, making it an easy usage-based calculation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Drawbacks
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;User Auth and Management:&lt;/strong&gt;  Netmaker’s user authentication and authorization is simple, and does not currently offer many of the integrations that some businesses may be looking for, such as session expiration and LDAP integration. Netmaker’s access controls are also on the device level, rather than the user level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Client Application:&lt;/strong&gt; Netmaker’s client is available for Windows, Mac, Linux, and FreeBSD, but the Windows and Mac experience is less polished than many user-centric VPN’s. There is also currently no iOS or Android application, and users must use the standard WireGuard client to access a Netmaker network from their mobile devices.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Verdict
&lt;/h1&gt;

&lt;p&gt;Tailscale and ZeroTier are excellent solutions but cater to different needs. If you’re looking for a simple, secure, and easy-to-use VPN for smaller networks or teams, Tailscale is a fantastic choice. It removes much of the hassle associated with setting up and managing a VPN.&lt;/p&gt;

&lt;p&gt;On the other hand, if you’re dealing with a more complex, device-centric network infrastructure, and WireGuard is not a priority, ZeroTier is your go-to option.&lt;/p&gt;

&lt;p&gt;Netmaker can offer additional configurability over both Tailscale and ZeroTier, as well as faster speeds, while using WireGuard under the hood, making it a great choice for users with device-centric networks needing WireGuard integration, or for users who need to host their own control plane.&lt;/p&gt;

&lt;p&gt;All of these options are secure, efficient, and modern VPN solutions. Your choice will depend on your specific requirements, technical expertise, and budget. By understanding the strengths and weaknesses of each, you can choose the right tool that aligns with your network needs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F07anxreedyabg5squybb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F07anxreedyabg5squybb.png"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vpn</category>
      <category>security</category>
      <category>design</category>
    </item>
    <item>
      <title>Remote Access VPN to Azure with WireGuard and Netmaker</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Thu, 20 Jul 2023 16:12:25 +0000</pubDate>
      <link>https://dev.to/afeiszli/remote-access-vpn-to-azure-with-wireguard-and-netmaker-27ho</link>
      <guid>https://dev.to/afeiszli/remote-access-vpn-to-azure-with-wireguard-and-netmaker-27ho</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;If you use Azure, you may deploy resources that you don’t want to expose publicly. For instnace, a Windows Server. In these scenarios, the resource will be contained in an Azure Virtual Network and Subnet. But how do you access these resources remotely from your devices?&lt;/p&gt;

&lt;p&gt;Azure has their own remote access VPN solution called “Azure VPN Gateway”. However, this can be unnecessarily expensive. With several users and endpoints, you can easily spend hundreds of dollars per month.&lt;/p&gt;

&lt;p&gt;Luckily, it is pretty easy to build an alternative to Azure VPN Gateway using WireGuard® and Netmaker for free. Follow these steps, and you should be up and running in about 30 minutes.&lt;/p&gt;

&lt;p&gt;By the end of this tutorial, you will have a gateway device running on Azure, which you can use to access your private Azure resources using a WireGuard VPN client.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scenario
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d3cfc3d833aa2cd74_1%2AzAXkMz0xhhfJqse9yMZbEQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d3cfc3d833aa2cd74_1%2AzAXkMz0xhhfJqse9yMZbEQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In our example scenario, we have Windows Server 2019 Datacenter running on Azure, which is only accessible via RDP over the Virtual Network subnet address (10.0.0.4). We want RDP access to the server using this address.&lt;/p&gt;

&lt;p&gt;For your setup, this could be any private IPs or subnets on Azure, as long they are accessible from the gateway device, which we will set up next.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d633573cf8930e97b_1%2Aw6KDvck79gasbcRHK5_4vw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d633573cf8930e97b_1%2Aw6KDvck79gasbcRHK5_4vw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588cbaa1d4667e5d4971_1%2AFeS-qac08Cqn91jR_jKBSQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588cbaa1d4667e5d4971_1%2AFeS-qac08Cqn91jR_jKBSQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Deploy the Gateway Device
&lt;/h2&gt;

&lt;p&gt;Deploy a device in Azure to act as your VPN gateway. We recommend using the latest Ubuntu on the smallest possible instance type, since it is not resource intensive. However, any linux distro or instance type should work.&lt;/p&gt;

&lt;p&gt;This device must have access to the target devices or subnets, so add it to the same subnet. Reminder, make sure the Inbound Port rules on the target device or subnet will allow traffic from the gateway device.&lt;/p&gt;

&lt;p&gt;Lastly, the device must be accessible over the WireGuard port, which by default for Netmaker is 51821, so open 51821/udp from Any source in the Inbound Port Rules (we’re doing 51821–51830/udp to be on the safe side), and make sure it has a Public IP Address.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d3ce1ff44e31ae738_1%2A8bVxbA3-Jj0OPZq4CwXLDQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d3ce1ff44e31ae738_1%2A8bVxbA3-Jj0OPZq4CwXLDQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gateway Device Requirements:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Device Type&lt;/strong&gt;: VM or Container (VM recommended)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OS&lt;/strong&gt;: Linux (Ubuntu 22.04 recommended)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size&lt;/strong&gt;: any
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Settings&lt;/strong&gt;: Must have a public IP, be a part of the virtual network, and expose 51821/udp publicly (as well as port 22 for SSH access)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 2: Add Gateway Device to Netmaker
&lt;/h2&gt;

&lt;p&gt;Now that you’ve deployed a suitable gateway device, you must add this device to Netmaker. You can &lt;a href="http://github.com/gravitl/netmaker" rel="noopener noreferrer"&gt;self-host Netmaker&lt;/a&gt;, but to get started quickly (and for free), simply sign up at &lt;a href="https://app.netmaker.io/" rel="noopener noreferrer"&gt;https://app.netmaker.io&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;By default, your account will have a virtual network named “netmaker” and an access key, also named “netmaker”. You should use these for the remainder of the tutorial, but note that in our example and screenshots these are named “azure-gw”.&lt;/p&gt;

&lt;p&gt;Click on the network, click on “hosts”, and then click the “Add a new host” button:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588cd5233e04278aaad1_1%2Aa2ga8VMeI7bVM1qqK5qE2Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588cd5233e04278aaad1_1%2Aa2ga8VMeI7bVM1qqK5qE2Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d1c8ab21a4ec5c9ff_1%2AhQVv9j1KxgD5S6APnbc8xg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d1c8ab21a4ec5c9ff_1%2AhQVv9j1KxgD5S6APnbc8xg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow the steps to add the gateway device to Netmaker: SSH to the device, download and installing the netclient, and joining the network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d65b9a4548e7b4b6b_1%2AZUGgdwiWWypIv-LCXMgWgw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d65b9a4548e7b4b6b_1%2AZUGgdwiWWypIv-LCXMgWgw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the device is visible in your “hosts” lists, you can continue to configure the device as a Gateway.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588db94d249358efbdb5_1%2A23YIyooBp4Zp6R_0SmN4bg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588db94d249358efbdb5_1%2A23YIyooBp4Zp6R_0SmN4bg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Configure Egress
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d39b205c5705b95ce_1%2AAxn6GO0fLxJ6BPG-0nzJhw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d39b205c5705b95ce_1%2AAxn6GO0fLxJ6BPG-0nzJhw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on “Egress” and then “Create Egress”. We will set the gateway device as an egress to the virtual network subnet range in Azure. However, we could just as easily set it to a single IP or list of IPs within the subnet.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588dcb671185431714a6_1%2A0dB5xe3fYH66UyTyAEi1jA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588dcb671185431714a6_1%2A0dB5xe3fYH66UyTyAEi1jA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588dfbce18a5dbcafd47_1%2AydZzsvgIhei_S8v1bagHCQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588dfbce18a5dbcafd47_1%2AydZzsvgIhei_S8v1bagHCQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Configure Client Gateway
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d32c706d5c87d985a_1%2A-aKmMgnH0_eq0VaQX9DZHw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d32c706d5c87d985a_1%2A-aKmMgnH0_eq0VaQX9DZHw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The last step is to provide remote access via a “Client Gateway”. The Client Gateway simply allows you to generate WireGuard config files, which are routed through the gateway device and into the network. So, after configuring, a user will be able to reach the Egress range via the Client Gateway.&lt;/p&gt;

&lt;p&gt;Our gateway device on Azure will act as both an “Egress Gateway”, to forward traffic to the private subnet, and a “Client Gateway”, so that it can accept traffic from WireGuard.&lt;/p&gt;

&lt;p&gt;Click on “Clients” and then “Create Client”. Since you do not have a Client Gateway yet, it will prompt you to select a device to act as the gateway, and will generate your first client (WireGuard config file) on top of this gateway.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d1c8ab21a4ec5cbcd_1%2A3pFj-NtDS1B67UrsLX3x3Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d1c8ab21a4ec5cbcd_1%2A3pFj-NtDS1B67UrsLX3x3Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can now download this config file, and run it using any standard WireGuard client.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d2fe5427c78c2cc50_1%2AEyit8KAHrcei9NsrBC1kCQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d2fe5427c78c2cc50_1%2AEyit8KAHrcei9NsrBC1kCQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(Click on the Client ID to view details)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d4cb076b1553f8768_1%2Ax2xChkBt74b787PIFqy4qQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588d4cb076b1553f8768_1%2Ax2xChkBt74b787PIFqy4qQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588e8d19f37bc81a00d0_1%2A7aCoS8nohKWHCySmu9fT5w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588e8d19f37bc81a00d0_1%2A7aCoS8nohKWHCySmu9fT5w.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If everything has gone correctly, you should now be able to RDP to the device using the private IP address:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588ed47b58e50a36316b_1%2AVYVf7IaVBRTDxgvQ7B61lw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b9588ed47b58e50a36316b_1%2AVYVf7IaVBRTDxgvQ7B61lw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can generate additional clients as necessary, so that your gateway provides access for a whole team.&lt;/p&gt;

&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;In this tutorial, we:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Configured Azure for a remote access gateway&lt;/li&gt;
&lt;li&gt; Configured an Azure VM instance to act as the remote access gateway&lt;/li&gt;
&lt;li&gt; Generated and ran a WireGuard config file locally, to access a private Windows server via the gateway&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There is much more you can do with Netmaker and WireGuard, so I hope this was a good first experience.&lt;/p&gt;

&lt;p&gt;If you have any questions or feedback, let me know in the comments!&lt;/p&gt;

</description>
      <category>azure</category>
      <category>vpn</category>
      <category>cloud</category>
      <category>devops</category>
    </item>
    <item>
      <title>Build your own Remote Access VPN to AWS with WireGuard and Netmaker</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Wed, 19 Jul 2023 15:18:31 +0000</pubDate>
      <link>https://dev.to/afeiszli/build-your-own-remote-access-vpn-to-aws-with-wireguard-and-netmaker-4ak4</link>
      <guid>https://dev.to/afeiszli/build-your-own-remote-access-vpn-to-aws-with-wireguard-and-netmaker-4ak4</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;An AWS account typically consists of multiple VPC’s and private subnets. You may wish to provide remote access to private subnets or endpoints on AWS without exposing them publicly.&lt;/p&gt;

&lt;p&gt;AWS has their own remote access VPN solution called “AWS Client VPN”. However, this can be unnecessarily expensive. With several users and endpoints, you can easily spend hundreds of dollars per month.&lt;/p&gt;

&lt;p&gt;Luckily, it is pretty easy to build your own solution using WireGuard® and Netmaker for free. Follow these steps, and you should be up and running in about 30 minutes.&lt;/p&gt;

&lt;p&gt;By the end of this tutorial, you will have a gateway device running on AWS, on which you can easily attach WireGuard clients to access private AWS resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c33321ff535ad19c7_1%2A6WlLRqap0jKzMMP7VLfsiw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c33321ff535ad19c7_1%2A6WlLRqap0jKzMMP7VLfsiw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In our example scenario, we have Rocket Chat running on AWS, which is only accessible over the VPC address (172.31.95.26). We want a developer to be able to log into Rocket Chat using this address.&lt;/p&gt;

&lt;p&gt;For your setup, this can be any private IPs or subnets on AWS, as long as the addresses are accessible from the gateway device (EC2 instance).&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 1: Deploy the Gateway Instance
&lt;/h2&gt;

&lt;p&gt;Select a device in AWS to act as your VPN gateway. This can be a container or EC2 instance, but must be linux-based. You can use an existing instance, but if deploying a new instance, we recommend using the latest Ubuntu (22.04 as of this writing). You can use t2.micro, as it is not resource intensive.&lt;/p&gt;

&lt;p&gt;This device must have access to the target devices or subnets, so make sure it is deployed in the correct availability zone, and that the target devices’ security settings allow traffic from the gateway device.&lt;/p&gt;

&lt;p&gt;Lastly, the device must be accessible publicly over the WireGuard port, which by default for Netmaker is 51821, so open 51821/udp to 0.0.0.0/0 in the Security settings, and make sure it has a publicly reachable IP (e.g. Elastic IP address).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gateway Requirements:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Device Type&lt;/strong&gt;: EC2 Instance or Container (EC2 Instance recommended)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OS&lt;/strong&gt;: Linux (Ubuntu 22.04 recommended)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size&lt;/strong&gt;: any (t2.micro recommended)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Settings&lt;/strong&gt;: Must have a public endpoint, and expose 51821/udp publicly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c2a2f5e94c96bfedb_1%2AmwPNjqNEHEAR0dki4VDGUg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c2a2f5e94c96bfedb_1%2AmwPNjqNEHEAR0dki4VDGUg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 2: Setup the Gateway with Netmaker
&lt;/h2&gt;

&lt;p&gt;Now that you’ve configured a suitable gateway device, you must add this device to Netmaker. You can &lt;a href="http://github.com/gravitl/netmaker" rel="noopener noreferrer"&gt;self-host Netmaker&lt;/a&gt;, but to get started quickly (and for free), simply sign up at &lt;a href="https://app.netmaker.io/" rel="noopener noreferrer"&gt;https://app.netmaker.io&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;By default, your account will have a virtual network named “netmaker” and an access key, also named “netmaker”. You should use these for the remainder of the tutorial, but note that in our example and screenshots these are named “rocket-chat”.&lt;/p&gt;

&lt;p&gt;Click on the network, click on “hosts”, and then click the “Add a new host” button:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0ca12bb657d9031477_1%2AZzpDhyBq8cgAaa_HX4gw3Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0ca12bb657d9031477_1%2AZzpDhyBq8cgAaa_HX4gw3Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c2a2f5e94c96bff36_1%2Ax663tMaHdQNHqgjxCnLkMw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c2a2f5e94c96bff36_1%2Ax663tMaHdQNHqgjxCnLkMw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Follow the steps to add the gateway device to Netmaker, by downloading and installing the netclient, and joining the network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c74191cdc8d4ba496_1%2AqbPB3jfrPBHhjrqGIJ0rOg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c74191cdc8d4ba496_1%2AqbPB3jfrPBHhjrqGIJ0rOg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the device is visible in your “hosts” lists, you can continue to configure the device as a Gateway.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 3: Configure Egress Gateway
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c20655fa9cbc78196_1%2AFB5KHkJen7wLPMwaR73QVA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c20655fa9cbc78196_1%2AFB5KHkJen7wLPMwaR73QVA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on “Egress” and then “Create Egress”. We will set the gateway device as an egress to the target IP address in AWS. In our example this is 172.31.95.26/32, but modify this as appropriate, providing multiple ranges if necessary.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c07336e430535adf1_1%2Ad0gC0O01HoxTCelW-VOnVw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c07336e430535adf1_1%2Ad0gC0O01HoxTCelW-VOnVw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The device is now prepared to serve traffic to the target destination.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 4: Configure the WireGuard Client Gateway
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c656a4ea63e8d4cd5_1%2AU3f90t7XAvnKxVAdEdp-3Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c656a4ea63e8d4cd5_1%2AU3f90t7XAvnKxVAdEdp-3Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The last step is to provide remote access via a “Client Gateway”. The Client Gateway simply allows you to generate WireGuard config files, which are routed through the gateway device and into the network. So, after configuring, a user will be able to reach the Egress range via the Client Gateway.&lt;/p&gt;

&lt;p&gt;Our device on AWS will act as both an “Egress Gateway” and a “Client Gateway”, so that it can accept traffic from WireGuard, and forward it to the private subnet.&lt;/p&gt;

&lt;p&gt;Click on “Clients” and then “Create Client”. Since you do not have a Client Gateway yet, it will prompt you to select a device to act as the gateway, and will generate your first client (WireGuard config file) on top of this gateway.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c105431ad51451108_1%2A2wKZwHFxUsmQV-tYquVouw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c105431ad51451108_1%2A2wKZwHFxUsmQV-tYquVouw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can now download this config file, and run it using any standard WireGuard client.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c45d54aca93eef362_1%2AcT63dYJVCmjcwSOA3MJFmw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c45d54aca93eef362_1%2AcT63dYJVCmjcwSOA3MJFmw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c691c1b5a0c0baec5_1%2At12GyFYU-8OvvztMh7C8vg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c691c1b5a0c0baec5_1%2At12GyFYU-8OvvztMh7C8vg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If everything has gone correctly, the private address should now be accessible from the local device:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c49a5ccb8efc27712_1%2AzVzDbf2MyWZynAEtIfB7Mw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuploads-ssl.webflow.com%2F64149f8bba6c132029e75004%2F64b7fc0c49a5ccb8efc27712_1%2AzVzDbf2MyWZynAEtIfB7Mw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Accessing the private Rocket Chat instance in the browser&lt;/p&gt;

&lt;p&gt;You can generate additional clients as necessary, so that your gateway provides access for a whole team.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Configured AWS for a remote access gateway&lt;/li&gt;
&lt;li&gt; Configured an EC2 instance to act as the remote access gateway&lt;/li&gt;
&lt;li&gt; Generated and ran a WireGuard config file locally, to access AWS via the gateway&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There is much more you can do with Netmaker and WireGuard, so I hope this was a good first experience. The above steps are also available as a click-through tutorial at the following link: &lt;a href="https://www.netmaker.io/tutorials#remote-access-gateway" rel="noopener noreferrer"&gt;https://www.netmaker.io/tutorials#remote-access-gateway&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any questions or feedback, let me know in the comments!&lt;/p&gt;

</description>
      <category>vpn</category>
      <category>aws</category>
      <category>devops</category>
      <category>security</category>
    </item>
    <item>
      <title>Netmaker - WireGuard Made Easy</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Tue, 18 Jul 2023 12:15:46 +0000</pubDate>
      <link>https://dev.to/afeiszli/netmaker-wireguard-made-easy-34gf</link>
      <guid>https://dev.to/afeiszli/netmaker-wireguard-made-easy-34gf</guid>
      <description>&lt;p&gt;If you've worked much in networking, you've probably heard of WireGuard®. If not, allow me to introduce it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.wireguard.com/"&gt;WireGuard&lt;/a&gt; is a VPN protocol developed several years ago which is exremely fast, lightweight, and uses state-of-the art cryptography. Its performance blows legacy VPN's out of the water.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j1nJXda1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2hug99tu3eac2ob2k6bz.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j1nJXda1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2hug99tu3eac2ob2k6bz.gif" alt="Shaq likes WireGuard" width="270" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A lot of people stumble upon WireGuard when they're looking to:&lt;br&gt;
a) Build their own VPN&lt;br&gt;
b) Set up remote access&lt;br&gt;
c) Build a site-to-site network&lt;/p&gt;

&lt;p&gt;The thing is, WireGuard can also be a little complicated to manage at scale. When you set up your network, you may find packets aren't going through, and you don't know why.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ef77OCb9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j5dite9e5slcwtkigcr1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ef77OCb9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j5dite9e5slcwtkigcr1.png" alt="Orangutan is confused by WireGuard" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It gets more complicated the more you have to do. Route traffic to a private network? Set up roaming? Get around a NAT or Firewall? Your number of open tabs starts to increase exponentially.&lt;/p&gt;

&lt;p&gt;Enter Netmaker.&lt;/p&gt;

&lt;p&gt;Netmaker is a VPN platform built on WireGuard®, that lets you create any sort of network you might be looking to set up. Remote access? Sure thing. Inter-VPC overlay network? No problem.&lt;/p&gt;

&lt;p&gt;Netmaker manages the hard parts of setting up a WireGuard network, including peer discovery, routing, key distribution, endpoint changes, and more.&lt;/p&gt;

&lt;p&gt;Netmaker is easy to get started with. You can &lt;a href="https://app.netmaker.io"&gt;sign up here for free&lt;/a&gt;, or, if you're into self-hosting, check out the &lt;a href="http://github.com/gravitl/netmaker"&gt;GitHub&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Then you're off to the races. &lt;a href="https://www.netmaker.io/tutorials#quick-start"&gt;Here's a tutorial to help get you started&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;In summary:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vGIWn1tq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yfm5bkqgiqnnqzyeq3ca.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vGIWn1tq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yfm5bkqgiqnnqzyeq3ca.png" alt="No more panik with Netmaker" width="580" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>vpn</category>
      <category>networking</category>
      <category>network</category>
    </item>
    <item>
      <title>How to Create Four Types of VPN’s Quickly with Wireguard® and Netmaker </title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Tue, 02 Nov 2021 16:26:14 +0000</pubDate>
      <link>https://dev.to/afeiszli/how-to-create-four-types-of-vpns-quickly-with-wireguardr-and-netmaker-1ibe</link>
      <guid>https://dev.to/afeiszli/how-to-create-four-types-of-vpns-quickly-with-wireguardr-and-netmaker-1ibe</guid>
      <description>&lt;p&gt;A VPN can be a lot of things. You might think you know what a VPN is…but do you really? A virtual private network just sends private traffic over a public network. But where is that traffic going, and for what purpose? After all, networks come in all shapes and sizes.&lt;/p&gt;

&lt;p&gt;In this two-part tutorial, we will discuss four “types” of VPN’s, which could just be considered use cases, and set them up with WireGuard® and &lt;a href="https://github.com/gravitl/netmaker" rel="noopener noreferrer"&gt;Netmaker&lt;/a&gt;, a free networking platform, in under 10 minutes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Personal (Private Browsing)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Remote Access&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Site-to-Site&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Mesh (virtual LAN/WAN)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;WireGuard® is a new and very fast VPN technology. Usually, VPN’s make your internet slower. With WireGuard®, the difference is negligible. Netmaker uses WireGuard® under the hood, and can simplify setting up environments from homelab to enterprise-scale.&lt;/p&gt;

&lt;p&gt;Let’s start by describing the 4 types of VPN’s. Then, we’ll set up a Netmaker server with a single command. Finally, we’ll go through each type of VPN and walk through a quick example setup. As a note, these tutorials expect some basic Linux skills. If you haven’t touched a terminal before, you may want to skip these.&lt;/p&gt;

&lt;p&gt;In part one, we’ll cover Personal and Remote Access VPN’s for home use. These use cases are pretty easy to set up. In part two, we’ll discuss Site-to-Site and Mesh VPN’s, which are much more complicated, and geared towards business use cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Four Types of VPN
&lt;/h2&gt;

&lt;p&gt;First, a disclaimer. A VPN can have many, many topologies. Here, we break it down into four rough “categories”, but keep in mind as we move through the tutorials that in reality, a VPN could take on many arbitrary designs. These are just some helpful and common ways to break it down.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;#1 - The Personal VPN (Private Browsing)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Most people are familiar with this type of VPN. If you’ve ever used a paid VPN service for your personal computer, it was probably this. This type of VPN is also actually a “Remote Access” VPN like in #2, but has a different purpose.&lt;/p&gt;

&lt;p&gt;How it works is, before any of your network traffic hits the internet, it is first encrypted and then routed through some company’s servers. This way, no one knows the source of the traffic, giving you some anonymity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ARHPfMdoQj_-irug4IJfbWg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ARHPfMdoQj_-irug4IJfbWg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;#2 - The Remote Access VPN&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Have you ever had to use a corporate VPN? If you’re working remote, like many people are in 2021, the answer is probably yes.&lt;/p&gt;

&lt;p&gt;This type of VPN is actually very similar to the “personal” VPN, with one key difference: rather than routing your traffic to the internet, the VPN “server” can route your traffic to the corporate network. However, it is very often &lt;em&gt;also&lt;/em&gt; routing your traffic for the general internet! That way, they can stop you from playing video games and browsing Reddit all day.&lt;/p&gt;

&lt;p&gt;By accessing the corporate network via the VPN, you can access company applications and services (HR, payroll, etc) that aren’t on the public internet.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AzZKh35_YDKNj-J6FqkdGQg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AzZKh35_YDKNj-J6FqkdGQg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;#3 - The Site-to-Site VPN&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Unless you work in network engineering, you’ve probably never encountered this one. Still, you’ve probably &lt;em&gt;experienced&lt;/em&gt; it without even knowing. Let’s say you have two offices, A and B. A and B need to talk to each other and share services, but they’re on different networks! Rather than expose all these services to the internet, they can set up a “Site-to-Site” VPN that bridges the two networks with a private link.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Abreo4oEZxz2aSoOD6MrGYg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Abreo4oEZxz2aSoOD6MrGYg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;#4 - The Mesh VPN (Virtual LAN/WAN)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This is currently one of the least common VPN’s because of its complexity, but it is growing in popularity. You will most likely encounter this if you work in advanced computing topics like multi-cloud, Kubernetes, or IoT. In a mesh VPN, every single device has a direct VPN connection to every other device. This can be useful for creating “flat” networks, where you don’t have to route traffic through other devices, which would increase latency or decrease security.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AdqDeVJWv2RntuK8aP-TYnQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AdqDeVJWv2RntuK8aP-TYnQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we’ve described the four use cases, let’s demonstrate them with four examples, using Netmaker and WireGuard®. In each example, we will set up a different VPN using the same Netmaker server, which can create and manage many networks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Personal: **We will set up a VPN, and use it to access **the internet&lt;/strong&gt; from our phone.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Remote Access: **We will set up a VPN, and use it to access **our&lt;/strong&gt; **home network **from our phone.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Site-to-Site:&lt;/strong&gt; We will set up a VPN, and use it to make a private subnet accessible from a cloud environment and vice-versa.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mesh:&lt;/strong&gt; We will set up a VPN, and connect VM’s in different clouds together so they can coordinate.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In part one, we will cover the first two examples, which are more relevant to individuals, and then in part two we’ll move on to site-to-site and mesh VPN’s, which are more relevant to organizations.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Getting Started: Deploy Netmaker&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A Netmaker server will manage our various networks. Netmaker is a platform for deploying and automating WireGuard-based networks. We’re going to be running the quick install. The instructions can also be found in the &lt;a href="https://github.com/gravitl/netmaker" rel="noopener noreferrer"&gt;README on GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To deploy Netmaker, you will need a cloud VM, or really any machine with a public IP. I’m using a $5/mo Digital Ocean Droplet (&lt;a href="https://m.do.co/c/496ffcf1e252" rel="noopener noreferrer"&gt;You can get $100 in free credit here&lt;/a&gt; using our referral code).&lt;/p&gt;

&lt;p&gt;We recommend deploying a Ubuntu 20.04 instance. It is most important that you remember to **open the firewall **for your VM, and configure security groups if necessary. The following ports must be open and reachable on the machine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;443 (TCP and UDP)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;53 (TCP and UDP)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;51821–51830 (UDP)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are using DigitalOcean, those ports will already be open. Once you’ve created a VM and opened the ports, deploying Netmaker is a breeze. Just run the following command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh root@yourhost
sudo wget -qO - https://raw.githubusercontent.com/gravitl/netmaker/develop/scripts/nm-quick.sh | bash -s -- -v true -c 10 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This command will install WireGuard® and some other local dependencies, deploy Netmaker, and configure Netmaker with **two networks: **A default (peer-to-peer) network, and a “VPN” network (this is what the options -v true -c 10 add).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do not clear the output&lt;/strong&gt;, which contains valuable information for configuring the network. You may want to save this in a text editor. Example output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;checking for root permissions...

setting flags...

checking for root permissions...

checking dependencies...

setting caddyfile...

setting docker-compose...

starting containers...visit dashboard.nm.148-188-172-168.nip.io to log in

creating default network (10.101.0.0/16)

creating default key

configuring netmaker server as ingress gateway

finished configuring server and network. You can now add clients.

**For Linux and Mac clients, install with the following command:**

curl -sfL https://raw.githubusercontent.com/gravitl/netmaker/develop/scripts/netclient-install.sh | sudo KEY=eyaJjbb3JcaiaaefI6IjE0N5y4xOa6aDeIeuMTcyaaLjaE2OCIsImFwaWNviJhcGkubm0uMTQ3LTE4Maefi0xNzItMTY4Lm5pcC5pbaDMiLCJhcGloba3NaefiYXBpLm5tLjEa0Ny0xODItMTsrgaBjd2dwb3J0IjoiIiwiZ3JwY3dncHViasrgiIiwiZ3JwaY3dnZW5kxfahiOiIaifQ== sh -

**For Windows clients, perform the following from powershell, as administrator:**

1. Make sure WireGuardNT is installed - https://download.wireguard.com/windows-client/wireguard-installer.exe

2. Download netclient.exe - wget https://github.com/gravitl/netmaker/releases/download/latest/netclient.exe

3. Install Netclient - powershell.exe .\netclient.exe join -t eyaJjbb3JcaiaaefI6IjE0N5y4xOa6aDeIeuMTcyaaLjaE2OCIsImFwaWNviJhcGkubm0uMTQ3LTE4Maefi0xNzItMTY4Lm5pcC5pbaDMiLCJhcGloba3NaefiYXBpLm5tLjEa0Ny0xODItMTsrgaBjd2dwb3J0IjoiIiwiZ3JwY3dncHViasrgiIiwiZ3JwaY3dnZW5kxfahiOiIaifQ==

4. Whitelist C:\ProgramData\Netclient in Windows Defender

**For Android and iOS clients, perform the following steps:**

1. Log into UI at dashboard.nm.147-182-172-168.nip.io

2. Navigate to "EXTERNAL CLIENTS" tab

3. Select the gateway and create clients

4. Scan the QR Code from WireGuard app in iOS or Android

Netmaker setup is now complete. You are ready to begin using Netmaker.

creating vpn network (10.201.0.0/16)

configuring netmaker server as vpn inlet...

configuring netmaker server vpn gateway...

creating client configs...

finished configuring vpn server.

**To configure clients, perform the following steps:**

**1. log into dashboard.nm.148-188-172-168.nip.io**

**2. Navigate to "EXTERNAL CLIENTS" tab**

**3. Download or scan a client config (vpnclient-x) to the appropriate device**

**4. Follow the steps for your system to configure WireGuard on the appropriate device**

**5. Create and delete clients as necessary. Changes to netmaker server settings require regenerating ext clients.**

**Netmaker setup is now complete. You are ready to begin using Netmaker.**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This last part (highlighted) is what we will use for our first VPN.&lt;/p&gt;

&lt;h2&gt;
  
  
  Personal (Private Browsing) VPN
&lt;/h2&gt;

&lt;p&gt;As we discussed earlier, a personal VPN allows you to browse the web with some anonymity. Typically, you pay a company to host the VPN for you. Here, we have just deployed our own VPN server, so we will use that instead.&lt;/p&gt;

&lt;p&gt;By running the Netmaker install script with the optional “-v true” command, Netmaker set up a Personal (Private Browsing) VPN for us. All we need to do is follow those last steps of output.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**To configure clients, perform the following steps:**

**1. log into dashboard.nm.148-188-172-168.nip.io**

**2. Navigate to "EXTERNAL CLIENTS" tab**

**3. Download or scan a client config (vpnclient-x) to the appropriate device**

**4. Follow the steps for your system to configure WireGuard on the appropriate device**

**5. Create and delete clients as necessary. Changes to netmaker server settings require regenerating ext clients.**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;1. Navigate to the dashboard and create an admin user.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2694%2F1%2Ao3OwsFCgk-HSfKSX-ynwbA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2694%2F1%2Ao3OwsFCgk-HSfKSX-ynwbA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Log in with your new admin user.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2652%2F1%2AIVjmrT7cDIgSPaKiZSbWAQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2652%2F1%2AIVjmrT7cDIgSPaKiZSbWAQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. You are taken to the home screen. Click on EXTERNAL CLIENTS in the upper right.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2572%2F1%2AjePd-SEJIn0cshzDLo4FZQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2572%2F1%2AjePd-SEJIn0cshzDLo4FZQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2502%2F1%2AFUx_4-5m5ecprrbrDzqglw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2502%2F1%2AFUx_4-5m5ecprrbrDzqglw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Configure Client:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Netmaker configured 10 VPN clients, which can be used to connect with WireGuard®. At this point, you need to decide which device(s) will use the VPN. These devices &lt;a href="https://www.wireguard.com/install/" rel="noopener noreferrer"&gt;need WireGuard installed&lt;/a&gt;. For our tutorial, I will be connecting from Mac, &lt;a href="https://apps.apple.com/us/app/wireguard/id1451685025?ls=1&amp;amp;mt=12" rel="noopener noreferrer"&gt;which means installing from the Apple store&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you have the app, open it, and click “Add Tunnel”. You can then click “Create from QR Code”, and scan the QR code of one of the clients (e.g., vpnclient-1.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Axd-o2XEGJsMtk8DK4d53_Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Axd-o2XEGJsMtk8DK4d53_Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A8Mpa385OXom7_rsSzyIiwg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A8Mpa385OXom7_rsSzyIiwg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Activate the tunnel and visit whatsmyip.org. You will see that your IP address is now the IP of the server. Congrats! You have set up your own personal VPN.&lt;/p&gt;

&lt;p&gt;Now, are you ready to take it to the next level?&lt;/p&gt;

&lt;h2&gt;
  
  
  Remote Access VPN
&lt;/h2&gt;

&lt;p&gt;Remember what we said about “Remote Access” VPN’s? Typically they are used to access a work environment. However, you probably don’t have access to configure your corporation’s network access controls. For this tutorial, let’s just assume you want to access your home network. It actually works quite similarly.&lt;/p&gt;

&lt;p&gt;For this, we need a “gateway” into our home network. That could be a router, or it could be a device on the network. Netmaker does not offer “official” support for routers yet (though it can be run on, for instance, OpenWRT), so we’re going to use a device on the network, namely, my personal computer.&lt;/p&gt;

&lt;p&gt;To create a gateway with Netmaker, we need the address range, and the local network interface to use. First, from my computer, I’ll check what networks I have access to:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;afeiszli@alex-sys76:~$ ip route

default via 192.168.40.1 dev wlo1 proto dhcp metric 600

**192.168.40.0/24 dev wlo1 proto kernel scope link src 192.168.40.75 metric 600**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Okay, so based on this, my local network is 192.168.40.0/24, and I access this network over the wlo1 interface. Now, time to install the netclient.&lt;/p&gt;

&lt;p&gt;If you recall from the install, two networks were created, default and VPN. We’re going to use the **default **network for this setup. In the output from the install, there was a section with instructions for installing on various devices:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**For Linux and Mac clients, install with the following command:**

curl -sfL https://raw.githubusercontent.com/gravitl/netmaker/develop/scripts/netclient-install.sh | sudo KEY=eyaJjbb3JcaiaaefI6IjE0N5y4xOa6aDeIeuMTcyaaLjaE2OCIsImFwaWNviJhcGkubm0uMTQ3LTE4Maefi0xNzItMTY4Lm5pcC5pbaDMiLCJhcGloba3NaefiYXBpLm5tLjEa0Ny0xODItMTsrgaBjd2dwb3J0IjoiIiwiZ3JwY3dncHViasrgiIiwiZ3JwaY3dnZW5kxfahiOiIaifQ== sh -

**For Windows clients, perform the following from powershell, as administrator:**

1. Make sure WireGuardNT is installed - https://download.wireguard.com/windows-client/wireguard-installer.exe

2. Download netclient.exe - wget https://github.com/gravitl/netmaker/releases/download/latest/netclient.exe

3. Install Netclient - powershell.exe .\netclient.exe join -t eyaJjbb3JcaiaaefI6IjE0N5y4xOa6aDeIeuMTcyaaLjaE2OCIsImFwaWNviJhcGkubm0uMTQ3LTE4Maefi0xNzItMTY4Lm5pcC5pbaDMiLCJhcGloba3NaefiYXBpLm5tLjEa0Ny0xODItMTsrgaBjd2dwb3J0IjoiIiwiZ3JwY3dncHViasrgiIiwiZ3JwaY3dnZW5kxfahiOiIaifQ==
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Keep in mind, a gateway can only be installed on Linux devices currently. Luckily, my computer runs Linux! So we just have to run that first command.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -sfL https://raw.githubusercontent.com/gravitl/netmaker/develop/scripts/netclient-install.sh | sudo KEY=xxxxxx sh -

checking dependencies...

wireguard

wireguard is installed

no $VERSION provided, fallback to latest

OS Version = Linux

Netclient Version = latest

Binary = netclient

2021/10/31 11:42:06 [netclient] node created on remote server...updating configs

2021/10/31 11:42:06 [netclient] retrieving peers

2021/10/31 11:42:07 [netclient] starting wireguard

2021/10/31 11:42:08 [netclient] joined default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Great! We’re now in the network. Going to the dashboard, we can now turn this machine into a gateway.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2458%2F1%2AgqIFQVW6QGKZzvhSMkwTdQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2458%2F1%2AgqIFQVW6QGKZzvhSMkwTdQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2606%2F1%2AHgCcfD4s0GyjZn-ha94qIw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2606%2F1%2AHgCcfD4s0GyjZn-ha94qIw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A small icon indicates that the machine is now a gateway:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AB9Lse7sn8_J4qnyhUztHVA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AB9Lse7sn8_J4qnyhUztHVA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, if I add a new machine that is outside of my home network, it will be able to access anything on that network. For instance, I’ve deployed a Wordpress site that lives on 192.168.40.30:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ArT3rSzqbXMrc3LehMFSp7Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ArT3rSzqbXMrc3LehMFSp7Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, how can I access this site from the road? Let’s use an External Client, just like we did for the personal VPN:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2342%2F1%2A-_JOl0WOFTFz8f5dCUXI5w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2342%2F1%2A-_JOl0WOFTFz8f5dCUXI5w.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We click the little plus button and confirm, and presto!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2594%2F1%2Aac5U7nGOk82rXBwv9_-s-g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2594%2F1%2Aac5U7nGOk82rXBwv9_-s-g.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, connect from your phone just like before (using the WireGuard® app), and…&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AiOZ7YAkZ63W--3NVwisUmg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AiOZ7YAkZ63W--3NVwisUmg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nice! I now have home network access from the road.&lt;/p&gt;

&lt;h2&gt;
  
  
  One More Thing
&lt;/h2&gt;

&lt;p&gt;We could have easily created the “home gateway” node on our “VPN” network, and have both in one! Secure access to our home network, and secure access to the internet. That’d be pretty great, right? If interested, I’m going to challenge you to set that up on your own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion / Part 2
&lt;/h2&gt;

&lt;p&gt;This concludes Part 1 of our tutorial on the four types of VPN’s. Subscribe to stay notified of part two, where we’ll cover how to configure a Site-to-Site virtual network, and a mesh VPN network. That really gets into some heavy networking stuff, and is meant for more advanced users. In the meantime, feel free to check out more examples for running Netmaker on our &lt;a href="https://gravitl.com/resources" rel="noopener noreferrer"&gt;Resources Page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;**Disclaimer:&lt;/em&gt;* &lt;a href="https://wireguard.com/" rel="noopener noreferrer"&gt;WireGuard&lt;/a&gt; is a registered trademark of Jason A. Donenfeld.*&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>tutorial</category>
      <category>linux</category>
      <category>security</category>
    </item>
    <item>
      <title>3 Reasons to Choose Wide k8s Clusters vs. Multi-Cluster</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Thu, 21 Oct 2021 18:57:21 +0000</pubDate>
      <link>https://dev.to/afeiszli/3-reasons-to-choose-wide-k8s-clusters-vs-multi-cluster-3ba8</link>
      <guid>https://dev.to/afeiszli/3-reasons-to-choose-wide-k8s-clusters-vs-multi-cluster-3ba8</guid>
      <description>&lt;p&gt;At this year's KubeCon, the buzz was all about distributed Kubernetes: Edge, Hybrid Cloud, and Multi-Cloud.&lt;/p&gt;

&lt;p&gt;For each of these topics there's an endless number of solutions: KubeEdge, OpenShift Edge, Akri, Baetyl, Kubermatic, Lens, Rancher, KubeFed, KubeSphere, Red Hat ACM, Liqo, Skupper, Linkerd, Fleet…&lt;/p&gt;

&lt;p&gt;…the list goes on and on and on and on and…you get the point.&lt;/p&gt;

&lt;p&gt;One thing not really discussed? You can run a single cluster across servers in different locations. You can skip the new tools and run a cluster like you normally would, but extended to new environments. Sounds like a no-brainer, right?&lt;/p&gt;

&lt;p&gt;This is called a "wide cluster" or "stretched cluster", and it's an alternative to the "multi-cluster" model that has been coming into popularity. Before we discuss why you might want to implement a wide cluster vs. a multi-cluster architecture, let's discuss some common concerns.&lt;/p&gt;

&lt;h3&gt;
  
  
  Latency
&lt;/h3&gt;

&lt;p&gt;Etcd (the Kubernetes "brain") is latency intolerant, so if your control plane nodes are too far apart, a wide cluster just plain wont work. You also don't usually want to introduce latency between worker nodes either  because, well, application performance. &lt;/p&gt;

&lt;p&gt;However, both problems can be easily solved in by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Co-locating Etcd nodes, or using a non-Ectd alternative (dqlite, anyone?)&lt;/li&gt;
&lt;li&gt;Applying node labels for locations and using node selectors for apps&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Security
&lt;/h3&gt;

&lt;p&gt;If you're running a single cluster between clouds, that likely means running inter-node traffic over a public network, which is scary. It can also be challenging, since you need to provide direct connectivity between all nodes. &lt;/p&gt;

&lt;p&gt;The solution here is a mesh VPN (no, not a service mesh).&lt;/p&gt;

&lt;p&gt;The VPN will encrypt all your traffic and provide a flexible subnet where all your nodes can communicate directly and securely.&lt;/p&gt;

&lt;p&gt;You may also  have special considerations around access controls. There are ways to manage access from a single cluster, but maybe you'd rather just have multiple clusters as your way of managing access. And that's ok, I won't judge you.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cloud Costs
&lt;/h3&gt;

&lt;p&gt;The number one reason you might need to avoid running a wide cluster is the cloud costs. Some certain, giant, cloud providers will charge you through the nose for data egress. If you're running worker nodes between such clouds and your data center, you're gonna pay for it. Still, as we'll discuss below, you may actually end up saving money with a wide cluster.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cloud Support
&lt;/h3&gt;

&lt;p&gt;Most cloud-hosted k8s options can't be easily extended to other locations, which makes sense, since cloud providers have every incentive to keep you in their cloud. If you're stuck running certain distributions, you may just be stuck.&lt;/p&gt;

&lt;h2&gt;
  
  
  So Why Run a Wide Cluster?
&lt;/h2&gt;

&lt;p&gt;We've discussed the concerns, some of which have easy answers and some of which are harder. With all that, here's why you might want to think about running a wide Kubernetes cluster as an alternative to a multi-cluster architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reason #1: No complicated tooling
&lt;/h2&gt;

&lt;p&gt;As discussed, there are a thousand tools for running multi-cluster, hybrid cloud, and edge computing with Kubernetes. &lt;/p&gt;

&lt;p&gt;A large portion of these tools and platforms require a whole new framework for app deployments which must be adopted across all of your clusters. That's a lot of learning, and a lot of dependency on a new tool. The solution might also require relying on a single k8s distribution or cloud provider.&lt;/p&gt;

&lt;p&gt;Alternatively, with the single, multi-cloud cluster approach, you can run your operations exactly as you would with a standard cluster. No new tools, and vastly simplified operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reason #2 : No extra overhead
&lt;/h2&gt;

&lt;p&gt;If you're running large, complex clusters, you probably have a lot of redundant components across all of them. Components to handle storage, networking, metrics, logging, images, pipelines, and more may need to be replicated across each and every cluster. That overhead adds up. &lt;/p&gt;

&lt;p&gt;In addition, each cluster needs its own control plane, and assuming they're all HA, that's 3+ additional nodes per cluster. Compute gets expensive.&lt;br&gt;
Compare this to a single, wide cluster, where there is one control plane and one set of services to support nodes in different clusters. You can add in special tooling as needed for particular environments, but you don't have to, which is a key distinction. &lt;/p&gt;

&lt;p&gt;This is why if you're hesitant because of egress data charges in your cloud, you might still want to weigh this against the cost of a multi-cluster infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reason #3: Ultimate Flexibility
&lt;/h2&gt;

&lt;p&gt;It's almost impossible to describe how flexible a cluster on a mesh VPN becomes. You have given it an extensible networking base from which to grow into new environments. A normal cluster will always be just that, a normal cluster occupying a subnet in a data center. &lt;/p&gt;

&lt;p&gt;Sure, you can put some tools on top to make it handle some more fancy operations, but the cluster itself is fundamentally limited to that location in the data center.&lt;/p&gt;

&lt;p&gt;On the other hand, a k8s cluster built on a mesh VPN can grow. It can expand to new locations. Its nodes can live in any location it needs to be. You can cloud burst into a new provider and remove all those nodes when they're no longer needed. The cluster can shift from place to place. The underlying infrastructure becomes incredibly malleable.&lt;/p&gt;

&lt;p&gt;This is why, even if you're running just a single cluster on a single cloud, you may still want to deploy it on a mesh VPN just in case that ever changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;This concludes my Ted Talk. We've discussed the pros and cons of a wide cluster on a mesh VPN vs. the standard multi-cluster architecture. I hope this at least sparks some ideas for you when planning your next Kubernetes deployment.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>cloud</category>
      <category>docker</category>
      <category>k8s</category>
    </item>
    <item>
      <title>How to Deploy a Cross-Cloud Kubernetes Cluster with Built In Disaster Recovery</title>
      <dc:creator>Alex</dc:creator>
      <pubDate>Sun, 18 Jul 2021 12:49:08 +0000</pubDate>
      <link>https://dev.to/afeiszli/how-to-deploy-a-cross-cloud-kubernetes-cluster-with-built-in-disaster-recovery-3h36</link>
      <guid>https://dev.to/afeiszli/how-to-deploy-a-cross-cloud-kubernetes-cluster-with-built-in-disaster-recovery-3h36</guid>
      <description>&lt;p&gt;This article explains how to run a single Kubernetes cluster that spans a hybrid cloud environment, making it resilient to failure. It will explain why this is necessary, and how to implement  this architecture using MicroK8s, WireGuard, and Netmaker. Okay, ready?&lt;/p&gt;




&lt;p&gt;Kubernetes is hard, but you know what’s even harder? Multi-cloud, multi-cluster Kubernetes, which is inevitably what you end up dealing with when running  Kubernetes in production. &lt;/p&gt;

&lt;p&gt;Typically you will deploy two clusters at a &lt;strong&gt;bare minimum&lt;/strong&gt; for any production setup: one as the live environment and one for failover (for disaster recovery). This may lead you to  wonder:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Why do I need two clusters to handle disaster recovery? I thought Kubernetes had a distributed architecture?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Correct! Kubernetes is distributed! It’s distributed inside of a single data center/region. Outside of that…not so much.&lt;/p&gt;

&lt;p&gt;To have a truly “high available” infrastructure, you’re going to need two clusters (or more), and on top of that you’re going to need some automation tools to move and copy applications between the clusters, along with some sort of mechanism to handle failover when a cluster goes down. Sounds like fun, right?&lt;/p&gt;

&lt;p&gt;Stick with me, and we’ll walk through a less painful way of handling disaster recovery (and hybrid workloads, for that matter), this time with a &lt;strong&gt;single cluster.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Distributed Cluster — MicroK8s and Netmaker
&lt;/h2&gt;

&lt;p&gt;There are three limitations that typically prevent using a single cluster across environments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Etcd:&lt;/strong&gt; It is the brain of your cluster and is not latency tolerant. Running it across geographically separated environments is problematic.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Networking:&lt;/strong&gt; Cluster nodes need to be able to talk to each other directly and securely.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Latency:&lt;/strong&gt; High latency is unacceptable for enterprise applications. If a microservice-based application spans multiple environments, you might end up with sub-optimal performance.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;We can solve all three problems with MicroK8s and Netmaker:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Etcd:&lt;/strong&gt; Etcd is the default datastore for Kubernetes, but it’s not the only option. MicroK8s runs Dqlite by default. Dqlite is latency tolerant, allowing you to run master nodes that are far apart without breaking your cluster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Networking:&lt;/strong&gt; Netmaker is easy to integrate with Kubernetes and creates flat, secure networks over WireGuard for nodes to talk over.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Latency:&lt;/strong&gt; Netmaker is one of the fastest virtual networking platforms available because it uses Kernel WireGuard, creating a negligible decrease in network performance (unlike options such as OpenVPN). In addition, we can use Kubernetes’ built-in placement policies to group applications together onto nodes in the same data center, eliminating the cross-cloud latency issue.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So now we have our answer. By running MicroK8s and Netmaker, you can eliminate complex, traditional, multi-cluster deployments.&lt;/p&gt;

&lt;p&gt;Enough talking, let’s put this into action!&lt;/p&gt;




&lt;h2&gt;
  
  
  Setting up our environment
&lt;/h2&gt;

&lt;p&gt;We’re going to use three environments. This ensures that if any one environment goes down, our masters can still form consensus. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;You’ll notice that we don’t differentiate between masters and workers going forward. That’s because in MicroK8s, every node has a copy of the control plane, so there really isn’t a distinction.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our Cluster Layout&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Data Center: **2 Nodes** (datacenter1, datacenter2)

DigitalOcean (region 1): **1 Node** (do1)

DigitalOcean (region 2): **1 Node** (do2)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We have two data center nodes and two cloud nodes which can be used in case of failover.&lt;/p&gt;

&lt;p&gt;We’re using DigitalOcean for our cloud nodes because they have the lowest bandwidth costs. Data transfer costs can add up real fast depending on your cloud provider. DigitalOcean’s bandwidth pricing is very reasonable and you should be able to run your cluster without incurring excess costs at all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;All of our nodes are running Ubuntu 20.04, and every node should have WireGuard installed before running this tutorial.&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt install wireguard wireguard-tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h2&gt;
  
  
  Node 1: The Seed
&lt;/h2&gt;

&lt;p&gt;SSH to your first node, which will act as the “seed” for your cluster, because it will setup Netmaker and establish the network which will run on the other nodes. This node should be &lt;strong&gt;publicly accessible&lt;/strong&gt; (We’re using &lt;strong&gt;do1&lt;/strong&gt;):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh root@do1
snap install microk8s --classic
microk8s enable dns ingress storage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;em&gt;You’ll note we’re using the built-in MicroK8s storage. For a production setup you will likely want something more robust like openebs, another MicroK8s plugin.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Next, make sure you have wildcard DNS set up to point towards this machine. for instance, in Route53 you can  create a record for *.kube.mydomain.com pointing to the public IP of this machine.&lt;/p&gt;

&lt;p&gt;After this is done, let’s set up some certs:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;microk8s kubectl create namespace cert-manager

microk8s kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.14.2/cert-manager.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Then create and apply the following clusterissuer.yaml, replacing the EMAIL_ADDRESS placeholder with your email:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
  name: letsencrypt-prod
  namespace: cert-manager
spec:
  acme:
    # The ACME server URL
    server: [https://acme-v02.api.letsencrypt.org/directory](https://acme-v02.api.letsencrypt.org/directory)
    # Email address used for ACME registration
    email: EMAIL_ADDRESS
    # Name of a secret used to store the ACME account private key
    privateKeySecretRef:
      name: letsencrypt-prod
    # Enable the HTTP-01 challenge provider
    solvers:
    - http01:
        ingress:
          class: public
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It will take a few minutes for the cert manager to become available, so this command will not succeed immediately after the above steps:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;microk8s kubectl apply -f clusterissuer.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now, we’re ready to deploy Netmaker. First, wget the template:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://raw.githubusercontent.com/gravitl/netmaker/develop/kube/netmaker-template.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Next, insert the domain you would like Netmaker to have. This must be a subdomain of the DNS you set up above, for instance, if your external load balancer is pointing to *.kube.mydomain.com, you might choose nm.kube.mydomain.com. The template will then add the following  subdomains on top: dashboard.nm.kube.mydomain.com, api.nm.kube.mydomain.com, and grpc.nm.kube.mydomain.com.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sed -i 's/NETMAKER_BASE_DOMAIN/&amp;lt;your base domain&amp;gt;/g' netmaker-template.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And now, install Netmaker!&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;microk8s kubectl create ns nm

microk8s kubectl config set-context --current --namespace=nm

microk8s kubectl apply -f netmaker-template.yaml -n nm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It will take about 3 minutes for all the pods to come up. Once they are up, go to the dashboard (“microk8s kubectl get ingress” to find the domain):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;microk8s kubectl get ingress nm-ui-ingress-nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Create a user and log in. You will see a default network:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3762%2F1%2ASJKRtdCUm1u7tDJ8XveXhQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3762%2F1%2ASJKRtdCUm1u7tDJ8XveXhQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Delete this (go to edit → delete) and create a new one, which we’ll call microk8s. Make sure the IP range does not overlap with microk8s. We’re giving ours 10.101.0.0/16:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3626%2F1%2AqNuJF2simvqwTUR08Xds8w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3626%2F1%2AqNuJF2simvqwTUR08Xds8w.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we need a key for our nodes to securely connect into this network. Click on “Access Keys,” generate a new key (give it a high number of uses, e.g. 1000), and click create. &lt;strong&gt;Make sure to copy and save  the value under Your Access Token. This will appear only once.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3704%2F1%2AmhmrwjcYlfFJtHuVx2gjzA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3704%2F1%2AmhmrwjcYlfFJtHuVx2gjzA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3720%2F1%2AGhcQmfCSDk-JFwx2ETvk7g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3720%2F1%2AGhcQmfCSDk-JFwx2ETvk7g.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is all we need to do inside the Netmaker server. Now we can set up our nodes with the &lt;strong&gt;netclient&lt;/strong&gt;, the agent that handles the networking on each machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But first, a MicroK8s caveat!&lt;/strong&gt; MicroK8s requires node hostnames to be reachable from each other in order to function properly. For instance, if you log into your machine and see root@mymachine, mymachine should be a resolvable address from the other machines. Netmaker will handle this, provided we set our hostnames correctly.&lt;/p&gt;

&lt;p&gt;Node hostnames should be of the format nodename.networkname. Since our nodes are on the microk8s network, every &lt;strong&gt;hostname must  be of the format .microk8s&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;On our “seed node”, let’s set the hostname to &lt;strong&gt;do1.microk8s&lt;/strong&gt;. That way we know it’s a Digital Ocean node.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hostnamectl set-hostname do1.microk8s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Okay, now we’re ready to deploy the netclient:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://github.com/gravitl/netmaker/releases/download/v0.5.11/netclient &amp;amp;&amp;amp; chmod +x netclient

./netclient join -t &amp;lt;YOUR_TOKEN&amp;gt; --dns off --daemon off --name $(hostname | sed -e s/.microk8s//)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You should now have the &lt;strong&gt;nm-microk8s&lt;/strong&gt; interface:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wg show

#example output
#interface: nm-microk8s
#  public key: AQViVk8J7JZkjlzsV/xFZKqmrQfNGkUygnJ/lU=
#  private key: (hidden)
#  listening port: 51821
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We could have deployed the netclient as a systemd daemon, but instead, we’ll use a cluster daemonset to manage our netclient. This allows us to handle network changes and upgrades using Kubernetes.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://raw.githubusercontent.com/gravitl/netmaker/develop/kube/netclient-template.yaml

sed -i 's/ACCESS_TOKEN_VALUE/&amp;lt; your access token value&amp;gt;/g' netclient-template.yaml

microk8s kubectl apply -f netclient-template.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This daemonset takes over management of the netclient and performs “check ins”. &lt;/p&gt;

&lt;p&gt;If everything has gone well, you should see logs somewhat like the following:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@do1:~# microk8s kubectl logs netclient-&amp;lt;id&amp;gt;
2021/07/13 17:11:16 attempting to join microk8s at grpc.nm.k8s.gravitl.com:443
2021/07/13 17:11:16 node created on remote server...updating configs
2021/07/13 17:11:16 retrieving remote peers
2021/07/13 17:11:16 starting wireguard
2021/07/13 17:11:16 joined microk8s
Checking into server at grpc.nm.k8s.gravitl.com:443
Checking to see if public addresses have changed
Local Address has changed from  to 210.97.150.30
Updating address
2021/07/13 17:11:16 using SSL
Authenticating with GRPC Server
Authenticated
Checking In.
Checked in.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The node should also now be visible in the UI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3728%2F1%2AZHXPPdFzR1sVjP0sI8xuGw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F3728%2F1%2AZHXPPdFzR1sVjP0sI8xuGw.png"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Nodes 2 through X
&lt;/h2&gt;

&lt;p&gt;For all subsequent nodes our task is straightforward. Run through these steps on each node (one at a time, not in parallel), and be patient: you don’t want to rush through the steps before any previous steps have had time to finish processing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;0. Change the Hostname&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On the joining node, run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hostnamectl set-hostname &amp;lt;nodename&amp;gt;.microk8s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Join the Network&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use the &lt;strong&gt;same commands and key&lt;/strong&gt; you used on the seed node to install the netclient and join the network:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://github.com/gravitl/netmaker/releases/download/v0.5.11/netclient &amp;amp;&amp;amp; chmod +x netclient

./netclient join -t &amp;lt;YOUR_TOKEN&amp;gt; --daemon off --dns off --name $(hostname | sed -e s/.microk8s//)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Confirm the node has joined the network with &lt;strong&gt;wg show&lt;/strong&gt;:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@datacenter2:~# wg show
interface: nm-microk8s
  public key: 2xUDmCohypHcCD5dZukhhA8r6BGWN879J8vIhrcwSHg=
  private key: (hidden)
  listening port: 51821

peer: lrZkcSzWdgasgegaimEYnrr5CgopcEAIP8m3Q1M7+hiM=
  endpoint: 192.168.88.151:51821
  allowed ips: 10.101.0.3/32
  latest handshake: 41 seconds ago
  transfer: 736 B received, 2.53 KiB sent
  persistent keepalive: every 20 seconds

peer: IUobp84wipq44aFGP0SLuRhdSsDWvcxvBFefeRCE=
  endpoint: 210.97.150.30:51821
  allowed ips: 10.101.0.1/32
  latest handshake: 57 seconds ago
  transfer: 128.45 MiB received, 9.03 MiB sent
  persistent keepalive: every 20 seconds
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2. Generate Join command&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On the “seed” node, run **microk8s add-node. **Copy the command containing the WireGuard IP Address created by Netmaker:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@do1:~# microk8s add-node
From the node you wish to join to this cluster, run the following:
microk8s join 209.97.147.27:25000/14e3a77f1584cb42323f39ce8ece0852/be5e4c7be0c6

If the node you are adding is not reachable through the default interface you can use one of the following:**
 microk8s join 210.97.150.27:25000/14e3a77f1584bc42323f39ce8ece0852/be5e4c7eb0c
microk8s join 10.17.0.5:25000/14e3a77f1584bc42323f39ce8ece0852/be5e4c7eb0c6
 microk8s join 10.108.0.2:25000/14e3a77f1584bc42323f39ce8ece0852/be5e4c7eb0c6
microk8s join 10.101.0.1:25000/14e3a77f1584bc42323f39ce8ece0852/be5e4c7eb0c6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;3. Join the Cluster&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On the joining node:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;microk8s join 10.101.0.1:25000/14e3a77f1584bc42323f39ce8ece0852/be5e4c7eb0c6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Wait for the node to join the network. Here are a few commands to run that will help you determine if the node is healthy:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;microk8s kubectl get nodes:&lt;/strong&gt; should show node in Ready state&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;microk8s kubectl get pods -A:&lt;/strong&gt; all pods should be running&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;microk8s logs netclient-:&lt;/strong&gt; get the logs of the netclient on this node&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Repeat steps 0 through 3 for each node you are adding to the cluster. Be patient. Wait for each node to join the network and  cluster before moving on to the next step/machine.&lt;/strong&gt;
&lt;/h2&gt;




&lt;p&gt;At the end of this process, your cluster and your Netmaker instance should look similar to this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@do1:~/kube# microk8s kubectl get nodes -o wide
NAME                   STATUS    VERSION   INTERNAL-IP   EXTERNAL-IP 
do2.microk8s           Ready     v1.21.1-3+ba   10.101.0.2   &amp;lt;none&amp;gt;        
datacenter1.microk8s   Ready     v1.21.1-3+ba   10.101.0.3    &amp;lt;none&amp;gt;        
do1.microk8s           Ready     v1.21.1-3+ba   10.101.0.1    &amp;lt;none&amp;gt;        
datacenter2.microk8s   Ready     v1.21.1-3+ba   10.101.0.4    &amp;lt;none&amp;gt;        
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2152%2F1%2A79YOOs4y13Kz_D_2GYOd0Q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2152%2F1%2A79YOOs4y13Kz_D_2GYOd0Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations! You have a cross-cloud Kubernetes cluster, one that will transfer workloads if an environment fails.&lt;/p&gt;




&lt;h2&gt;
  
  
  Testing for DR
&lt;/h2&gt;

&lt;p&gt;now that we’ve got our cluster set up, we can test out a DR scenario to see how it plays out. Let’s setup an application that runs in the data center. First, add some node labels so we know which node is which:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;microk8s kubectl label nodes do1.microk8s do2.microk8s location=cloud

microk8s kubectl label nodes datacenter1.microk8s datacenter2.microk8s location=onprem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now, we’ll deploy an Nginx application which lives in our data center:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://raw.githubusercontent.com/gravitl/netmaker/develop/kube/example/nginx-example.yaml

#BASE_DOMAIN should be your wildcard, ex: app.example.com

#template will add a subdomain, ex: nginx.app.example.com

sed -i 's/BASE_DOMAIN/&amp;lt;your base domain&amp;gt;/g' nginx-example.yaml

microk8s kubectl apply -f nginx-example.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Run a “get pods” to see that all instances are running in the data center. This is due to the “node affinity” label in the deployment. It has an affinity for nodes with the label &lt;strong&gt;location=onprem&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@do1:~# k get po -o wide | grep nginx
nginx-deployment-cb796dbc7-h72s8    1/1     Running   0          2m53s   10.1.99.68       datacenter1.microk8s   &amp;lt;none&amp;gt;           &amp;lt;none&amp;gt;
nginx-deployment-cb796dbc7-p5bhr    1/1     Running   0          2m53s   10.1.99.67       datacenter1.microk8s   &amp;lt;none&amp;gt;           &amp;lt;none&amp;gt;
nginx-deployment-cb796dbc7-pxpvw    1/1     Running   0          2m53s   10.1.247.3       datacenter2.microk8s   &amp;lt;none&amp;gt;           &amp;lt;none&amp;gt;
nginx-deployment-cb796dbc7-7vbwz    1/1     Running   0          2m53s   10.1.247.4       datacenter2.microk8s   &amp;lt;none&amp;gt;           &amp;lt;none&amp;gt;
nginx-deployment-cb796dbc7-x862w    1/1     Running   0          2m53s   10.1.247.5       datacenter2.microk8s   &amp;lt;none&amp;gt;           &amp;lt;none&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Going to the domain of the ingress, you should see the Nginx welcome screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AYGD0WXqb6ij1tpYVacHPHw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AYGD0WXqb6ij1tpYVacHPHw.png"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Simulating Failure
&lt;/h2&gt;

&lt;p&gt;Simulating failure is pretty easy in this scenario. Let’s just turn off the data center nodes:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@datacenter2:~# microk8s stop

root@datacenter1:~# microk8s stop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It will take a little while for the cluster to realize the nodes are missing. By default, Kubernetes will wait 5 minutes after a node is in “NotReady” state before it begins to reschedule the pods. &lt;/p&gt;

&lt;p&gt;For scenarios where uptime is ultra-critical, you can change the parameters to make this happen much faster. &lt;/p&gt;

&lt;p&gt;Check in on the node status:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@do2:~# k get nodes
NAME                   STATUS     ROLES    AGE    VERSION
do2.microk8s           Ready      &amp;lt;none&amp;gt;   77m    v1.21.1-3+ba118484dd39df
do1.microk8s           Ready      &amp;lt;none&amp;gt;   106m   v1.21.1-3+ba118484dd39df
datacenter1.microk8s   NotReady   &amp;lt;none&amp;gt;   62m    v1.21.1-3+ba118484dd39df
datacenter2.microk8s   NotReady   &amp;lt;none&amp;gt;   40m    v1.21.1-3+ba118484dd39df
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Eventually, you should see the old pods terminating and new pods scheduling on the cloud nodes:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2298%2F1%2AqpcMEDOn-7inSv3-qVdQfA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2298%2F1%2AqpcMEDOn-7inSv3-qVdQfA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And just like before, our webpage is intact:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AYGD0WXqb6ij1tpYVacHPHw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AYGD0WXqb6ij1tpYVacHPHw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, without multiple clusters or custom automation, we successfully set up a single cluster that will handle DR for us!&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;What did we learn here?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Scenarios such as DR historically required a multi-cluster deployment&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A multi-cluster model is not absolutely necessary&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can enable multi-cluster patterns with a single cluster&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enabling these patterns requires tools like MicroK8s and Netmaker&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are many other use cases this approach enables. For instance, you can burst an application into the cloud, deploy nodes to the edge, or access resources in a cloud environment using a single node. We lay out some of those patterns &lt;a href="https://itnext.io/8-use-cases-for-kubernetes-over-vpn-unlocking-multicloud-flexibility-3958dab2219f" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;There are also many pitfalls to consider when deploying this sort of system. The networking can get complicated, and we did not cover what can go wrong, how to fix it, or how to optimize this system.&lt;/p&gt;

&lt;p&gt;If you are interested in learning more, check out some of the resources below, or email &lt;a href="//mailto:info@gravitl.com"&gt;info@gravitl.com&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Resources&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/gravitl/netmaker" rel="noopener noreferrer"&gt;&lt;strong&gt;gravitl/netmaker&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://microk8s.io" rel="noopener noreferrer"&gt;&lt;strong&gt;MicroK8s&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gravitl.com/netmaker" rel="noopener noreferrer"&gt;https://gravitl.com/netmaker&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.wireguard.com/" rel="noopener noreferrer"&gt;https://www.wireguard.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>kubernetes</category>
      <category>docker</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
