Hyper-V external vSwitch and physical LAN: when does VM traffic become reachable beyond the host?
0 reputation · 02 Dec 2024, 01:14 UTC
0 reputation · 02 Dec 2024, 01:14 UTC
I want to run a few VMs on a Windows machine with client Hyper-V and give them outbound internet access, without any of them becoming reachable from other devices on my LAN or, worse, from the public internet. I am trying to decide between attaching the VMs to an external virtual switch bound to my physical NIC versus leaving them on the Default Switch.
My understanding is that an external switch bridges VM traffic onto the same broadcast domain as the host NIC, so reachability then depends on upstream switching, VLAN, addressing, and firewall policy. The Default Switch appears to provide NAT-like outbound connectivity, but the documentation suggests it is not a security boundary, so I am unsure how much isolation it actually guarantees. I also want to avoid breaking the host's own management IP when the physical NIC gets bound to a new switch. Assume a current Windows 11 Pro build with the Hyper-V feature enabled.
1. On an external vSwitch, is VM reachability from LAN peers determined entirely by the guest firewall and upstream network, or does Hyper-V itself filter anything by default?
2. Does the Default Switch block unsolicited inbound connections from LAN peers in all configurations, or are there documented cases where it does not?
3. For occasionally exposing one service, is internal/NAT plus an explicit host firewall or reverse-proxy rule meaningfully safer than external bridging with a hardened guest?
If your goal is to prevent VMs from being reachable by other devices on your LAN, do not use an External vSwitch. An External vSwitch places the VM directly on your physical network segment, making it a peer to your host and other physical devices. The Default Switch is the correct choice for outbound-only access, as it uses Network Address Translation (NAT) to hide the VM behind the host's IP address.
An external virtual switch operates as a Layer 2 bridge. When a VM is attached to it, the VM's virtual NIC behaves as if it were physically plugged into your network switch.
Allow management operating system to share this network adapter is checked during switch creation. This creates a virtual bridge that allows both the host and the VMs to share the physical NIC.The Default Switch provides a private internal network with NAT. The host acts as the gateway for the VMs.
For occasionally exposing a specific service, a NAT-based approach (Default Switch) combined with a host-level firewall rule or a reverse proxy is significantly safer than an external bridge. This allows you to maintain a "deny-all" posture for the VM while selectively punching a hole for a single port on the host IP.
To verify your current isolation level, perform these tests:
ping the VM's IP. If the guest firewall is off, the ping will succeed.ping the VM's internal IP from a physical LAN peer. The request should time out or fail, as the internal IP is not routable on the physical wire.Diagnostic Detail Needed: Are you using a static IP assignment on your physical LAN, or is everything handled via DHCP? If you use static IPs, an External vSwitch requires manual IP coordination to avoid collisions on your network.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.