Edit

Share via


New-AzVpnClientIpsecPolicy

This command allows the users to create the Vpn ipsec policy object specifying one or all values such as IpsecEncryption,IpsecIntegrity,IkeEncryption,IkeIntegrity,DhGroup,PfsGroup to set on the VPN gateway. This command let output object is used to set vpn ipsec policy for both new / existing gateway.

Syntax

Default (Default)

New-AzVpnClientIpsecPolicy
    [-SALifeTime <Int32>]
    [-SADataSize <Int32>]
    [-IpsecEncryption <String>]
    [-IpsecIntegrity <String>]
    [-IkeEncryption <String>]
    [-IkeIntegrity <String>]
    [-DhGroup <String>]
    [-PfsGroup <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

This command allows the users to create the Vpn ipsec policy object specifying one or all values such as IpsecEncryption,IpsecIntegrity,IkeEncryption,IkeIntegrity,DhGroup,PfsGroup to set on the VPN gateway. This command let output object is used to set vpn ipsec policy for both new / existing gateway.

Examples

Example 1: Define vpn ipsec policy object:

$vpnclientipsecpolicy = New-AzVpnClientIpsecPolicy -IpsecEncryption AES256 -IpsecIntegrity SHA256 -SALifeTime 86472 -SADataSize 429497 -IkeEncryption AES256 -IkeIntegrity SHA256 -DhGroup DHGroup2 -PfsGroup None

This cmdlet is used to create the vpn ipsec policy object using the passed one or all parameters' values which user can pass to param:VpnClientIpsecPolicy of PS command let: New-AzVirtualNetworkGateway (New VPN Gateway creation) / Set-AzVirtualNetworkGateway (existing VPN Gateway update) in ResourceGroup :

Example 2: Create new virtual network gateway with setting vpn custom ipsec policy:

$vnetGateway = New-AzVirtualNetworkGateway -ResourceGroupName vnet-gateway -name myNGW -location $location -IpConfigurations $vnetIpConfig -GatewayType Vpn -VpnType RouteBased -GatewaySku VpnGw1 -VpnClientIpsecPolicy $vpnclientipsecpolicy

This cmdlet returns virtual network gateway object after creation.

Example 3: Set vpn custom ipsec policy on existing virtual network gateway:

$vnetGateway = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway -VpnClientIpsecPolicy $vpnclientipsecpolicy

This cmdlet returns virtual network gateway object after setting vpn custom ipsec policy.

Example 4: Get virtual network gateway to see if vpn custom policy is set correctly:

$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName vnet-gateway -name myNGW

This cmdlet returns virtual network gateway object.

Parameters

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DhGroup

The VpnClient DH Groups used in IKE Phase 1 for initial SA

Parameter properties

Type:String
Default value:None
Accepted values:DHGroup24, ECP384, ECP256, DHGroup14, DHGroup2
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IkeEncryption

The VpnClient IKE encryption algorithm (IKE Phase 2)

Parameter properties

Type:String
Default value:None
Accepted values:GCMAES256, GCMAES128, AES256, AES128
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IkeIntegrity

The VpnClient IKE integrity algorithm (IKE Phase 2)

Parameter properties

Type:String
Default value:None
Accepted values:SHA384, SHA256
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IpsecEncryption

The VpnClient IPSec encryption algorithm (IKE Phase 1)

Parameter properties

Type:String
Default value:None
Accepted values:GCMAES256, GCMAES128, AES256, AES128
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IpsecIntegrity

The VpnClient IPSec integrity algorithm (IKE Phase 1)

Parameter properties

Type:String
Default value:None
Accepted values:GCMAES256, GCMAES128, SHA256
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-PfsGroup

The VpnClient PFS Groups used in IKE Phase 2 for new child SA

Parameter properties

Type:String
Default value:None
Accepted values:PFS24, PFSMM, ECP384, ECP256, PFS14, PFS2, None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SADataSize

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SALifeTime

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

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

None

Outputs

PSIpsecPolicy