Set-AzVpnClientIpsecParameter
设置现有虚拟网络网关的 vpn ipsec 参数。
语法
ByFactoryName (默认值)
Set-AzVpnClientIpsecParameter
-VirtualNetworkGatewayName <String>
-ResourceGroupName <String>
-VpnClientIPsecParameter <PSVpnClientIPsecParameters>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByFactoryObject
Set-AzVpnClientIpsecParameter
-VirtualNetworkGatewayName <String>
-ResourceGroupName <String>
-VpnClientIPsecParameter <PSVpnClientIPsecParameters>
-InputObject <PSVirtualNetworkGateway>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ByResourceId
Set-AzVpnClientIpsecParameter
-VirtualNetworkGatewayName <String>
-ResourceGroupName <String>
-VpnClientIPsecParameter <PSVpnClientIPsecParameters>
-ResourceId <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
Set-AzVpnClientIpsecParameter cmdlet 为现有虚拟网络网关设置 vpn ipsec 参数。
创建虚拟网络网关时,它会在网关上设置默认 vpn ipsec 策略集。 如果点到站点用户想要使用某些自定义 ipsec 策略连接到 VPN 网关,用户必须先在 VPN 网关上设置该 ipsec 策略。
Set-AzVpnClientIpsecParameter 提供了一种执行此作的方法。
示例
示例 1:将自定义 vpn ipsec 策略设置为现有的虚拟网络网关。
$vpnclientipsecparams = New-AzVpnClientIpsecParameter -IpsecEncryption AES256 -IpsecIntegrity SHA256 -SALifeTime 86473 -SADataSize 429498 -IkeEncryption AES256 -IkeIntegrity SHA384 -DhGroup DHGroup2 -PfsGroup PFS2
$setvpnIpsecParams = Set-AzVpnClientIpsecParameter -VirtualNetworkGatewayName "ContosoLocalGateway" -ResourceGroupName "ContosoResourceGroup" -VpnClientIPsecParameter $vpnclientipsecparams
此示例将自定义 vpn ipsec 策略设置为名为 ContosoVirtualGateway 的现有虚拟网络网关,该网关来自名为 ContosoResourceGroup 的资源组。
New-AzVpnClientIpsecParameter cmdlet 用于创建 vpn ipsec 参数对象,该对象使用传递的一个或多个参数的值,用户可以为 ResourceGroup 中的任何现有虚拟网络网关设置这些值。
此创建的 VpnClientIPsecParameters 对象将传递给 Set-AzVpnClientIpsecParameter 命令,以在虚拟网络网关上设置指定的 Vpn ipsec 自定义策略,如上例所示。 此命令返回显示设置参数的 VpnClientIPsecParameters 的对象。
参数
-Confirm
在运行 cmdlet 之前,提示你进行确认。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
虚拟网络网关对象
ByFactoryObject
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-ResourceGroupName
资源组名称。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-ResourceId
Azure 资源 ID。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
ByResourceId
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-VirtualNetworkGatewayName
虚拟网络网关名称。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-VpnClientIPsecParameter
Vpn 客户端 ipsec 参数。 可以使用 PS 命令构造此参数值:New-AzVpnClientIpsecParameter
参数属性
参数集
(All)
| Position: | Named |
| 必需: | True |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。
命令脚本未运行。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输出