Networking

What is Private vSwitch?

A private vSwitch is a Hyper-V virtual switch that connects VMs on the same host only to each other, with no access to the host or the physical network.

What is a private vSwitch?

A private virtual switch is one of the three virtual switch types in Microsoft Hyper-V. VMs connected to it can talk to each other, and that's all: the host computer can't reach them through it, and they can't reach the physical network or the internet. The traffic never leaves the host, and VMs on other hosts can't join it.

External vs. internal vs. private

Switch typeVM to VMVM to hostVM to LAN and internet
ExternalYesYes, when the host shares the adapterYes, through the physical NIC it is bound to
InternalYesYesNo
PrivateYesNoNo

Other hypervisors have the same idea under different names: VirtualBox calls it an internal network, and VMware Workstation offers LAN segments. Either way the rule is VM-to-VM only.

When to use a private switch

  • Isolated test labs: run a test domain controller, DNS server and clients that can't clash with the production network.
  • Malware analysis: let a sample talk only to other lab VMs. Also turn off shared folders and clipboard sharing, which bypass the network.
  • Back-end traffic: keep traffic between, for example, an application VM and a database VM off every other network, with the application VM using a second adapter for outside access.

Setting one up

In Hyper-V Manager, open Virtual Switch Manager, choose Private and name the switch. In PowerShell, the equivalent is New-VMSwitch -Name "IsolatedLab" -SwitchType Private. Then connect each VM's network adapter to the switch.

A private switch has no DHCP server unless one of the VMs runs one, so give the VMs static IP addresses. Otherwise Windows VMs fall back to APIPA addresses (169.254.x.x), which still work between them but are easy to mistake for a fault.

For the CompTIA A+ exam

Core 1 (220-1201) objective 4.1 lists network requirements for virtual machines. The switch names come from Hyper-V rather than the objectives, but the logic is testable: if a VM must be reachable from other devices on the LAN, use an external switch; if it only needs to reach the host, use internal; if VMs must be cut off from everything except each other, use private.

Studying for CompTIA (Networking)?

ExamWizardz turns the official objectives into a guided study plan — with practice tests, realistic PBQs, and a readiness score. Start free.

Start studying free

Related terms

APIPA

APIPA (Automatic Private IP Addressing) is a feature in Microsoft Windows that automatically assigns a private IP address to a device when a DHCP server is not available.

External vSwitch

A virtual switch in a hypervisor that connects virtual machines to physical network adapters, enabling communication between VMs and external networks or physical devices outside the host.

host-only networking

A virtual networking mode that isolates virtual machines from external networks while allowing communication only between the host system and the virtual machines on the same logical network segment.

Hyper-V

Hyper-V is a virtualization platform developed by Microsoft that enables the creation and management of virtual machines on Windows and Windows Server operating systems, allowing multiple isolated operating system instances to run simultaneously on a single physical host.

Internal vSwitch

A virtual switch in a hypervisor that enables network communication exclusively between virtual machines and the host operating system without connecting to external physical networks.

sandboxing

Sandboxing is a security mechanism that isolates an application or process in a restricted, controlled environment to prevent it from accessing or modifying other parts of the system.

virtual switch

A software-based networking component that enables communication between virtual machines and between virtual machines and physical networks by emulating the functionality of a hardware network switch within a hypervisor or virtualization platform.

VM

A virtual machine (VM) is a software-based computer that emulates the functionality of a physical computer, allowing users to run multiple operating systems and applications on a single physical machine.