Utilizzare CreateCustomerGateway con una CLI - Amazon Elastic Compute Cloud

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

Utilizzare CreateCustomerGateway con una CLI

Gli esempi di codice seguenti mostrano come utilizzare CreateCustomerGateway.

CLI
AWS CLI

Come creare un gateway del cliente

Questo esempio crea un gateway del cliente con l’indirizzo IP specificato per la relativa interfaccia esterna.

Comando:

aws ec2 create-customer-gateway --type ipsec.1 --public-ip 12.1.2.3 --bgp-asn 65534

Output:

{ "CustomerGateway": { "CustomerGatewayId": "cgw-0e11f167", "IpAddress": "12.1.2.3", "State": "available", "Type": "ipsec.1", "BgpAsn": "65534" } }
PowerShell
Strumenti per PowerShell V4

Esempio 1: questo esempio crea il gateway del cliente specificato.

New-EC2CustomerGateway -Type ipsec.1 -PublicIp 203.0.113.12 -BgpAsn 65534

Output:

BgpAsn : 65534 CustomerGatewayId : cgw-1a2b3c4d IpAddress : 203.0.113.12 State : available Tags : {} Type : ipsec.1
  • Per i dettagli sull'API, vedere CreateCustomerGatewayin AWS Strumenti per PowerShell Cmdlet Reference (V4).

Strumenti per V5 PowerShell

Esempio 1: questo esempio crea il gateway del cliente specificato.

New-EC2CustomerGateway -Type ipsec.1 -PublicIp 203.0.113.12 -BgpAsn 65534

Output:

BgpAsn : 65534 CustomerGatewayId : cgw-1a2b3c4d IpAddress : 203.0.113.12 State : available Tags : {} Type : ipsec.1
  • Per i dettagli sull'API, vedere CreateCustomerGatewayin AWS Strumenti per PowerShell Cmdlet Reference (V5).

Per un elenco completo delle guide per sviluppatori AWS SDK e degli esempi di codice, vedere. Crea EC2 risorse Amazon utilizzando un AWS SDK Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell’SDK.