NAME
Add-NetNatStaticMapping
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] [
] 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 IPaddress. The computers on the private network use private, non-routable addresses. NAT maps the private addresses
to the public address.PARAMETERS
-AsJob [
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 PowerShellr background jobs, see about_Jobs. Required? false Position? named Default value Accept pipeline input? false Accept wildcard characters? false-CimSession
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, suchas 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
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
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
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
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
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
Specifies the name of the NAT instance. Required? true Position? 1 Default value Accept pipeline input? false Accept wildcard characters? false-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
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
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 PowerShellr 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 [
Prompts you for confirmation before running the cmdlet. Required? false Position? named Default value false Accept pipeline input? false Accept wildcard characters? false] -WhatIf [
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] This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). INPUTS
NoneOUTPUTS
Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_NetNatStaticMappingExample 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=294369Get-NetNatStaticMapping
Remove-NetNatStaticMapping