< Back

Add-NetNatStaticMapping

Tue Jan 29, 2019 10:26 pm

NAME Add-NetNatStaticMapping



SYNOPSIS

Adds a static mapping to a NAT instance.





SYNTAX

Add-NetNatStaticMapping [-NatName] <String> [-AsJob] [-CimSession <CimSession[]>] [-InternalPort <UInt16>] [-InternalRoutingDomainId <String>]

[-RemoteExternalIPAddressPrefix <String>] [-ThrottleLimit <Int32>] -ExternalIPAddress <String> -ExternalPort <UInt16> -InternalIPAddress <String>

-Protocol <Protocol> [-Confirm] [-WhatIf] [<CommonParameters>]





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.



Required? false

Position? named

Default value

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.



Required? false

Position? named

Default value

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



Required? true

Position? named

Default value

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.



Required? true

Position? named

Default value

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.



Required? true

Position? named

Default value

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.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-InternalRoutingDomainId <String>

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



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-NatName <String>

Specifies the name of the NAT instance.



Required? true

Position? 1

Default value

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



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-RemoteExternalIPAddressPrefix <String>

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



Required? false

Position? named

Default value

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.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



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.



Required? false

Position? named

Default value false

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None







OUTPUTS

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







Example 1: Add a static mapping to a NAT instance



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}"



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.



RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=294369

Get-NetNatStaticMapping

Remove-NetNatStaticMapping