Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Add-NetNatStaticMapping

Add-NetNatStaticMapping

msft_netnatstaticmapping.cdxml

Synopsis

Adds a static mapping to a NAT instance.

Syntax

Add-NetNatStaticMapping [-NatName] [-AsJob] [-CimSession] [-InternalPort] [-InternalRoutingDomainId] [-RemoteExternalIPAddressPrefix] [-ThrottleLimit] [-ExternalIPAddress] [-ExternalPort] [-InternalIPAddress] [-Protocol] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

The Add-NetNatStaticMapping cmdlet adds a static mapping to a network address translation (NAT) instance. A static mapping enables an incoming connection from an external network to access a host on an internal network through the NAT.

You can use NAT to share a connection to the public Internet through a single interface with a single public IP address. The computers on the private network use private, non-routable addresses. NAT maps the private addresses to the public address.

Parameters

-AsJob <SwitchParameter>

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete. The cmdlet immediately returns an object that represents the job and then displays the command prompt. You can continue to work in the session while the job completes. To manage the job, use the *-Job cmdlets. To get the job results, use the Receive-Job cmdlet. For more information about Windows PowerShell® background jobs, see about_Jobs.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-CimSession <CimSession[]>

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Aliases

Session

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ExternalIPAddress <String>

Specifies the external IP address to which an incoming connection is addressed. This parameter specifies the destination IP address in the incoming packet

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ExternalPort <UInt16>

Specifies the external port to which an incoming connection is sent. This parameter specifies the destination port in the incoming TCP or UDP packets.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InternalIPAddress <String>

Specifies the IP address to which the packets from a remote machine in the external network are addressed.

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InternalPort <UInt16>

Specifies the internal port to which the packets from a remote machine in the external network are sent. If you do not specify this parameter, NAT uses the port that you specify for the ExternalPort parameter for the internal port.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-InternalRoutingDomainId <String>

Specifies the GUID of the routing domain of the internal interface.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-NatName <String>

Specifies the name of the NAT instance.

Aliases

None

Required?

true

Position

1

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Protocol <Protocol>

Specifies the network protocol of the client computer in the internal network. The acceptable values for this parameter are:  -- TCP -- UDP

Aliases

None

Required?

true

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-RemoteExternalIPAddressPrefix <String>

Specifies the IP address prefix of the remote computer on the external network.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-ThrottleLimit <Int32>

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Aliases

None

Required?

false

Position

named

Default value

None

Accept pipeline input?

false

Accept wildcard characters?

false

-Confirm <SwitchParameter>

Prompts you for confirmation before running the cmdlet.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

-WhatIf <SwitchParameter>

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type

None

Return Type

Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_NetNatStaticMapping

Notes

None

Examples

Example 1: Add a static mapping to a NAT instance

This command adds a static mapping to a NAT instance. The command specifies that NAT maps the external IP address to the internal IP address 192.0.02.179. The command specifies that the NAT maps the destination port 80 of the Internet resource to the source application port 8080. The command specifies that the tenant compartment that has the ID TSQATenant contains the internal address and internal port. This example uses the placeholder a.b.c.0/24 to represent a public Internet address prefix.

PS C:\> Add-NetNatStaticMapping -ExternalIPAddress "a.b.c.0/24" -ExternalPort 80 -InternalIPAddress "192.0.02.179" -InternalPort 8080 -InternalRoutingDomainId "{12345678-0000-0000-0000-123456789012}" 

Online Version
Get-NetNatStaticMapping
Remove-NetNatStaticMapping