Hyper-V Virtual Switch Types

Hyper-V allows the creation of virtual switches to provide connectivity between virtual machines, the host operating system, and the external network. There are three types of virtual switches in Hyper-V: Private, Internal, and External.

  1. Private virtual switch: A private virtual switch provides network connectivity between virtual machines that are running on the same Hyper-V server. Private virtual switches are useful in scenarios where you want to isolate network traffic between virtual machines, such as in a test environment. Private virtual switches cannot be used to provide network connectivity to the host operating system or any external network.

Creating a Private virtual switch using PowerShell:

New-VMSwitch -Name "Private Switch" -SwitchType Private
  1. Internal virtual switch: An internal virtual switch provides network connectivity between virtual machines and the host operating system. Internal virtual switches can also be used to provide network connectivity between virtual machines running on different Hyper-V servers that are connected through a site-to-site VPN connection.

Creating an Internal virtual switch using PowerShell:

New-VMSwitch -Name "Internal Switch" -SwitchType Internal
  1. External virtual switch: An external virtual switch provides network connectivity between virtual machines, the host operating system, and the external network. This type of virtual switch can be used to connect virtual machines to the Internet or to other physical networks.

Creating an External virtual switch using PowerShell:

New-VMSwitch -Name "External Switch" -SwitchType External -NetAdapterName "Physical NIC Name"

In the above command, replace “Physical NIC Name” with the name of the physical network adapter that you want to use for the external virtual switch.

Creating a virtual switch using Hyper-V Manager:

  1. Open Hyper-V Manager and select the Hyper-V server on which you want to create the virtual switch.
  2. In the Actions pane, click Virtual Switch Manager.
  3. Select the type of virtual switch that you want to create (Private, Internal, or External).
  4. Follow the prompts to configure the virtual switch.

Once the virtual switch is created, you can assign it to virtual machines as needed.

Author: tonyhughes