Virtual switches in Hyper-V

Hyper-V-vSwitch1

i. Summary
ii. Virtual Switch Types
iii. Virtual Switch Creation
iv. Extensions
v. Address Range of MAC

Summary

In the world of virtualization, it is not only about virtual machines but also switches, moreover VMware offers the “vSwitch” and Hyper-V itself offers “Virtual Switches”. Today, we will see how to create and configure a vSwitch under Hyper-V hypervisor.

These virtual switches are layer 2, that is to say, it determines the path to be taken by an Ethernet packet using the MAC addresses of the devices.

The integration of Hyper-V in Windows 8 means that the hypervisor can be present on different types of machines, not just servers, but especially on laptops. Therefore, virtual switches must be not related to a physical network adapter only, but also to a Wi-Fi network card. The latest version of Hyper-V allows that.

Note: This tutorial is made with Hyper-V on Windows 8.

Virtual Switch Types

Hyper-V provides the ability to create three different types of virtual switch, here they are:

External: As the name implies, this type is used to link the virtual switch to a physical network card in your machine to communicate with other network computers. In other words, all the machines connected to virtual switch this type of access to the physical network like any physical host.

Internal: Unlike this type of virtual switch makes it possible to connect with the physical network, we stay in-house, that is to say that communication is possible only between virtual machines connected to this type of switch. However, the machine acting as a Hyper-V server will be the only physical machine can communicate with an internal VM virtual switch.

Private: Resumes the same principle as the “inner” kind, except that here the communication with the physical host acts as a Hyper-V server is not possible. The communication is exclusively inter-VM.

When creating switch type, the choice is not final, because we can switch from one type to another quite easily from the configuration of the virtual switch.

Virtual Switch Creation

1- Virtual switches management is done via the Hyper-V Manager. To get there, first click on the “Manage Virtual Switch”, available in the “Actions” menu on the right side of the console.

2- As part of the tutorial, we choose an “external virtual switch type”, but it does not matter since the parameters remain the same.

3- On the left side, click on “New virtual network switch” and choose the switch type that suits you best. Once you made your choice, click on “Create Virtual Switch”.

4- Now first, click on your virtual switch in the left menu to access the settings. To start slowly, give the name you want by filling the field “Name”, and eventually enter a description in the “Zone Notes”.

5- Then you will see the “Zone Connection Type”, which is equivalent to select whether a virtual switch type “External” or “Internal” or “Private” so at any time if you want to change the type, you need to make change here.

6- Regarding the option “Allow system management operating to share this network adapter”, when selected, you will be allowed access to the physical machine with the role of Hyper-V through the card used by the external network (that is to say the one selected in the drop down list). In case the box is unchecked, you must use a different physical interface than that used by the virtual switch to access your Hyper-V server.

7- To end this configuration window, the area “VLAN ID” and more specifically it contains the option to specify a virtual LAN number (VLAN) to be used for communication with the Hyper-V server, in the case where the option is active and if the physical network card supports VLANs.

8- Now you can click “Apply” so that the settings are applied and that the virtual switch is finalized.

9-  If you have chosen the type switch “external” like in this tutorial, you will get the following message when you apply the settings.

This is explained by the fact that Hyper-V creates a network connection on your Windows operating system and also to connect the corresponding connection to the external virtual switch with the physical network adapter attached to it. Therefore, you will see your network connection disconnect then and become available again, very quickly.

Extensions

Click on the little “More” next to the name of your virtual switch, you will see the “submenu Extensions”, but then what it is? It means, you can add extensions to your virtual switch which then become an “extensible virtual switch”; this is order to allow the development of extensions that will emulate the functionality of a physical switch.

You will see that by default there are two options – “NDIS Microsoft Capture” which is a test extension that enables the capture driver NDIS Microsoft in order to capture network traffic, as for the extension “Microsoft Windows Filtering Platform” it generally allows for filtering by filtering or modifying the TCP/IP packets and analyzing or allowing connections.

Address Range of MAC

In the Virtual Switch Manager, in the left menu under the selection “Global Network Settings” you will see “MAC Address RANGE”, click it. In the middle section you will see two field “Minimum” and “Maximum”, in fact you can define a range of MAC addresses is to say, a beginning range (minimum) and end point (maximum) for the MAC addresses to be assigned to virtual network cards. In other words, network cards of your virtual machines as this will be the cards that have virtual networks.

You will notice the note in window that Microsoft specifies that the range you set will not apply to the virtual network cards already attached to virtual machines. To have your virtual network adapter has a MAC address that is part of this range. You must delete and re-add the card. If not, add it once the range is defined in case you have not attached virtual NIC to a VM.

About Paul Lopez

Paul Lopez, a technology writer and sales & marketing executive at bodHOST.com, a cloud & dedicated server hosting company based in New Jersey.
This entry was posted in Cloud Server Hosting and tagged , . Bookmark the permalink.