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 Server 2019
Windows Server 2019
A Microsoft server operating system that supports enterprise-level management updated to data storage.
3,613 questions
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,636 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,462 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Eric Siron 1,256 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