Windows Server 2016 Hyper-V and New-NetNat error 87

nadsad 1 Reputation point
2021-09-02T13:11:09.123+00:00

Hi,

I keep getting "Windows System Error 87" when trying to create the second NAT via PowerShell.

As you can see below i created the first on 192.168.2.0/24 and then trying to create the other one but i keep getting the error.

Any ideas of why?

![128658-image.png]1

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,454 questions
Hyper-V
Hyper-V
A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,601 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Limitless Technology 39,476 Reputation points
    2021-09-02T16:03:47.197+00:00

    Hello @nadsad

    I have experienced the issue before, and the error is quite generic and misleading,

    In my case it happened that for a reason, the the cmdlet worked in first place, due to some unexplained issue, the Get-NetNat was not showing the new created Nat.

    Can you try to remove the Nat you are creating, with Remove-NetNat, and then run your New-NetNat?

    Hope it helps!

    0 comments No comments

  2. nadsad 1 Reputation point
    2021-09-02T16:18:03.37+00:00

    Hi!

    Thank you for the reply.

    Unfortunately I have already tried. So I remove the NAT with Remove-NetNat and then I have no more NATs. I run New-NetNat for the first NAT and it works but then when I run it again to create second NAT I get the error.

    0 comments No comments

  3. Limitless Technology 39,476 Reputation points
    2021-09-02T18:38:42.67+00:00

    Hello again,

    Error 87, commonly known as ERROR_INVALID_PARAMETER and described as The parameter is incorrect.

    A possible cause for the failure is that the Offset and OffsetHigh members of the OVERLAPPED structure are not set to zero.

    In many cases, the function calls may succeed if you do not explicitly set OVERLAPPED.Offset and OVERLAPPED.OffsetHigh to zero. However, this is usually either because the OVERLAPPED structure is static or global and therefore is initialized to zero, or the OVERLAPPED structure is automatic (local) and the contents of that location on the stack are already zero. You should explicitly set the OVERLAPPED.Offset and OVERLAPPED.OffsetHigh structure members to zero.

    Hope this answers all your queries, if not please do repost back.
    If an Answer is helpful, please click "Accept Answer" and upvote it : )

    Regards,

    0 comments No comments

  4. nadsad 1 Reputation point
    2021-09-02T18:55:57.617+00:00

    Honestly im not quite sure what im supposed to do with that answer :)

    0 comments No comments