Complete the two following tasks to set up port mirroring on a Windows Server 2012 R2 Hyper-V host.
Important: Before you configure port mirroring on a Windows Server 2012 VM, make sure that the Microsoft packet sniffing tool hotfix is applied.
Configuring the Virtual Machine to Capture Mirrored Traffic
To configure the virtual machine you want to use to capture mirrored traffic
- Open the Hyper-V Manager and right-click the machine that you want to use to capture mirrored traffic.
- Select Settings.
- Expand the associated network adapter and select Advanced Features.
Scroll to the Port mirroring section and set the Mirroring mode to Destination.
- Click Apply and OK.
Configuring the Mirror Port
To configure the mirror port
- Open the Windows PowerShell console.
$a = Get-VMSystemSwitchExtensionPortFeature -FeatureId 776e0ba7-94a1-41c8-8f28-951f524251b5
$a.SettingData.MonitorMode = 2
add-VMSwitchExtensionPortFeature -ExternalPort -SwitchName <virtual_switch_name> -VMSwitchExtensionFeature $a
Important: Be aware that, if you enable promiscuous mode for a physical port, it directs all the traffic received on that port towards the virtual machine destination.
To learn more about configuring port mirroring on a Hyper-V virtual machine, refer to this article on the Microsoft website.
Related Video Content
To view other related training videos, click here.