Understanding Hyper-V Networks
Hyper-V networks determine how the VM communicates with the host machine and computers on external networks. By creating a virtual network and then connecting a virtual network adapter to that network, you configure how the VM is able to communicate. Hyper-V VMs can use three different types of network:
- External: External networks allow a virtual network adapter to be bound to a physical network adapter on the Hyper-V host machine. You use an external network when you want to allow the VM to communicate through that network adapter with computers on external networks. VMs can be automatically or manually assigned IP addresses on the same subnet as the host machine's network adapter.
- Internal: Internal networks allow the virtual machine to establish network communication with the Hyper-V host machine. For example, you could use the ping utility to verify connectivity between the host and the VM if the VM's network adapter is connected to an internal network. VMs connected to the same internal network on the same Hyper-V host can communicate with each other.
- Private: Private networks are isolated from the Hyper-V host machine's network. The Hyper-V host cannot use the ping utility to establish network connectivity with a VM connected to a private network. VMs connected to the same private network on the same Hyper-V host can communicate with each other.
You manage Hyper-V networks through the Virtual Network Manager dialog box shown.
To create a Hyper-V network, perform the following general steps:
- Open the Hyper-V Manager console from the Administrative Tools menu.
- Click Virtual Network Manager from the Actions pane.
- On the Virtual Network Manager dialog, select the type of virtual network that you wish to create, and click Add.
- Enter a name for the network. If you are choosing to create an External network, select the network adapter that the new virtual network will be mapped to. You can also choose whether you want to enable virtual LAN identification and specify a VLAN ID.
Connecting Network Adapters
A Hyper-V network adapter can be connected only to a single Hyper-V network. If you want to configure a VM to be connected to multiple Hyper-V networks, you need to set the VM up to have multiple network adapters, each connected to a separate network. To connect a specific adapter to a specific network, use the Network drop-down when the Network Adapter item is selected on the virtual machine's properties dialog box.
There are two different types of network adapters that you can add to a Hyper-V VM: the network adapter and the legacy network adapter. The first type, sometimes called a synthetic network adapter, uses drivers that are included in recent OSes, such as Windows 7 and Windows Server 2008, or which can be installed with the integration services components. Synthetic network adapters are not functional until the OS has properly booted. A VM can have a maximum of eight synthetic network adapters.
The legacy network adapter, also called the emulated network adapter, emulates a virtual Multiport DEC 21140 adapter. This is useful when you have guest OSes that don't work with the synthetic network adapters, because there are no appropriate integration services drivers available for that OS. Most OSes do support the Multiport DEC 21140, so if you can't get a synthetic network adapter working, configure the VM to use a legacy network adapter. Legacy network adapters are also necessary if you want to PXE boot a virtual machine, as they are available prior to the OS booting up. A virtual machine can have a maximum of four legacy network adapters.
You can configure a virtual network adapter with either a static or a dynamic Media Access Control (MAC) address. A static MAC address stays consistent. A dynamic MAC address is configured through the MAC address pool. You configure the MAC address pool range by selecting the MAC Address Range item on the Virtual Network Manager dialog box.
There are two different types of network adapters that you can add to a Hyper-V VM: the network adapter and the legacy network adapter. The first type, sometimes called a synthetic network adapter, uses drivers that are included in recent OSes, such as Windows 7 and Windows Server 2008, or which can be installed with the integration services components. Synthetic network adapters aren't functional until the OS has properly booted. A VM can have a maximum of eight synthetic network adapters.
The legacy network adapter, also called the emulated network adapter, emulates a virtual Multiport DEC 21140 adapter. This is useful when you have guest OSes that don't work with the synthetic network adapters, because there are no appropriate integration services drivers available for that OS. Most OSes do support the Multiport DEC 21140, so if you can't get a synthetic network adapter working, configure the VM to use a legacy network adapter. Legacy network adapters are also necessary if you want to PXE boot a virtual machine, as they are available prior to the OS booting up. A virtual machine can have a maximum of four legacy network adapters.
You can configure a virtual network adapter with either a static or a dynamic Media Access Control (MAC) address. A static MAC address stays consistent. A dynamic MAC address is configured through the MAC address pool. You configure the MAC address pool range by selecting the MAC Address Range item on the Virtual Network Manager dialog box.
You can also enable MAC address spoofing on a per-virtual network adapter basis. Most of the time you won't want to do this as it presents a security risk, though some applications, such as Network Load Balancing, require a virtual machine network adapter to support MAC address spoofing. To enable MAC address spoofing, check the Enable Spoofing of MAC Addresses check box on the virtual network adapter's properties.