Configure Virtual NICs - Paiet/Tech-Journal-for-Everything GitHub Wiki
Objectives:
- Add and remove virtual network interface cards (vNICs)
- Configure synthetic and legacy virtual network adapters Get-VMNetworkAdapter
Configure synthetic and legacy virtual network adapters Legacy:
- Leagcy adapter aka emulated adapter vs Synthetic adapter w/ hardware acceleration that relies on integration services.
- Compare Gen 1 & Gen 2 options
- Gen 1 machines can only PXE boot with legacy adapters.
- Guest virtual machines in Hyper-V can be configured to use legacy network adapters which is compatible to remote OS installation technologies like Microsoft Windows Deployment Services (WDS) or System Center. For example, a legacy network adapter can connect to WDS and download boot images for installing a Windows operating system image.
- Right-click on PLABWIN803 > settings
- Add Hardware section of the right details pane, select Legacy Network Adapter and click Add
- Legacy Network Adapter section > Intel(R) 82574L Gigabit Network Connection - Virtual Switch
- Select Enable virtual LAN identification >ok
Add-VMNetworkAdapter
Set-VMNetworkAdapter -VMName DC01 -MaximumBandwidth 200000000
Configure MAC Addresses ** Serverside**
- Launch Virtual Switch Manager
- On the Rt pane under Global Network Settings section click MAC Address Range
- On this screen, you can define the range of MAC addresses that can be assigned to the virtual network adapters. Any change that you make to these will not affect the virtual network adapters that have already been configured with the MAC addresses.
Clientside
- On indiviaul VM when machine is off, go under settings expand to advanced settings under adapter
- Perfect for licencing for firewall compliance
- Note spoofing option used for some load balancing options
- Default is dynamic
Recap:
#Advanced Features
Set-VMNetworkAdapter
-MacAddressSpoofing
-RouterGuard
-PortMirroring -Destination/Source
-DeviceNaming
Introduce optimize network performance Configure virtual machine queue (VMQ)
- Virtual Functions assist traffic flow.
- Reduces overhead and increases throughput by sorting packets within the physical Ethernet Controller & spreading the workload amongst multiple CPU cores. https://www.intel.com/content/www/us/en/ethernet-products/converged-network-adapters/io-acceleration-technology-vmdq.html
Enable Remote Direct Memory Access (RDMA) on network adapters bound to a Hyper-V virtual switch using Switch Embedded Teaming (SET) Switch Embedded Teaming-a Hyper-V only variation on the NIC Teaming concept. It enables you to create a switch that is teamed without first creating the team in Windows Server.
# Enable SET during switch creation
New-VMSwitch -EnableEmbeddedTeaming $True -NetAdapter "NIC1", "NIC2"
Remote Direct Memory Access-a network transmission method that sends large amounts of data over the network with low latency and without processor intervention. Network adapters that support RDMA can transfer data directly to and from application memory without having to buffer it in the server.
help Enable-NetAdapterRDMA
Get-NetAdapterRDMA
Note all Flase
#Enable RDMA
Get-NetAdapterRDMA
Configure Bandwidth Management optimize network performance Set-VMNetworkAdapter -VMName DC01 -MaximumBandwidth 200000000
Improving Network Performance by Using IPsec Task Offload https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/dd125367(v=ws.10)
Enable Single Root I/O Virtualization
- Check For IPsecOffloadV2 in dev
- Allows the use phyical prpoperties availabe in some NICS such as caching or additional processing, drivers may be required.
- This option is only available when creating new switch, no editing
- Relaunch Virtual switch manager & edit PLAB-Internet
- Change from Private network to Internal network
Enable -NetAdapterSriov -Name "Ethernet1"
https://docs.microsoft.com/en-us/powershell/module/netadapter/enable-netadaptersriov?view=win10-ps
Configure NIC teaming in VMs
- There are two ways to enable Virtual NIC Teaming:
- In the Hyper-V Manager, in the settings for the VM, select the VM's NIC and the Advanced Settings item, then enable the checkbox for NIC Teaming in the VM.
- Run the following Windows PowerShell cmdlet in the host with elevated (Administrator) privileges.
Set-VMNetworkAdapter -VMName <VMName> -AllowTeaming On
Active/Active, Active/Passive & Dependent/Independent https://gallery.technet.microsoft.com/Windows-Server-2016-839cb607
- Teaming within a VM is only supported up to 2NICs whereas 32 in harware.
- Switch emebedded teaming SCVMM in 2016
- Why use in VM?? Maybe to aggreagte bandwidth or leverage SRI/OV.
- Teams created in a VM can only run in Switch Independent configuration & Address hash
- Teaming in the VM does not affect Live Migration. The same rules exist for Live Migration whether or not NIC teaming is present in the VM.
Teaming modes: Switch Independent
- This is the default option.
- Using different Switches for each NIC in the team is not required but is possible.
- No configuration on the switch is required.
** Note: Both Static Teaming and LACP are Switch Dependent modes**
**Static Teaming**
* Configuration is required on the switches & computer to identify links that make up the team.
**LACP** Link Aggregation Control Protocol (Dynamic Teaming)
- Dynamically identifies links between the computer and specific switches.
Load Balancing Modes:
Hyper-V port - Each vmNIC has its own MAC address which is the ID used to distribute traffic between team members. - Works well VMs with similar loads.
Address Hash -Creates hash based on info such as the source & destination IP port, however you can specify only IP or MAC. - Helps reduce out of sequence packet processing. - Not typically used with VMs.
Dynamic
- Introduced in Server 2012R2 taking the best of the prior two.
- Outbound is based on address hash
- Inbound uses Hyper-V port methods
- Uses flowlets for outbound
Create a Team via PowerShell New-NetLbfoTeam -Name TeamName -TeamMembers Adaptername1, Adaptername2 -TeamingMode SwitchIndependent -LoadBalancingAlgorithm Dynamic
Links https://docs.microsoft.com/en-us/powershell/module/netlbfo/?view=win10-ps https://docs.microsoft.com/en-us/windows-server/networking/technologies/nic-teaming/Create-a-New-NIC-Team-on-a-Host-Computer-or-VM https://docs.microsoft.com/en-us/windows-server/networking/technologies/nic-teaming/nic-teaming-settings