Tag: configure

How to Configure Azure CLI Default Output

How to Configure Azure CLI Default Output Format

The Azure command-line interface (Azure CLI) is a set of commands used to create and manage Azure resources. In this blog post, I am going to show you how you can configure the Azure CLI default output format.

If you have used the Azure resources on your machine or in Azure Cloud Shell, you are aware that if you are running a command, the output you get is in the JSON format. This is great if you are building some sort of automation. However, if you are using in in the command line, it might not be the best way to read the output. You can change the output by using --output table or -o table to make it more human-readable.

To install the Azure CLI check out my blog post here.

How to Configure Azure CLI Default Output

You can also configure the Azure CLI default output to always be a specific type like the table format by running the az configure command. The Azure CLI allows for user configuration for settings such as logging, data collection, output format, and default argument values. You can learn more about the Azure CLI configuration on Microsoft Docs.

Azure CLI az configure

Azure CLI az configure

With az configure, you can manage Azure CLI configuration with this command is interactive.

Azure CLI az configure default output

Azure CLI az configure default output

Here you can now change the default output format.

Azure CLI Tip – Use AI to find az commands
If you did use the Azure CLI, you might find this tip very handy. I am talking about the az find command. The az find command provides you with example commands based on Azure documentation and usage patterns of the Azure CLI and Azure Resource Manager users.

Conclusion

I hope this blog post shows you how to configure the Azure CLI default output format. Are you just getting started with the Azure CLI and want some introduction, check out the get started with Azure CLI Microsoft Docs page. If you have any questions let me know in the comments.



Connect Ubiquiti UniFi Dream Machine to Azure VPN

Connect Ubiquiti UniFi Dream Machine to Azure VPN

A couple of days ago I got a Ubiquiti UniFi Dream Machine, which is an all-in-one device with an access point, 4-port switch, and a security gateway. After the basic setup, I wanted to connect my Ubiquiti UniFi Dream Machine USG to an Azure VPN Gateway (Azure Virtual Gateway), using Site-to-Site VPN. In this blog post, I am going to show you how you can create a site-to-Site (S2S) VPN connection from your Ubiquiti UniFi Dream Machine to Azure Virtual Network Gateway.

Azure Virtual Network Gateway and Connection

I already have a virtual network in Azure with the address space 10.166.0.0/16, and I also deployed the Azure Virtual Network Gateway connected to that vNet. The next thing I did was to add a connection to the gateway.

Azure VPN Connection

Azure VPN Connection

