我需要帮助来诊断Azure和Cisco ASA VPN设备的站点到站点连接中的故障点。 连接types是基于策略的。 我在哪里可以findAzure中的日志?
没有办法直接查看日志,但我们可以下载VPN网关的诊断日志 。 为了存储日志,您应该将存储帐户和存储容器添加到VPN网关的同一个资源组中。 这里有一个例子(ARM)使用PowerShell来configurationVPN网关的诊断日志:
# VNET Resource Group and Name $rgName = 'your resource name' $vnetGwName = "your GW name" $timestamp = get-date -uFormat "%d%m%y@%H%M%S" # Details of existing Storage Account that will be used to collect the logs $storageAccountName = "storage account name" $storageAccountKey = 'storage account key' $captureDuration = 60 $storageContainer = "vpnlogs" $logDownloadPath = "D:\vpnlogs (create the folder first)" $Logfilename = "VPNDiagLog_" + $vnetGwName + "_" + $timestamp + ".txt" # Set Storage Context and VNET Gateway ID $storageContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey # NOTE: This is an Azure Service Manager cmdlet and so no AzureRM on this one. AzureRM will not work as we don't get the gatewayID with it. $vnetGws = Get-AzureVirtualNetworkGateway # Added check for only provisioned gateways as older deleted gateways of same name can also appear in results and capture will fail $vnetGwId = ($vnetGws | ? GatewayName -eq $vnetGwName | ? state -EQ "provisioned").GatewayID # Start Azure VNET Gateway logging Start-AzureVirtualNetworkGatewayDiagnostics ` -GatewayId $vnetGwId ` -CaptureDurationInSeconds $captureDuration ` -StorageContext $storageContext ` -ContainerName $storageContainer # Optional – Test VNET gateway connection to another server across the tunnel # Only use this if you are connected to the local network you are connecting to FROM Azure. Otherwise create some traffic across the link from on prem. # Test-NetConnection -ComputerName 10.0.0.4 -CommonTCPPort RDP # Wait for diagnostics capturing to complete Sleep -Seconds $captureDuration # Step 6 – Download VNET gateway diagnostics log $logUrl = ( Get-AzureVirtualNetworkGatewayDiagnostics -GatewayId $vnetGwId).DiagnosticsUrl $logContent = (Invoke-WebRequest -Uri $logUrl).RawContent $logContent | Out-File -FilePath $logDownloadPath\$Logfilename
这个脚本需要一一执行。
有关诊断日志的更多信息,请参阅链接 。