How to Configure Private Virtual Switch in Hyper-V Manager? – The main reason for creating a Private Virtual Switch on Hyper-V is to prevent a virtual machine from accessing both your physical network and your physical computer.
How to Configure Private Virtual Switch in Hyper-V Manager?
After creating a private network with Hyper-V Manager, we need to add the created network adapter to the virtual machine. After adding the Private network adapter in Hyper-V, the full freedom of this virtual machine is restricted.
However, in some cases this can change. For example, if you are setting up Pfsense with a Hyper-V in a test environment, you can complete the Pfsense installation by adding Private Virtual Switch to the LAN side and External Virtual Switch to the WAN side.
In our next tutorial, we’ll look at the steps to install Pfsense on Hyper-V. In our previous articles, we examined other Hyper-V virtual network types. You can browse through these links below.
- How to Create External Virtual Switch in Hyper-V Manager?
- How to Create and Configure Internal Virtual Switch in Hyper-V Manager?
You can also configure the above topics by watching the videos on our YouTube channel. You can access these videos from the links below.
- How to Create External Virtual Switch in Hyper-V on Windows 10?
- How to Configure Internal Virtual Switch in Hyper-V on Windows 10?
Likewise, we continue with Hyper-V virtual network types, and this time we will consider the Private Virtual Switch configuration.
How to Connect Virtual Machines to Each Other Using Private Virtual Switch in Hyper-V?
After adding the Virtual Private Network Adapter on Hyper-V, we will add the created network adapter to the virtual machines. Later, we will examine how these virtual machines communicate with each other.
And then we will test if the virtual machines can access our physical network card. Follow the steps below to configure Private Virtual Switch in Hyper-V.
For example, check the Windows 10 virtual machine network adapter settings that installed on Hyper-V. You can see from the image below that no Virtual Switch has added to the Windows 10 virtual machine.
To add a network adapter to the virtual machine, you must first create a new Virtual Switch from the Virtual Switch Manager settings.
From the Hyper-V Actions panel, click Virtual Switch Manager.
In the Virtual Switch Manager window, select Private and click on the Create Virtual Switch button.
Type a name for the Internal Virtual Switch that you will create and click OK to continue.
Click the Right Key / Settings on the virtual machine to add the Hyper-V network adapter you created to the virtual machine.
In the Windows 10 virtual machine settings window, click on the network card in the left pane, then select the Virtual Private Switch you created from the Network Adapter section and click on the OK button.
To test the Hyper-V Private Network configuration, configure 2 virtual machines and test the connection between them. For example, you can use a Windows 7 virtual machine like the one below.
Add the Private Virtual Switch to the second virtual machine.
Configure the TCP/IP configuration of Windows 7 as follows. You can create an IP block for this interval. You have not 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!
Configure the Windows 10 virtual machine IP configuration as follows.
Pinging from Windows 10 virtual machine to Windows 7 virtual machine is successful!
Pinging from Windows 7 virtual machine to Windows 10 virtual machine is also successful!
No physical adapters for Hyper-V have been created in the network settings of our physical computer. If we added an Internal Virtual Switch, a vEthernet network adapter would be created on the screen below.
How to Configure VLAN in Hyper-V on Windows 10?
Creating and configuring VLANs on Hyper-V is quite simple. After creating a Private Virtual Switch on Virtual Switch Manager, we need to define a VLAN ID for 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.
Let’s take a step-by-step look at assigning virtual machines to VLAN and testing connectivity in Hyper-V.
Based on all of the above settings, then open the Windows 10 virtual machine network card settings again. In the Network Adapter window of the virtual machine, select the VLAN ID option then click on the OK button with the VLAN number immediately below it.
On the Windows 7 virtual machine, open the CMD command prompt and test the connection by pinging the Windows 10 virtual machine. As you can see in the following image, Destination host unreachable error message is reported.
When we ping from the Windows 10 virtual machine to the Windows 7 virtual machine, the ping will fail as follows.
We made Windows 10 a member of VLAN 2. This time you start pinging continuously at the CMD command prompt on the Windows 7 virtual machine.
Immediately after you start pinging continuously, open the Windows 7 network adapter settings on Hyper-V. Then enable the VLAN ID option and type 2 as the VLAN Number. Click the OK button to close the window.
As you can see in the following image, once the Windows 7 virtual machine assigns to VLAN 2, the ping process will succeed.
How to Configure Private Virtual Switch in Hyper-V Manager? ⇒ Video
To create a Hyper-V Private Network on Windows 10, you can watch the following video and you can also subscribe to our YouTube channel to support us…
How to Configure Private Virtual Switch in Hyper-V Manager? – In this article, we have reviewed step by step how to configure a Private Virtual Network on Hyper-V that is one of the virtual network types. Thanks for following us!
If this article is helpful, send me feedback by commenting! Thanks in advance, take care of yourself!
Also, you can add to browser bookmarks by pressing the CTRL+D to read this article later!