Forum Discussion

Per_Austreng's avatar
Per_Austreng
Copper Contributor
Oct 04, 2019

Show config elements for existing S2S VPN

So, I'm painfully new to all things cloud.    I'm trying to use Powershell AZ module to identify all the components of our Site to Site VPN connection from Azure to a partners OnPrem network.  I got it set up and functional the fly and did not have the visibility to document the steps.

 

I'm trying to use Powershell to view all of the parameters of the one S2S Connection, including IPSec (one part I havent found yet, there may be more).  Here is what I have so far:

 

Get-AzVirtualNetworkGateway -Name CNGName -ResourceGroupName RGName

Get-AzVirtualNetworkGatewayConnection -Name VNGConnName -ResourceGroupName RGName

Get-AzLocalNetworkGateway -Name LNGName -ResourceGroupName RGName

 

I dont see the IPSec Policy components; how do I see those?  

 

Am I missing anything else?

 

  • Bryan Haslip's avatar
    Bryan Haslip
    Iron Contributor

    This is what you are looking for. You can always download a generic configuration as well from the portal. You can use PowerShell  or CLI to change the configuration to different values than what is default. I will also attach the Microsoft Docs page that outlines this. 

     

    $RG = "TestRG1"
    $GWName = "VNet1GW"
    $Connection = "VNet1toSite1"

     

    # List the available VPN device models and versions
    Get-AzVirtualNetworkGatewaySupportedVpnDevice -Name $GWName -ResourceGroupName $RG

    # Download the configuration script for the connection
    Get-AzVirtualNetworkGatewayConnectionVpnDeviceConfigScript -Name $Connection -ResourceGroupName $RG -DeviceVendor Juniper -DeviceFamily Juniper_SRX_GA -FirmwareVersion Juniper_SRX_12.x_GA

     

    Download VPN device configuration scripts - https://docs.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-download-vpndevicescript

     

     Per_Austreng 

Resources