Sono disponibili altri esempi AWS SDK nel repository AWS Doc SDK
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
-
Per creare un gateway per i clienti
Questo esempio crea un gateway per i clienti con l'indirizzo IP specificato per la relativa interfaccia esterna.
Comando:
aws ec2 create-customer-gateway --type
ipsec.1
--public-ip12.1.2.3
--bgp-asn65534
Output:
{ "CustomerGateway": { "CustomerGatewayId": "cgw-0e11f167", "IpAddress": "12.1.2.3", "State": "available", "Type": "ipsec.1", "BgpAsn": "65534" } }
-
Per i dettagli sull'API, consulta CreateCustomerGateway AWS CLI
Command Reference.
-
- PowerShell
-
- Strumenti per PowerShell V4
-
Esempio 1: questo esempio crea il gateway per i clienti 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 per i clienti 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).
-