« Previous 1 2 3 4 Next »
Virtual networks with Hyper-V in Windows Server 2016
Network in a Box
Creating and Configuring Virtual Switches
You create virtual switches on Windows Server 2016 that are generally similar to those in Windows Server 2012 R2. In large environments, you create and manage virtual switches with System Center Virtual Machine Manager 2016 and Network Controller. In medium-sized and small environments, you would work with Hyper-V Manager and PowerShell. In Hyper-V Manager, start by opening the Virtual Switch Manager . Select New virtual network switch to create a virtual switch for the physical network cards in a computer, select the switch type (External , Internal , Private ), and then press the button labeled Create Virtual Switch . In the window, select the physical network adapter that you want to assign to the virtual switch and define what kind of network to assign to the switch:
- External network : An external network allows the virtual machines to communicate with the entire network and supports communication between virtual machines on the host. In the Hyper-V Manager, you can only create one external network for each available physical network adapter, but multiple virtual machines can share this external network.
- Internal network : These networks allow communication of virtual machines among themselves on the physical host. The computers cannot communicate with the network, except with the Hyper-V host and other virtual machines on the Hyper-V host. No network card is required for this connection because the connection is virtualized.
- Private network : These networks allow communication between virtual machines on the host. Communication with the host itself is not possible with this type of network.
If you installed multiple NICs in the Hyper-V host, you can create multiple virtual switches on the basis of these cards. For the virtual switches, you can enable NIC teaming and then, on the virtual servers, create NIC teams; that is, you can connect multiple virtual NICs from different virtual switches. For this configuration to work, you first need to enable the NIC teaming feature on the virtual network cards.
Virtual Switches and PowerShell
You can create and manage virtual switches in PowerShell. The corresponding cmdlets are displayed with:
get-command *vmswitch*
In addition to the switches, you can manage the virtual network adapters in PowerShell. The commands for managing adapters are displayed when you type:
get-command *vmnetworkadapter*
PowerShell displays information on virtual switches when you type Get-VMSwitch
. Display the virtual network card settings with:
Get-VMNetworkAdapter -VMName <name of the virtual server> |fl
With this cmdlet, you also see the MAC address and IP address of the virtual server on the Hyper-V host. The command
Get-VM -computername Hyper-V-Host | foreach{(Get-VMNetworkAdapter $_).IPAddresses}
lets you read the IP addresses of the virtual servers on a local Hyper-V host, as well as hosts on the network. You can customize and extend the command to meet your needs.
Virtual Network Cards
When you assign the new virtual network adapters to virtual servers, you can select the virtual switch to which you want to link the cards (Figure 4). You can change this setting at any time, also on the fly. The hardware acceleration features under the settings for the virtual Network Adapter , are also very interesting. In the Hardware Acceleration menu, you can choose to allow the virtual machines to pass on data to the physical network adapter.
In the Advanced Features , you will find two settings named DHCP guard and Router guard . These settings are designed to prevent the virtual server from acting as a rogue DHCP server or router. You can also define whether the virtual network card can be configured as a member of a NIC team. Moreover, you can enable port mirroring of virtual servers. Port mirroring allows forwarding of network packets to other virtual servers responsible for monitoring the various virtual servers on the host.
« Previous 1 2 3 4 Next »
Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.