New-AzureRmIpsecPolicy

Creates an IPSec Policy.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

New-AzureRmIpsecPolicy
   [-SALifeTimeSeconds <Int32>]
   [-SADataSizeKilobytes <Int32>]
   -IpsecEncryption <String>
   -IpsecIntegrity <String>
   -IkeEncryption <String>
   -IkeIntegrity <String>
   -DhGroup <String>
   -PfsGroup <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzureRmIpsecPolicy cmdlet creates an IPSec policy proposal to be used in a virtual network gateway connection.

Examples

Example 1

PS C:\> $ipsecPolicy = New-AzureRmIpsecPolicy -SALifeTimeSeconds 1000 -SADataSizeKilobytes 2000 -IpsecEncryption "GCMAES256" -IpsecIntegrity "GCMAES256" -IkeEncryption "AES256" -IkeIntegrity "SHA256" -DhGroup "DHGroup14" -PfsGroup "PFS2048"
PS C:\> New-AzureRmVirtualNetworkGatewayConnection -ResourceGroupName $rgname -name $vnetConnectionName -location $location -VirtualNetworkGateway1 $vnetGateway -LocalNetworkGateway2 $localnetGateway -ConnectionType IPsec -RoutingWeight 3 -SharedKey $sharedKey -UsePolicyBasedTrafficSelectors $true -IpsecPolicies $ipsecPolicy

Creating an IPSec policy to be used for a new virtual network gateway connection.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DhGroup

The DH Groups used in IKE Phase 1 for initial SA

Type:String
Accepted values:None, DHGroup1, DHGroup14, DHGroup2, DHGroup2048, DHGroup24, ECP256, ECP384
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-IkeEncryption

The IKE encryption algorithm (IKE Phase 2)

Type:String
Accepted values:DES, DES3, AES128, AES192, AES256
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-IkeIntegrity

The IKE integrity algorithm (IKE Phase 2)

Type:String
Accepted values:MD5, SHA1, SHA256, SHA384
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-IpsecEncryption

The IPSec encryption algorithm (IKE Phase 1)

Type:String
Accepted values:None, DES, DES3, AES128, AES192, AES256, GCMAES128, GCMAES192, GCMAES256
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-IpsecIntegrity

The IPSec integrity algorithm (IKE Phase 1)

Type:String
Accepted values:MD5, SHA1, SHA256, GCMAES128, GCMAES192, GCMAES256
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PfsGroup

The DH Groups used in IKE Phase 2 for new child SA

Type:String
Accepted values:None, PFS1, PFS2, PFS2048, PFS24, ECP256, ECP384
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SADataSizeKilobytes

The IPSec Security Association (also called Quick Mode or Phase 2 SA) payload size in KB

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SALifeTimeSeconds

The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

PSIpsecPolicy