Is WinNAT (i.e. Get-NetNat/New-NetNat) supported on Win10 Pro?

Lars-Hammarstrand@CENTIX 21 Reputation points
2020-10-14T09:59:35.507+00:00

Regarding WinNAT on Win10 Pro, is Get-NetNat/New-NetNat supported and/or does it need to be enabled somehow (like old netsh routing ip nat install)

I get the following error with PS:

PS C:\> New-NetNat -Name WGNAT -InternalIPInterfaceAddressPrefix 10.0.0.1/24

>>

New-NetNat : Invalid class
At line:1 char:2
+  New-NetNat -Name WGNAT -InternalIPInterfaceAddressPrefix 10.0.0.1/24
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (MSFT_NetNat:root/StandardCimv2/MSFT_NetNat) [New-NetNat], CimException
    + FullyQualifiedErrorId : HRESULT 0x80041010,New-NetNat

--
Thanks in advance!

Windows for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
0 comments No comments
{count} votes

Accepted answer
  1. Leon Laude 86,026 Reputation points
    2020-10-14T10:12:52.893+00:00

    Hi @Lars-Hammarstrand@CENTIX ,

    It is supported on Windows 10 Pro, just make sure you have the following requirements:

    • Windows 10 Anniversary Update or later
    • Hyper-V is enabled (instructions here)

    For more information see:

    Set up a NAT network
    https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/setup-nat-network

    ----------

    (If the reply was helpful please don't forget to upvote or accept as answer, thank you)

    Best regards,
    Leon

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Lars-Hammarstrand@CENTIX 21 Reputation points
    2020-10-14T13:47:36.91+00:00

    Thanks, but is Hyper-V really necessary since the service already is there but not started (se below).

    Anyhow, I'll enable hyper-v and check if that solves the problem. If that's the case someone at MS should clarify that "WinNAT" is a pure Hyper-V subsystem. Btw, du you know if ICS (internet con. sharing) utilize the same driver ie. "winnat.sys" ?

    PS C:\> Get-Service  winnat  | fl *
    
    
    Name                : winnat
    RequiredServices    : {Tcpip}
    CanPauseAndContinue : False
    CanShutdown         : False
    CanStop             : False
    DisplayName         : Windows NAT Driver
    DependentServices   : {}
    MachineName         : .
    ServiceName         : winnat
    ServicesDependedOn  : {Tcpip}
    ServiceHandle       : SafeServiceHandle
    Status              : ** STOPPED **
    ServiceType         : KernelDriver
    StartType           : Manual
    Site                : 
    Container           : 
    
    
    start-Service winnat; Get-Service winnat  | fl *
    
    Name                : winnat
    RequiredServices    : {Tcpip}
    CanPauseAndContinue : False
    CanShutdown         : False
    CanStop             : True
    DisplayName         : Windows NAT Driver
    DependentServices   : {}
    MachineName         : .
    ServiceName         : winnat
    ServicesDependedOn  : {Tcpip}
    ServiceHandle       : SafeServiceHandle
    Status              : ** RUNNING **
    ServiceType         : KernelDriver
    StartType           : Manual
    Site                : 
    Container           : 
    

  2. Lars-Hammarstrand@CENTIX 21 Reputation points
    2020-10-14T14:05:00.167+00:00

    Yepp, Hyper-V did it!

    Interesting enough I'll get a different error after I disabled Hyper-V once again but a somewhat more consistent error code "Provider load failure" since the subsystem isn't available:

    PS C:\> Get-NetNat
    Get-NetNat : Provider load failure 
    At line:1 char:1
    + Get-NetNat
    + ~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (MSFT_NetNat:root/StandardCimv2/MSFT_NetNat) [Get-NetNat], CimException
        + FullyQualifiedErrorId : HRESULT 0x80041013,Get-NetNat
    
    0 comments No comments

  3. Lars-Hammarstrand@CENTIX 21 Reputation points
    2020-10-14T14:11:13.703+00:00

    Btw, can you please get in touch MS and ask them to clarify in the docs that WinNAT (and associated PS cmdlets) only is available for RAS and Hyper-V.

    Thanks in advance!


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.