Microsoft Hyper-V Virtual Switch Configuration

Hyper-V supports three virtual network switches that enable connecting your host and virtual machines to the rest of the network. They are external, internal and private virtual switches. Learn more about how do they work.

To get a functional and healthy Hyper-V environment, there are three crucial factors: proper configuration, monitoring, and backup and restore strategy. The goal of today´s article is the first part where we as IT Admins need to properly understand what Hyper-V offers through a built-in networking stack.

The same as physical network cards are used by computers and servers, virtual machines use virtual network cards to communicate with networks, known as vNIC. vNICs are configured based on the business needs and then assigned to the virtual machines. Hyper-V supports three types of virtual switches: external, internal, and private.

The External virtual switch enables connecting virtual machines with the rest of the physical or virtual network and the Internet. It is a common virtual switch used in most scenarios. If you are running DHCP in your network, your vNIC will get IPs automatically. If not, you will need to assign it manually.

The Internal virtual switch enables the communication between Hyper-V virtual machines and the host. It is mostly used for testing purposes as it acts as an isolated network segment.

The Private virtual switch provides communication only between virtual machines. Hyper-V host doesn’t see communication. This is the main difference comparing to the internal virtual switch. But, in both cases, internal and private virtual switch, you will need to configure network cards and IP addresses on both, host and virtual machines which is not the case for an external virtual switch.

The procedure of creating virtual switches is straightforward. I´ll show you how to do it in Windows Server 2019 / Hyper-V Server 2019, but the procedure and concept is also compatible with previous operating systems.

Please open Hyper-V Manager and on the right side of the window click Virtual Switch Manager. The Virtual Switch Manager will show you a list of the created virtual switches on the left side of the window, and allow you to create a new switch. Select what type of virtual switch you need to create and then click Create Virtual Switch.

Create virtual switch

In the new window, you need to define the name, add notes and choose a connection. If you are creating an External virtual switch, as I do, you will need to select a physical network card available on your host. External virtual switch will bind itself to a physical network card so that virtual machines can access a physical network.

Define parameters

Once you create a new virtual switch, you need to assign it to your virtual machine. You can do it by navigating to your virtual machine (right click > Settings) and then selecting virtual switch under Network Adapter > Virtual switch as shown in the screenshot below.

Virtual Network Adapter Configuraiton

If you are creating a new virtual machine, you will see an option to select one of the available virtual network switches under Configure Networking. This was easy, isn’t it?

Two other important factors are monitoring and backup of your virtual machines. You can read more details about monitoring your Hyper-V host, virtual machines and other components on my tech article Get more visibility into Hyper-V Server with PRTG published by Paessler AG and other related articles on my blog. And the second part is having a backup of virtual machines that can be restored in minutes in case of failures. By using Altaro VM Backup, you can backup your virtual machines to your NAS or cloud storage. You can read more in my article Backup Hyper-V VMs to Synology and Azure Cloud Storage.

I hope you find this article useful. If so, you can share it with your network by clicking on the social media button below. In case of any questions, feel free to comment or contact me.

Comments (2):

  1. Joshua

    June 30, 2021 at 19:08

    Nice overview. Do you configure virtual switches in the same way for Hyper-V Server Core?

    Reply
    • Jasmin Kahriman

      July 1, 2021 at 17:03

      Thanks, Joshua. Yes, you can do it via Hyper-V Manager or PowerShell.

      Reply

Leave a Reply

Your email address will not be published.

Share via
Copy link
Powered by Social Snap