You need the following:

  • Name for the connection
  • Set Connection type to Site-to-site (IPSec)
  • Create a local network gateway (basically the configuration of your local VPN gateway.
  • Define a shared secret

Configure Ubiquiti UniFi Dream Machine VPN connection

Now you can switch to your UniFI Dream Machine, which has an UniFI USG integrated. Under settings go to Networks and click on Create new Network

UniFi Network Azure VPN

UniFi Network Azure VPN

Here you configure the following:

  • Name of your VPN connection
  • VPN Type Manuel IPSec
  • Remote Subnets which is the Azure vNet address space (in my case 10.166.0.0/16)
  • Peer IP which is the public IP address of the Azure virtual network gateway
  • Local WAN IP
  • the pre-shared key (shared secret)
  • IPSec Profile: Customized
  • Key Exchange Version: IKEv2
  • Encryption: AES-256
  • Hash: SHA1
  • DH Group: 2

After that, the VPN will connect and the status of your Azure virtual network gateway connection will change to connected.

Dream Machine Azure VPN Connection

Dream Machine Azure VPN Connection

You can now reach your Azure virtual machine using the private IP address range.

Connected Azure VPN

Connected Azure VPN

I hope this was helpful and show you how you can connect a Ubiquiti Unifi Dream Machine (USG) to an Azure Virtual Network using a site-to-site VPN connection. If you want to learn more about Azure Virtual Network Gateways check out the following documentation:

If you want to know more about point-to-site VPN connection to Azure check out my blog posts:

If you have any questions, feel free to leave a comment.



Install WSL 2

Install WSL 2 on Windows 10

With the Windows 10 Insider Preview Build 18917, the team also ships the first version of the Windows Subsystem for Linux 2 (WSL 2), which was announced at the Microsoft Build 2019 conference. In this post, I am going to show you how you can install WSL 2 on your Windows 10 machine.

The Windows Subsystem for Linux (WSL 1) was in Windows 10 for a while now and allowed you to use different Linux distros directly from your Windows 10 machine. With WSL 2, the architecture will change drastically and will bring increased file system performance and full system call compatibility. WSL 2 is now using virtualization technology (based on Hyper-V) and uses a lightweight utility VM on a real Linux kernel. You can find out more about WSL 2 in the release blog or on the Microsoft Docs Page for WSL 2.

WSL 2 Architecture

Requirements

To install WSL 2, you will need the following requirements:

  • Windows 10 Insider Preview Build 18917 or higher.
  • WSL 2 will be generally available in Windows 10, version 2004, you can read more here.
  • A computer that supports Hyper-V Virtualization

Install WSL 2

To install the Windows Subsystem for Linux 2 (WSL 2), you need to follow these tasks.

  • Enable the Windows Subsystem for Linux Optional feature (WSL 1 and WSL 2)
  • Install a distro for the Windows Subsystem for Linux
  • Enable the ‘Virtual Machine Platform’ optional feature (WSL 2)
  • Configure the distro to use WSL 2

Enable the Windows Subsystem for Linux

To run the WSL on Windows 10 you will need to install the optional feature:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Install a Linux distro for the Windows Subsystem for Linux

If you don’t already have installed a WSL distro, you can download and install it from the Windows 10 store. You can find more here: Crazy times – You can now run Linux on Windows 10 from the Windows Store

Enable the Virtual Machine Platform feature

WSL 2 Enable Virtual Machine Platform

WSL 2 Enable Virtual Machine Platform

To make use of the virtualization feature for WSL 2, you will need to enable the optional Windows feature. You can run the following PowerShell command to do this. You will need to start PowerShell as an Administrator. After you run this command, you might need a restart of your computer.

Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform

Set WSL distro to use version 2

After you completed the first two steps, you will need to configure the distro to use WSL 2. Run the following command to list the available distros in PowerShell:

wsl -l -v

To set a distro to WSL 2 you can run the following command:

wsl --set-version DistroName 2

You can also set WSL 2 as the default:

wsl --set-default-version 2

To find out more about installing WSL 2, check out the Microsoft Docs page.

If you are now running your distro using WSL 2, you can now see that there is a Virtual Machine worker process running and if you search a little bit more, you can also find the VHDX file of the distro.

WSL 2 VHDX file

I hope this helps you and gives you a quick overview, if you have any questions, let me know in the comments and check out the WSL 2 FAQ. The Windows Subsystem for Linux 2 Kernel is also open-source, you can follow the project on GitHub.

By the way, you can now also start using Docker Desktop together with the Windows Subsystem for Linux 2.



Cisco UCS Hyper-V Cluster – Configure Blade Servers – Part 4

After we have installed the Cisco Blade Servers we now have to do some configuration on the Hosts.

  1. First I activate Remote Management like Remote Desktop, Remote MMC and Powershell.
  2. I add a Firewall rule for Remote Disk Managment
     netsh advfirewall firewall set rule group="Remote Volume Management" new enable=yes

    Firewall Rule

  3. After adding this firewall rule, I install the Multipath I/O feature
     ocsetup MultipathIo
  4. Now you can use the MPclaim command-line tool to manage Multipath I/O
    To view all detected enterprise storage:

     Mpclaim -e

    Add MPIO support for Fibre Channel devices:

     mpclaim.exe -r -i -d < _VendorID> < _ProductID>

    Important: Note that the vendor string length is 8 characters, the product string length is 16 characters, and both fields are padded with spaces as needed.
    More Information about the MPclaim command-line tool
    MPclaim

  5. With diskpart you can now see the disks. And you can format the disks with NTFS. Important after that you should take the disks offline to use them in the cluster.
    Diskpart
  6. In the Configuration Menu enable the Cluster Feature.
  7. On each note the all Cluster disks offline.
    select disk 2
    disk offline

In the next post we will configure the Network Adapters of the Cluster notes and create the virtual networks.



Install and configure IPv6 on Windows Server 2003

On Microsoft Windows Server 2003 there is no GUI to configure IPv6. So this article should show you how to configure IPv6 on a Windows Server 2003.

  1. Install the IPv6 Protocol in the Network Adapter Properties or Control Panel
  2. Open the console
  3. Type “netsh” this is a command line program to configure network adapters
  4. Here are some demo configurations

int ipv6
reset
add dns interface=”<Interface Name>” address=<IPv6 primary DNS IP Address>
add dns interface=”<Interface Name>” address=<IPv6 secondary DNS IP Address>
add route prefix=::/0 interface=”<Interface Name>” metric=0 nexthop=<IPv6 Gateway IP Address>
add address interface=”<Interface Name>” address=<IPv6 IP Address>

int ipv6
reset
add dns interface=”Local Area Connection” address=fec0:0:0:0:ffff::1
add dns interface=”Local Area Connection” address=fec0:0:0:0:ffff::2
add route prefix=::/0 interface=”Local Area Connection”metric=0 nexthop=fe80::1
add address interface=”Local Area Connection” address=fe80::2

int ipv6
reset
add dns “Local Area Connection” fec0:0:0:0:ffff::1
add dns “Local Area Connection” fec0:0:0:0:ffff::2
add route ::/0 “Local Area Connection” fe80::1
add address”Local Area Connection” fe80::2



Cheatsheet: Configuring a Server Core installation #1

After setting up my new hardware for my LAB, I thought about installing my Hyper-V Servers as Server Core installations. After reading two minutes in some blogs and the Microsoft TechNet I decided to use the Core Editions.

Basically the setup is the same as the none Core Edition or GUI Edition. But after the installation you have to configure the server without a GUI, your only way to do the basic configuration is the command promt. Btw if you close the command prompt, you can easily recover the prompt by pressing CTRL-ALT-DELETE, click Start Task Manager, click New Task and type cmd.exe.

Windows Server 2008 R2 Core

To do the basic configuration of your Windows Server 2008 (R2) Core, you need the following commands:

Checkout the existing Hostname / Computername:

hostame or ipconfig

Change the Computername / Hostname:

netdom renamecomputer <ComputerName> /NewName:<NewComputerName>

Change the Computername / Hostname without writing the old name:

netdom renamecomputer %computername%   /NewName:<NewComputerName>

Show network interfaces:

netsh interface ipv4 show interfaces

Set Static IP Address, Subnet Mask, and Default Gateway (ID is the shown number in the Idx column when you show your network interfaces):

netsh interface ipv4 set address name="<ID>" source=static address=<StaticIP> mask=<SubnetMask> gateway=<DefaultGateway>

Set DNS Server (index= is the priority of the DNS Server):

netsh interface ipv4 add dnsserver name="<ID>" address=<DNSIP>index=1

Join a Domain:

netdom join <ComputerName> /domain:<DomainName> /userd:<UserName> /passwordd:*

Add a Domain User to the local administrator group:

net localgroup administrators /add <DomainName>\<UserName>

Change or set the product key of your server:

slmgr.vbs –ipk<productkey>

Active the server licence:

slmgr.vbs -ato

If activation is successful, no message will return in the command prompt

Configure the firewall:

netsh advfirewall

netsh advfirewall firewall set rule group="Remote Administration" new enable=yes

Enable Remote Desktop:

cscript c:\windows\system32\scregedit.wsf /ar 0

Restart the Computer:

shutdown /r /t 0

Open Task Manager with the command prompt:

taskmgr

List event logs:

wevtutil el

Find something in the event log:

wevtutil qe /f:<text>

List running services:

sc query

or

net start

List running tasks:

tasklist

to active Powershell type:

powershell

For the most of this simple tasks there is also a configuration tool, which makes it very easy to do your first configuration with Windows Server 2008 Core Edition. The Tool is called sconfig, and its very simple, just start the program with the following command:

sconfig.cmd

Now this will open the following configuration utility:

Windows Server Core Sconfig.cmd