Deploy an IPv6 Azure VM while setting up a Nym node
Tags: azure, nym, vm, ipv6
Published: 2021-07-19 16:38:18

---
title: Deploy an IPv6 Azure VM while setting up a Nym node
published: true
date: 2021-07-18 22:00:00 UTC
tags: Azure, nym, vm, ipv6
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/td7urzl8hd7yup37t5z8.jpg
canonical_url: https://robertohuertas.com/2021/07/19/ipv6-azure-vm-nym-node/
---

Learn how to deploy an Azure VM with IPv6 support while setting up a [Nym](https://nymtech.net/) node.

## A little bit of context

I’m lately looking into cool crypto projects, mainly because most of them make an extensive use of [Rust](https://www.rust-lang.org/) and that’s always and extra motivation for me :grin:.

One that has caught my attention is [Nym](https://nymtech.net/), which promises a **huge improvement** both in terms of **privacy and security** while we're using the internet. [It has recently raised $6M](https://techcrunch.com/2021/07/16/nym-gets-6m-for-its-anonymous-overlay-mixnet-to-sell-privacy-as-a-service/) so this not only shows that the project it's catching the attention of **many diverse investors** but also speaks of its capability to start growing and increasing its development pace.

Long story short, I was trying to set up a [Nym node](https://nymtech.net/docs/run-nym-nodes/) - as running a node in [Milhon](https://medium.com/nymtech/nym-v0-11-0-and-testnet-milhon-6ed9c800f889) (their next version of the Testnet) will only be open to those who have run a node in [Finney](https://medium.com/nymtech/nym-version-0-10-0-and-testnet-finney-fb696a157e02) (their current version of the Testnet) - and thought of doing that in [Azure](https://azure.microsoft.com/).

I read the [Nym docs](https://nymtech.net/docs/run-nym-nodes/) and all seemed pretty straightforward. What could go wrong? It seems that for the `Nym` node to work ok, [it has to have an `IPv6` address](https://nymtech.net/docs/run-nym-nodes/troubleshooting/#no-ipv6-connectivity) and [Azure](https://azure.microsoft.com/) was not going to let me walk away so easily…

## TL;DR;

> Setting up `IPv6` in an Azure VM **cannot be done** by using the `Portal`. It’s also **impossible to set it up in an already existing VM**.

Here you are a [link to the official Azure docs]((https://nymtech.net/docs/run-nym-nodes/)).

## The steps to create an IPv6 VM

You could do all this via your command line but I will show you how I used the [Azure Portal](https://portal.azure.com/) for everything except the VM creation.

These are the different steps:

- [Create a couple of public IP addresses](#create-a-couple-of-public-ip-addresses)
- [Create a Virtual Network](#create-a-virtual-network)
- [Create a Network Interface](#create-a-network-interface)
- [Create a Network Security Group](#create-a-network-security-group)
- [Create the VM](#create-the-vm)

### Create a couple of public IP addresses

Let’s create a couple of [public IP addresses](https://docs.microsoft.com/en-us/azure/virtual-network/public-ip-addresses), IPv4 and IPv6, respectively. We can create them both at the same time, which is cool as it will save us some time.

Let’s select the option in the [Azure Portal](https://portal.azure.com/) and just click `Create`.

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-public-ip_01.png)

Select `Both` in the first option and just fill in the names of your IPs.

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-public-ip_02.png)

Then, just click `Create` and in a couple of seconds you’ll have your two new shiny IPs.

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-public-ip_03.png)

### Create a Virtual Network

Next, we will create a [Virtual Network](https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-overview) which is the fundamental building block for your private network in Azure.

Similar to what we did in the previous section, we look for the `virtual network` option and click over the `Create` button:

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-virtual-network_01.png)

Then, we just have to go through the different tabs, setting the name of the virtual network,

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-virtual-network_02.png)

and then configuring the IP addresses in there. Be sure to select the `Add IPv6 address space` checkbox:

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-virtual-network_03.png)

You’ll notice there’s a warning message stating that `subnets should have at least one IPv6 address range`. Let’s click over the `default` subnet name and a sidebar will open.

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-virtual-network_04.png)

This time, tick the `Add IPv6 address space` checkbox, fill the IPv6 range, and click the `Save` button. You’ll notice that the previous warning is gone and you’ll be able to follow the process. Click `Next` and finally `Create`the virtual network.

### Create a Network Interface

Now, it’s time for us to [create a Network Interface](https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface).

As you may probably guess by now, we’re going to look for the `network interface` option and click over the `Create` button:

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-network-interface_01.png)

You’ll find a form that you’ll have to fill.

Give a name to the `network interface` and tick the `Private IP address (IPv6)` checkbox before creating the resource.

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-network-interface_02.png)

Once you have created it, go the resource and select the `IP configurations` option in the left side menu. You’ll see a screen similar to the one below:

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-network-interface_03.png)

Let’s configure our IPs. Click over the `Primary` ip configuration, and make the appropriate selections. Once you select `Associate` in the `Public IP address` option you’ll be able to see a list with the IPs we created before. Select the IPv4 one.

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-network-interface_04.png)

Now, we will do the same for the `Secondary` ip configuration, the IPv6 one.

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-network-interface_05.png)

Finally, let’s select `Properties` in the left side menu and copy the `Resource ID`. We’ll need it later in order to create our VM.

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-network-interface_06.png)

### Create a Network Security Group

You can also create a [Network Security Group](https://docs.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview) and set it up in the `Network Interface` so you can filter which ports are opened to the internet.

The process if fairly straightforward.

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-network-security-group_01.png)

You just have to give it a name and create it.

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-network-security-group_02.png)

Then, go to our `Network interface` (_nym-nic_) and select the `Network Security Group` option in the right side menu.

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-network-security-group_03.png)

### Create the VM

In order to create the VM we will use the [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/).

Go to your command line and type:

```sh
az login

```

Once you are logged in, we’re going to create the VM by using this instruction.

```sh
az vm create --resource-group nym-node-burn --name nym --image UbuntuLTS --admin-username robertohuertasm --admin-password hZRAAJpjkwZ4KW --nics "/subscriptions/e3871cc7-3444-42ad-b4b8-5ee6bdbf6d54/resourceGroups/nym-node-burn/providers/Microsoft.Network/networkInterfaces/nym-nic" --location westeurope --size "Standard_B1s" 

```

You can change the settings as you see fit but note that the `--nics` flag must be informed with the `Resource ID` we copied in the previous section.

And that’s it! Your VM should be up and running!

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/create-vm_01.png)

Finally, you just have to connect via **ssh** and run a [Nym node](https://nymtech.net/docs/run-nym-nodes/) :blush:, but first, be sure you’ve enabled port 22 access in your `Network Security Group`:

![Container](https://robertohuertas.com/assets/images/azure-ipv6-vm-nym/ssh.png)

Have fun!

--
Originally published at [robertohuertas.com](https://robertohuertas.com/2021/07/19/ipv6-azure-vm-nym-node/) on Jul 19, 2021.