Trying to get/ understand the promiscuous mode in Hyper-V.
My issue appears to be in changing the switch mode from source to destination to none.
This is on Windows 10 right now, will test on Server 2012R2/ 2016.
Have port mirroring on the guests, from and to.
Set-VMNetworkAdapter "c-Kali - Attacker" -PortMirroring Source
Set-VMNetworkAdapter "c-Kali - Listener" -PortMirroring Destination
Enabled it on the external switch
$portFeature=Get-VMSystemSwitchExtensionPortFeature -FeatureName "Ethernet Switch Port Security Settings"
# None = 0, Destination = 1, Source = 2
$portFeature.SettingData.MonitorMode = 2
# To the the feature to a newly created switch
Add-VMSwitchExtensionPortFeature -ExternalPort -SwitchName External -VMSwitchExtensionFeature $portFeature
Assumed this would allow me to change the setting from source/ destination/ none, but it doesn't
# to change the VMswitch setting
set-VMSwitchExtensionPortFeature -ExternalPort -SwitchName External -VMSwitchExtensionFeature $portFeature
It throws an error
PS C:\Windows\system32> set-VMSwitchExtensionPortFeature -ExternalPort -SwitchName External -VMSwitchExtensionFeature $portFeature
set-VMSwitchExtensionPortFeature : The advanced feature "Ethernet Switch Port Security Settings" is not attached to a virtual switch or network adapter.
At line:1 char:1
+ set-VMSwitchExtensionPortFeature -ExternalPort -SwitchName External - ...
+ CategoryInfo : InvalidArgument: (:) [Set-VMSwitchExtensionPortFeature], VirtualizationException
+ FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.SetVMSwitchExtensionPortFeature
This is frustrating me a lot.
Correct command to see the state of the switch appears to be
get-VMSwitchExtensionPortFeature -ExternalPort -SwitchName External | select -ExpandProperty SettingData
As opposed to some of the other commands posted.
Going to try to continue with Hyper-V but suspect VMware will take over again...
The features appear disabled in the vSwitch Manager GUI.
If I enable them I blue screen every time!!!