Condividi tramite


Virtual Network Gateways - Vpn Device Configuration Script

Ottiene una rappresentazione in formato XML per lo script di configurazione del dispositivo VPN.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript?api-version=2023-11-01

Parametri dell'URI

Nome In Necessario Tipo Descrizione
resourceGroupName
path True

string

Nome del gruppo di risorse.

subscriptionId
path True

string

Credenziali della sottoscrizione che identificano in modo univoco la sottoscrizione di Microsoft Azure. L'ID sottoscrizione fa parte dell'URI per ogni chiamata al servizio.

virtualNetworkGatewayConnectionName
path True

string

Nome della connessione gateway di rete virtuale per cui viene generato lo script di configurazione.

api-version
query True

string

Versione dell'API client.

Corpo della richiesta

Nome Tipo Descrizione
deviceFamily

string

Famiglia di dispositivi per il dispositivo VPN.

firmwareVersion

string

Versione del firmware per il dispositivo VPN.

vendor

string

Fornitore per il dispositivo VPN.

Risposte

Nome Tipo Descrizione
200 OK

string

Rappresentazione in formato XML per lo script di configurazione del dispositivo VPN.

Other Status Codes

CloudError

Risposta di errore che descrive il motivo per cui l'operazione non è riuscita.

Sicurezza

azure_auth

Flusso OAuth2 di Azure Active Directory.

Tipo: oauth2
Flow: implicit
URL di autorizzazione: https://login.microsoftonline.com/common/oauth2/authorize

Ambiti

Nome Descrizione
user_impersonation rappresentare l'account utente

Esempio

GetVPNDeviceConfigurationScript

Esempio di richiesta

POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/connections/vpngw/vpndeviceconfigurationscript?api-version=2023-11-01

{
  "vendor": "Cisco",
  "deviceFamily": "ISR",
  "firmwareVersion": "IOS 15.1 (Preview)"
}

Risposta di esempio

"! Microsoft Corporation\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! Sample VPN tunnel configuration template for IOS-based devices\r\n!\r\n! This configuration template applies to Cisco VPN devices running IOS 15.1 or beyond (ISR or ASR)\r\n!\r\n\r\n\r\n\t\t\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! ACL rules\r\n!\r\n! Some VPN devices require explicit ACL rules to allow cross-premises traffic:\r\n!\r\n! 1. Allow traffic between on premises address ranges and VNet address ranges\r\n! 2. Allow IKE traffic (UDP:500) between on premises VPN devices and Azure VPN gateway\r\n! 3. Allow IPsec traffic (Proto:ESP) between on premises VPN devices and Azure VPN gateway\r\n!\r\n\t\t\r\naccess-list 101 permit ip 10.1.0.0 0.0.255.255 10.0.0.0 0.0.255.255\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! Internet Key Exchange (IKE) configuration\r\n!\r\n! This section specifies the authentication, encryption, hashing, and Diffie-Hellman group parameters for IKE\r\n! main mode or phase 1\r\n!\r\n\r\ncrypto ikev2 proposal SwaggerS2S-proposal\r\n  encryption DES3\r\n  integrity  SHA384\r\n  group      DHGroup24\r\n  lifetime   3600\r\n exit\r\n\r\ncrypto ikev2 policy SwaggerS2S-policy\r\n  proposal SwaggerS2S-proposal\r\n  exit\r\n\r\ncrypto ikev2 keyring SwaggerBranch-keyring\r\n\t\t\r\n\t\tpeer 52.173.199.254\r\n\t\taddress        52.173.199.254\r\n\t\tpre-shared-key lALEHuppeopJmA94exRNiRr2QzuZ6lOsvzu5IlJUEA6LthbTc8g5MTT86MCsGNMzGkTAaLuLnEJoD1Cn4cIlr94qKZm9drsgllzWvsPNezS71stAkaW1Bb7h6GBnDlDP\r\n  exit\r\n\r\ncrypto ikev2 profile  SwaggerS2S-profile\r\n  match address  local 10.3.0.0\r\n\tmatch identity remote address 52.173.199.254 255.255.255.255\r\n\t\t\r\n  authentication remote pre-share\r\n  authentication local  pre-share\r\n  keyring        SwaggerBranch-keyring\r\n  exit\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! IPsec configuration\r\n!\r\n! This section specifies encryption, authentication, tunnel mode properties for the Phase 2 negotiation\r\n!\r\ncrypto ipsec transform-set SwaggerS2S-TransformSet DES3 DES3\r\n mode  tunnel\r\n exit\r\n\r\n! ---------------------------------------------------------------------------------------------------------------------\r\n! Crypto map configuration\r\n!\r\n! This section defines a crypto profile that binds the cross-premises network traffic to the IPsec and IKE\r\n! policy profiles for this connection. Then defines the VTI (virtual tunnel interface) with the crypto\r\n! profile. A random interface number (tunnel 1) was used with a random link local address (169.254.0.1/28)\r\n! for the tunnel interface. If either selection is already used in the VPN device, please select another\r\n! interface number or address.  The only requirement is that they must not overlap with another interface\r\n! on the same VPN device.\r\n!\r\ncrypto ipsec profile SwaggerS2S-IPsecProfile\r\n  set transform-set  SwaggerS2S-TransformSet\r\n  set ikev2-profile  SwaggerS2S-profile\r\n  set pfs            None\r\n  set security-association lifetime 3600\r\n exit\r\n\r\n\r\nint tunnel 52.173.199.254\r\n  ip address 169.254.0.1 255.255.255.252\r\n  ip tcp adjust-mss 1350\r\n  tunnel source 10.3.0.0\r\n  tunnel mode ipsec ipv4\r\n  tunnel destination 52.173.199.254\r\n  tunnel protection ipsec profile SwaggerS2S-IPsecProfile\r\n  exit\r\n\r\n\tip route 10.0.0.0 255.255.0.0 tunnel 52.173.199.254 "

Definizioni

Nome Descrizione
CloudError

Risposta di errore dal servizio.

CloudErrorBody

Risposta di errore dal servizio.

VpnDeviceScriptParameters

Parametri di generazione di script di configurazione del dispositivo VPN.

CloudError

Risposta di errore dal servizio.

Nome Tipo Descrizione
error

CloudErrorBody

Corpo dell'errore cloud.

CloudErrorBody

Risposta di errore dal servizio.

Nome Tipo Descrizione
code

string

Identificatore dell'errore. I codici sono invarianti e devono essere utilizzati a livello di codice.

details

CloudErrorBody[]

Elenco di dettagli aggiuntivi sull'errore.

message

string

Messaggio che descrive l'errore, destinato a essere adatto per la visualizzazione in un'interfaccia utente.

target

string

Destinazione dell'errore specifico. Ad esempio, il nome della proprietà in errore.

VpnDeviceScriptParameters

Parametri di generazione di script di configurazione del dispositivo VPN.

Nome Tipo Descrizione
deviceFamily

string

Famiglia di dispositivi per il dispositivo VPN.

firmwareVersion

string

Versione del firmware per il dispositivo VPN.

vendor

string

Fornitore per il dispositivo VPN.