Launch an Instance

Now launch an instance of TNSR:

  1. Install azure-cli. Instructions can be found at https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest

  2. Login to your Azure account running:

    $ az login
    
  3. Configure the default location.

    $ az configure --defaults location=centralus
    
  4. Create a resource group to be used to store all TNSR related objects if you don’t have it already.

    $ az group create -n TNSR-Resource-Group
    
  5. Create Virtual Network and Subnets.

    $ az network vnet create \
        -n TNSR-VNet \
        -g TNSR-Resource-Group \
        --address-prefixes 10.5.0.0/16
    
    $ az network vnet subnet create \
        -g TNSR-Resource-Group \
        --vnet-name TNSR-VNet \
        -n TNSR-WAN-Subnet \
        --address-prefixes 10.5.0.0/24
    
    $ az network vnet subnet create \
        -g TNSR-Resource-Group \
        --vnet-name TNSR-VNet \
        -n TNSR-LAN-Subnet \
        --address-prefixes 10.5.1.0/24
    
    $ az network vnet subnet create \
        -g TNSR-Resource-Group \
        --vnet-name TNSR-VNet \
        -n TNSR-MGMT-Subnet \
        --address-prefixes 10.5.2.0/24
    
  6. Create Public IPs to be used by WAN and Management interfaces.

    $ az network public-ip create \
        -g TNSR-Resource-Group \
        -n TNSR-WAN-IP
    
    $ az network public-ip create \
        -g TNSR-Resource-Group \
        -n TNSR-MGMT-IP
    
  7. Create the Management Network Interface.

    $ az network nic create \
        -g TNSR-Resource-Group \
        --vnet-name TNSR-VNet \
        --subnet TNSR-MGMT-Subnet \
        -n TNSR-MGMT-nic \
        --public-ip-address TNSR-MGMT-IP
    
  8. Create the WAN Network Interface.

    $ az network nic create \
        -g TNSR-Resource-Group \
        --vnet-name TNSR-VNet \
        --subnet TNSR-WAN-Subnet \
        -n TNSR-WAN-nic \
        --public-ip-address TNSR-WAN-IP \
        --ip-forward \
        --accelerated-networ
    
  9. Create the LAN Network Interface.

    $ az network nic create \
        -g TNSR-Resource-Group \
        --vnet-name TNSR-VNet \
        --subnet TNSR-LAN-Subnet \
        -n TNSR-LAN-nic \
        --ip-forward \
        --accelerated-networ
    
  10. Choose the VM Size to be used. To get a list of sizes that are able to run TNSR, run the following command and export a variable called TNSR_SIZE with it.

    $ az vm list-sizes \
        --query "[?numberOfCores >= \`4\`] | [?memoryInMb >= \`8192\`].name | sort(@)" \
        --output tsv
    
    $ export TNSR_SIZE=<FILL DESIRED SIZE HERE>
    
    # EXAMPLE:
    $ export TNSR_SIZE="Standard_DS4_v2"
    
  11. Choose the TNSR image URN to be used from the list obtained with the following command and export a variable called TNSR_URN with it.

    $ az vm image list \
        --publisher Netgate \
        --all \
        --query "[?contains(offer,'tnsr')].{Sku:sku, Version:version Urn:urn}" \
        --output table
    
    $ export TNSR_URN="netgate:netgate-tnsr-azure-fw-vpn-router:netgate-tnsr-ent-19_02_1-1:19.02.2"
    
  12. Export a variable called TNSR_SSH_KEY containing a path to a valid SSH public key.

    $ export TNSR_SSH_KEY="~/.ssh/id_rsa.pub"
    
  13. Accept Azure Marketplace terms so that the image can be used to create VMs.

    $ az vm image accept-terms --urn ${TNSR_URN}
    
  14. Create the TNSR Virtual Machine.

    $ az vm create \
        --accelerated-networking true \
        --admin-username tnsr \
        --image ${TNSR_URN} \
        --name TNSR-Instance1 \
        --nics TNSR-MGMT-nic TNSR-WAN-nic TNSR-LAN-nic \
        --os-disk-size-gb 20 \
        --resource-group TNSR-Resource-Group \
        --size ${TNSR_SIZE} \
        --ssh-key-value @${TNSR_SSH_KEY}
    

Note

To shutdown and deallocated an instance of TNSR on Azure, type the following command from an Azure CLI:

az vm deallocate --no-wait -g TNSR-Resource-Group -n TNSR-Instance1