No results found
We couldn't find anything using that term, please try searching for something else.
2024-11-13 Configure custom IPsec/IKE connection policies for S2S VPN and VNet-to-VNet: Azure portal Article04/04/2024 In this article This a
This article walks you through the steps configure IPsec/IKE policy for VPN Gateway Site-to-Site VPN or VNet-to-VNet connections using the Azure portal. The following sections help you create and configure an IPsec/IKE policy, and apply the policy a new or existing connection.
The instructions in this article help you set up and configure IPsec/IKE policies as shown in the following diagram.
IPsec and IKE protocol standard supports a wide range of cryptographic algorithms in various combinations. Refer About cryptographic requirements and Azure VPN gateways see how this can help ensure cross-premises and VNet-to-VNet connectivity satisfy your compliance or security requirements. Be aware of the following considerations:
The following table lists the supported configurable cryptographic algorithms and key strengths.
IPsec/IKEv2 | Options |
---|---|
IKEv2 encryption | GCMAES256, GCMAES128, AES256, AES192, AES128 |
IKEv2 integrity | SHA384, SHA256, SHA1, MD5 |
DH group | DHGroup24, ECP384, ECP256, DHGroup14, DHGroup2048, DHGroup2, DHGroup1, None |
IPsec encryption | GCMAES256, GCMAES192, GCMAES128, AES256, AES192, AES128, DES3, DES, None |
IPsec integrity | GCMAES256 , GCMAES192 , GCMAES128 , SHA256 , SHA1 , MD5 |
PFS group | PFS24, ECP384, ECP256, PFS2048, PFS2, PFS1, None |
Quick Mode SA lifetime | (Optional; default values if not specified) Seconds (integer; minimum 300, default 27,000) Kilobytes (integer; minimum 1,024, default 10,2400,000) |
Traffic selector | UsePolicyBasedTrafficSelectors ($True or $ False , but optional; default $ False if not specified) |
DPD timeout | Seconds (integer; minimum 9, maximum 3,600, default 45) |
– premises VPN device configuration is match match contain following algorithms parameters specify Azure IPsec IKE policy :
UsePolicyBasedTrafficSelectors
)If you use GCMAES for the IPsec encryption algorithm, you must select the same GCMAES algorithm and key length for IPsec integrity. For example, use GCMAES128 for both.
table algorithms keys :
IKE Main Mode SA lifetime is fixed at 28,800 seconds on the Azure VPN gateways.
UsePolicyBasedTrafficSelectors
is an optional parameter on the connection. If you set UsePolicyBasedTrafficSelectors
$True
on a connection, it configures the VPN gateway connect an on-premises policy-based VPN firewall.
If you enable UsePolicyBasedTrafficSelectors
, ensure that your VPN device has the matching traffic selectors defined with all combinations of your on-premises network (local network gateway) prefixes or from the Azure virtual network prefixes, instead of any-to-any. The VPN gateway accepts whatever traffic selector the remote VPN gateway proposes, irrespective of what’s configured on the VPN gateway.
For example, if your on-premises network prefixes are 10.1.0.0/16 and 10.2.0.0/16, and your virtual network prefixes are 192.168.0.0/16 and 172.16.0.0/16, you need specify the following traffic selectors:
For more information about policy-based traffic selectors, see Connect a VPN gateway multiple on-premises policy-based VPN devices.
Setting the timeout shorter periods causes IKE rekey more aggressively. The connection can then appear be disconnected in some instances. This situation might not be desirable if your on-premises locations are farther away from the Azure region where the VPN gateway resides, or if the physical link condition could incur packet loss. We generally recommend that you set the timeout 30 45 seconds.
Note
IKEv2 Integrity is used for both Integrity and PRF(pseudo-random function).
If IKEv2 Encryption algorithm specified is GCM*, the value passed in IKEv2 Integrity is used for PRF only and implicitly we set IKEv2 Integrity GCM*. In all other cases, the value passed in IKEv2 Integrity is used for both IKEv2 Integrity and PRF.
The following table lists the corresponding Diffie-Hellman groups supported by the custom policy:
Diffie-Hellman group | DHGroup | PFSGroup | Key length |
---|---|---|---|
1 | DHGroup1 | PFS1 | 768-bit MODP |
2 | DHGroup2 | PFS2 | 1024 – bit MODP |
14 | DHGroup14 DHGroup2048 |
PFS2048 | 2048 – bit MODP |
19 | ECP256 | ECP256 | 256-bit ECP |
20 | ECP384 | ECP384 | 384-bit ECP |
24 | DHGroup24 | PFS24 | 2048 – bit MODP |
For more information, see RFC3526 and RFC5114.
This section walks you through the steps create a Site-to-Site VPN connection with an IPsec/IKE policy. The following steps create the connection as shown in the following diagram. The on-premises site in this diagram represents Site6.
Create the following resources. For steps, see Create a Site-to-Site VPN connection.
Create the virtual network TestVNet1 using the following values.
Create virtual network gatewayVNet1GW using the following values.
Create the local network gateway resource Site6 using the following values.
From the virtual network gateway, add a connection the local network gateway using the following values.
Configure a custom IPsec/IKE policy with the following algorithms and parameters:
Go the Connection resource created ,VNet1toSite6. Open the Configuration page. Select Custom IPsec/IKE policy show all configuration options. The following screenshot shows the configuration according the list:
If you use GCMAES for IPsec, you must use the same GCMAES algorithm and key length for both IPsec encryption and integrity. For example, the following screenshot specifies GCMAES128 for both IPsec encryption and IPsec integrity:
If you want enable Azure VPN gateway connect policy-based on-premises VPN devices, you can select Enable for the Use policy based traffic selectors option.
Once all the options are selected, selectSave commit the changes the connection resource. The policy will be enforced in about a minute.
Important
Once an IPsec/IKE policy is specified on a connection, the Azure VPN gateway will only send or accept the IPsec/IKE proposal with specified cryptographic algorithms and key strengths on that particular connection. Make sure your on-premises VPN device for the connection uses or accepts the exact policy combination, otherwise the S2S VPN tunnel will not establish.
Policy-based traffic selector and DPD timeout options can be specified with Default policy, without the custom IPsec/IKE policy.
The steps create a VNet-to-VNet connection with an IPsec/IKE policy are similar that of an S2S VPN connection. You must complete the previous sections in Create an S2S vpn connection create and configure TestVNet1 and the VPN gateway.
Use the steps in the Create a VNet-to-VNet connection article create TestVNet2, and create a VNet-to-VNet connection TestVNet1.
Example values:
Virtual network TestVNet2
VPN gateway: VNet2GW
From the VNet1GW gateway, add a VNet-to-VNet connection VNet2GW named VNet1toVNet2.
Next, from the VNet2GW, add a VNet-to-VNet connection VNet1GW named VNet2toVNet1.
After you add the connections, you’ll see the VNet-to-VNet connections as shown in the following screenshot from the VNet2GW resource:
From the VNet1toVNet2 connection resource, go the Configuration page.
For IPsec / IKE policy, selectCustom show the custom policy options. Select the cryptographic algorithms with the corresponding key lengths. This policy doesn’t need match the previous policy you created for the VNet1toSite6 connection.
Example values:
Select Save at the top of the page apply the policy changes on the connection resource.
Apply the same policy the VNet2toVNet1 connection, VNet2toVNet1. If you don’t, the IPsec/IKE VPN tunnel won’t connect due policy mismatch.
Important
Once an IPsec/IKE policy is specified on a connection, the Azure VPN gateway will only send or accept
the IPsec/IKE proposal with specified cryptographic algorithms and key strengths on that particular
connection. Make sure the IPsec policies for both connections are the same, otherwise the
VNet-to-VNet connection will not establish.
complete steps , connection established minutes , following network topology .
To view frequently asked questions, go the IPsec/IKE policy section of the VPN Gateway FAQ.
information policy – based traffic selectors , Connect multiple – premises policy – based VPN devices .