How to Configure Private Virtual Switch in Hyper-V Manager

The main reason for creating a Private Network on Hyper-V is to prevent a virtual machine from accessing both our physical network and our physical computer.

How to Configure Private Virtual Switch in Hyper-V Manager

How to Create Private Virtual Switch in Hyper-V

After creating a Private network with Hyper-V, we need to add the created network adapter to the virtual machine. After adding a custom network adapter, virtual machines can no longer access the physical network.

However, this may change in some cases. For example, if you are going to install Pfsense with a Hyper-V in the test environment, you can complete Pfsense installation by adding an Internal Virtual Switch to the LAN and an External Virtual Switch to the WAN.

In our next articles, we will install Pfsense with Hyper-V. In our previous articles, we have examined other types of virtual networks;

You can also watch the video tutorial on the topics mentioned above on our YouTube channel;

Likewise, we continue to network types, and this time we will discuss the Private Virtual Network/Switch configuration.

How to Add Private Virtual Network

After adding a Custom Virtual Network adapter on Hyper-V, we will add the created network adapter to the virtual machines. We will then examine how these virtual machines can communicate with each other.

And then we’re going to test whether our physical machine can access the network card. Follow the steps below to configure Private Switch.

   Step 1

First, run the Hyper-V Manager virtualization program. If you haven’t installed it before, you can check out our article on Hyper-V Setup.

Hyper-V Manager

   Step 2

For example, check the Windows 10 virtual machine network adapter settings installed on Hyper-V. You can see from the image below that no Virtual Switch has added to the Windows 10 virtual machine.

Adding a Network Card to a Windows 10 Virtual Machine

   Step 3

To add a network adapter to a virtual machine, you must first create a new Virtual Switch from the Virtual Switch Manager settings.

Click the Virtual Switch Manager from the Actions panel.

Virtual Network Administrator

   Step 4

Select Private from the VS Manager window and click the Create VS button.

Creating Virtual Switch

   Step 5

Type a name for the Private Network to be created and click OK to continue.

Private Network

   Step 6

To add the Hyper-V network adapter that you created to the virtual machine, right-click on the virtual machine.

Windows 10 Settings

   Step 7

In the Windows 10 VM settings, click the network card on the left panel, then select Switch you created from the Network Adapter section and click OK.

New Virtual Switch

   Step 8

To test the Private Network configuration, configure two virtual machines, and test the connection between them. For example, you can use a Windows 7 virtual machine as in the image below.

Add the Private Switch to the second virtual machine.

Network Adapter Configuration

   Step 9

Configure the Windows 7 TCP/IP configuration as follows. You can create the IP block here for the desired range. You do not have to fill in the default gateway address because the virtual machine will not be able to communicate with the physical network and the physical machine!

Windows 7 Virtual Machine TCP/IP Settings

   Step 10

Configure the IP configuration of Windows 10 machine as follows.

Windows 10 Virtual Machine TCP/IP Settings

   Step 11

Pinging from Windows 10 virtual machine to Windows 7 virtual machine is successful!

Ping from Windows 10 to Windows 7

   Step 12

Pinging from the Windows 7 machine to the Windows 10 machine was successful!

Ping from Windows 7 to Windows 10

   Step 13

No adapter for Hyper-V has created in the network settings of our physical computer. If we had added the Internal Switch, a vEthernet network adapter would create on the following screen.

Windows Network Connections

How to Configure VLAN in Hyper-V

VLAN creation and configuration is very simple. After creating a Private Virtual Switch on Virtual Switch Manager, we need to define a VLAN ID to this network adapter. For example, a Windows 7 virtual machine that is a member of VLAN 2 will not be able to communicate with VLAN 3.

In Hyper-V, let’s take a step-by-step look at assigning virtual machines to a VLAN and testing connectivity.

   Step 1

Re-open the Windows 10 machine network card settings based on all the above settings. In the Virtual Machine Network Adapter window, select the VLAN ID this time and then specify the VLAN Number in the box just below it and click OK.

Hyper-V VLAN Configuration

   Step 2

On the Windows 7 virtual machine, open the CMD command prompt and ping the Windows 10 VM to test the connection. The Destination host unreachable error message is reported as you see in the image below.

Ping 192.168.10.10

   Step 3

Pinging from the Windows 10 virtual machine to the Windows 7 virtual machine will also fail as follows.

Ping 192.168.10.7

   Step 4

We made Windows 10 VM a member of VLAN 2. This time, start pinging continuously on the Windows 7 virtual machine at the CMD command prompt.

As soon as you start continuous pinging, turn on the Windows 7 network adapter settings on Hyper-V. Then activate the VLAN ID option and type 2 as the VLAN Number and click OK to close the window.

As you can see in the image below, Ping will succeed as soon as the Windows 7 virtual machine assigns to VLAN 2.

VLAN ID Activation

Custom Virtual Switch Settings⇒ Video

To create a Hyper-V Private Network on Windows 10, you can watch the video below and also subscribe to our YouTube channel to support us!

   Final Word


In this article, we have examined how to configure a Custom Virtual Switch from Hyper-V virtual network types. Thanks for following us!

   Related Articles


How to Activate Hyper-V using Powershell
♦ How to Activate Hyper-V using CMD
♦ How to Create a New VM in Hyper-V
♦ How to Run Windows 10 in Hyper-V
♦ How to Run Windows 7 in Hyper-V

Add a Comment

Your email address will not be published. Required fields are marked *

shares
error: