Add-NetNatExternalAddress
Add-NetNatExternalAddress
Adds an external address to a NAT instance.
Syntax
Parameter Set: cim:CreateInstance0
Add-NetNatExternalAddress [-NatName] <String> -IPAddress <String> [-AsJob] [-CimSession <CimSession[]> ] [-PortEnd <UInt16> ] [-PortStart <UInt16> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detailed Description
The Add-NetNatExternalAddress cmdlet adds an external address to a network address translation (NAT) instance.
Parameters
-AsJob
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 |
-IPAddress<String>
Specifies an external IP address for a NAT, as a string.
Aliases |
none |
Required? |
true |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-NatName<String>
Specifies the name for the NAT instance, as a string.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PortEnd<UInt16>
Specifies the high end of a dynamic port range from which to pick a port for a NAT session. Choose a port number that is greater than the PortStart parameter from the available ports. NAT associates a port number with an external address to identify the mapping between an internal network and an external network.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
65535 |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-PortStart<UInt16>
Specifies the low end of a dynamic port range from which to pick a port for a NAT session. Choose a port number that is less than the PortEnd parameter from the available ports. NAT associates a port number with an external address to identify the mapping between an internal network and an external network.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
1024 |
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
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 |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
- None
Outputs
The output type is the type of the objects that the cmdlet emits.
- Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_NetNatExternalAddress
Examples
Example 1: Add an external address
This command adds the external address 10.20.30.120 to a NAT. This example uses the placeholder a.b.c.0/24 to represent a public Internet address prefix.
PS C:\> Add-NetNatExternalAddress -IPAddress "a.b.c.0/24"
Example 2: Add an external address and a port range
This command adds an external address to a specified NAT, and specifies a range of ports to use for outbound connections. This example uses the placeholder a.b.c.0/24 to represent a public Internet address prefix.
PS C:\> Add-NetNatExternalAddress -IPAddress "a.b.c.0/24" -PortEnd 19999 -PortStart 10000