vSwitch in Promiscuous Mode

Paul Green 21 Reputation points
2021-08-19T19:35:25.02+00:00

Hello

I have a Server 2019 Hyper-V Host and need to setup one of the vSwitches for port mirroring in Promiscuous Mode (as I understand it, at least). I have done this in the past using the below PS but am getting an error on this Host (previous hosts were running 2012R2).

Here is what I am typing into PS:

PS C:\Windows\system32> $a = Get-VMSystemSwitchExtensionPortFeature -FeatureId 776e0ba7-94a1-41c8-8f28-951f524251b5

PS C:\Windows\system32> $a.SettingData.MonitorMode = 2

PS C:\Windows\system32> Add-VMSwitchExtensionPortFeature -ExternalPort –SwitchName NAMEOFMYSWITCH -VMSwitchExtensionFeature $a

I get the below error:

Add-VMSwitchExtensionPortFeature : Failed while modifying virtual Ethernet switch connection settings.

At line:1 char:1

+ Add-VMSwitchExtensionPortFeature -ExternalPort –SwitchName NAMEOFMYSWITCH ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : NotSpecified: (:) [Add-VMSwitchExtensionPortFeature], VirtualizationException

+ FullyQualifiedErrorId : OperationFailed,Microsoft.HyperV.PowerShell.Commands.AddVMSwitchExtensionPortFeature

Not sure what to make of that and I can't find much information when I search.

Any suggestions appreciated.

Many thanks

Windows for business Windows Client for IT Pros Storage high availability Virtualization and Hyper-V
Windows for business Windows Server User experience PowerShell
Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Eric Siron 1,586 Reputation points MVP
    2021-12-20T18:48:57.327+00:00

    I get this error when I run your PS against a virtual switch that already has the security settings extension installed. Try your PS with Set-VMSwitchExtensionPortFeature instead of Add-...

    If that still doesn't work, first run

    Get-VMSwitchExtensionPortFeature -ExternalPort
    

    If that shows the security settings feature and nothing else, then you can:

    Get-VMSwitchExtensionPortFeature -ExternalPort | Remove-VMSwitchExtensionPortFeature
    

    If you have more than one feature installed, then you'll have to add filters to the Get-VMSwitchExtensionPortFeature until you narrow it down to the one that you want.

    After you have successfully removed the feature, you should have no trouble with your original PS that uses the Add-...

    2 people found this answer helpful.

  2. Mark Clift 1 Reputation point
    2021-12-17T16:01:06.177+00:00

    I am having the same problem. Did you ever find and answer?

    0 comments No comments

  3. Paul Green 21 Reputation points
    2021-12-20T08:06:04.567+00:00

    Hello

    I never found an answer. In the end I installed Server 2012R2 on the host as a work-around.

    0 comments No comments

  4. Mark Clift 1 Reputation point
    2021-12-20T22:38:05.547+00:00

    @Eric Siron Thank you for your reply.

    Using your suggestions I was able to work around the error.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.