Share via


Add-NetNatExternalAddress

Add-NetNatExternalAddress

Adds an external address to a NAT instance.

Sintassi

Parameter Set: cim:CreateInstance0
Add-NetNatExternalAddress [-NatName] <String> -IPAddress <String> [-AsJob] [-CimSession <CimSession[]> ] [-PortEnd <UInt16> ] [-PortStart <UInt16> ] [-ThrottleLimit <Int32> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Descrizione dettagliata

The Add-NetNatExternalAddress cmdlet adds an external address to a network address translation (NAT) instance.

Parametri

-AsJob

Alias

nessuno

Obbligatorio?

false

Posizione?

named

Valore predefinito

nessuno

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

-CimSession<CimSession[]>

Esegue il cmdlet in una sessione remota o in un computer remoto. Immettere un nome di computer o un oggetto di sessione, ad esempio l'output del cmdlet New-CimSession o Get-CimSession. Il valore predefinito è la sessione corrente nel computer locale.

Alias

Session

Obbligatorio?

false

Posizione?

named

Valore predefinito

nessuno

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

-IPAddress<String>

Specifies an external IP address for a NAT, as a string.

Alias

nessuno

Obbligatorio?

true

Posizione?

named

Valore predefinito

nessuno

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

-NatName<String>

Specifies the name for the NAT instance, as a string.

Alias

nessuno

Obbligatorio?

true

Posizione?

1

Valore predefinito

nessuno

Accetta input da pipeline?

false

Accetta caratteri jolly?

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.

Alias

nessuno

Obbligatorio?

false

Posizione?

named

Valore predefinito

65535

Accetta input da pipeline?

false

Accetta caratteri jolly?

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.

Alias

nessuno

Obbligatorio?

false

Posizione?

named

Valore predefinito

1024

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

-ThrottleLimit<Int32>

Specifica il numero massimo di operazioni simultanee che è possibile stabilire per eseguire il cmdlet. Se il parametro viene omesso o si specifica il valore 0, Windows PowerShell® calcola un valore limite ottimale per il cmdlet basato sul numero di cmdlet CIM in esecuzione nel computer. Questo valore limite si applica solo al cmdlet corrente, non alla sessione o al computer.

Alias

nessuno

Obbligatorio?

false

Posizione?

named

Valore predefinito

nessuno

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

-Confirm

Richiede conferma prima di eseguire il cmdlet.

Obbligatorio?

false

Posizione?

named

Valore predefinito

False

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

-WhatIf

Mostra gli effetti dell'esecuzione del cmdlet. Il cmdlet non viene eseguito.

Obbligatorio?

false

Posizione?

named

Valore predefinito

False

Accetta input da pipeline?

false

Accetta caratteri jolly?

false

<CommonParameters>

Questo cmdlet supporta i parametri comuni: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer e -OutVariable. Per altre informazioni, vedere   about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Input

Il tipo di input è il tipo degli oggetti che è possibile reindirizzare al cmdlet.

  • None

Output

Il tipo di output corrisponde al tipo di oggetti generati dal cmdlet.

  • Microsoft.Management.Infrastructure.CimInstance#ROOT/StandardCimv2/MSFT_NetNatExternalAddress

Esempi

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 

Argomenti correlati

Get-NetNatExternalAddress

Remove-NetNatExternalAddress