Add-NetNatStaticMapping
Add-NetNatStaticMapping
Adds a static mapping to a NAT instance.
Syntax
Parameter Set: cim:CreateInstance0
Add-NetNatStaticMapping [-NatName] <String> -ExternalIPAddress <String> -ExternalPort <UInt16> -InternalIPAddress <String> -Protocol <Protocol> [-AsJob] [-CimSession <CimSession[]> ] [-InternalPort <UInt16> ] [-InternalRoutingDomainId <String> ] [-RemoteExternalIPAddressPrefix <String> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Detaillierte Beschreibung
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.
Parameter
-AsJob
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-CimSession<CimSession[]>
Führt das Cmdlet in einer Remotesitzung oder auf einem Remotecomputer aus. Geben Sie einen Computernamen oder ein Sitzungsobjekt ein, z. B. die Ausgabe eines Cmdlets New-CimSession oder Get-CimSession. Der Standardwert ist die aktuelle Sitzung auf dem lokalen Computer.
Aliasse |
Session |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
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
Aliasse |
Keiner |
Erforderlich? |
true |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
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.
Aliasse |
Keiner |
Erforderlich? |
true |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-InternalIPAddress<String>
Specifies the IP address to which the packets from a remote machine in the external network are addressed.
Aliasse |
Keiner |
Erforderlich? |
true |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
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.
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-InternalRoutingDomainId<String>
Specifies the GUID of the routing domain of the internal interface.
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-NatName<String>
Specifies the name of the NAT instance.
Aliasse |
Keiner |
Erforderlich? |
true |
Position? |
1 |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-Protocol<Protocol>
Specifies the network protocol of the client computer in the internal network. Die folgenden Werte für diesen Parameter sind zulässig:
-- TCP
-- UDP
Aliasse |
Keiner |
Erforderlich? |
true |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-RemoteExternalIPAddressPrefix<String>
Specifies the IP address prefix of the remote computer on the external network.
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-ThrottleLimit<Int32>
Gibt die maximale Anzahl von gleichzeitigen Vorgängen an, die zum Ausführen dieses Cmdlets eingerichtet werden können. Wenn dieser Parameter ausgelassen oder der Wert 0
eingegeben wird, berechnet Windows PowerShell® einen optimalen Drosselungsgrenzwert für das Cmdlet basierend auf der Anzahl der CIM-Cmdlets, die auf dem Computer ausgeführt werden. Die Drosselungsgrenze gilt nur für das aktuelle Cmdlet und nicht für die Sitzung oder den Computer.
Aliasse |
Keiner |
Erforderlich? |
false |
Position? |
named |
Standardwert |
Keiner |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-Confirm
Sie werden vor dem Ausführen des Cmdlets zur Bestätigung aufgefordert.
Erforderlich? |
false |
Position? |
named |
Standardwert |
falsch |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
-WhatIf
Zeigt, was geschieht, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.
Erforderlich? |
false |
Position? |
named |
Standardwert |
falsch |
Pipelineeingaben akzeptieren? |
false |
Platzhalterzeichen akzeptieren? |
false |
<CommonParameters>
Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Eingaben
Der Eingabetyp ist der Typ der Objekte, die über die Pipeline an das Cmdlet übergeben werden können.
- None
Ausgaben
Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.
- Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_NetNatStaticMapping
Beispiele
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}"