你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Microsoft.Network vpnGateways

Bicep 资源定义

vpnGateways 资源类型可以通过针对以下操作进行部署:

有关每个 API 版本中更改的属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Network/vpnGateways 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.Network/vpnGateways@2023-11-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  properties: {
    bgpSettings: {
      asn: int
      bgpPeeringAddress: 'string'
      bgpPeeringAddresses: [
        {
          customBgpIpAddresses: [
            'string'
          ]
          ipconfigurationId: 'string'
        }
      ]
      peerWeight: int
    }
    connections: [
      {
        id: 'string'
        name: 'string'
        properties: {
          connectionBandwidth: int
          dpdTimeoutSeconds: int
          enableBgp: bool
          enableInternetSecurity: bool
          enableRateLimiting: bool
          ipsecPolicies: [
            {
              dhGroup: 'string'
              ikeEncryption: 'string'
              ikeIntegrity: 'string'
              ipsecEncryption: 'string'
              ipsecIntegrity: 'string'
              pfsGroup: 'string'
              saDataSizeKilobytes: int
              saLifeTimeSeconds: int
            }
          ]
          remoteVpnSite: {
            id: 'string'
          }
          routingConfiguration: {
            associatedRouteTable: {
              id: 'string'
            }
            inboundRouteMap: {
              id: 'string'
            }
            outboundRouteMap: {
              id: 'string'
            }
            propagatedRouteTables: {
              ids: [
                {
                  id: 'string'
                }
              ]
              labels: [
                'string'
              ]
            }
            vnetRoutes: {
              staticRoutes: [
                {
                  addressPrefixes: [
                    'string'
                  ]
                  name: 'string'
                  nextHopIpAddress: 'string'
                }
              ]
              staticRoutesConfig: {
                vnetLocalRouteOverrideCriteria: 'string'
              }
            }
          }
          routingWeight: int
          sharedKey: 'string'
          trafficSelectorPolicies: [
            {
              localAddressRanges: [
                'string'
              ]
              remoteAddressRanges: [
                'string'
              ]
            }
          ]
          useLocalAzureIpAddress: bool
          usePolicyBasedTrafficSelectors: bool
          vpnConnectionProtocolType: 'string'
          vpnLinkConnections: [
            {
              id: 'string'
              name: 'string'
              properties: {
                connectionBandwidth: int
                dpdTimeoutSeconds: int
                egressNatRules: [
                  {
                    id: 'string'
                  }
                ]
                enableBgp: bool
                enableRateLimiting: bool
                ingressNatRules: [
                  {
                    id: 'string'
                  }
                ]
                ipsecPolicies: [
                  {
                    dhGroup: 'string'
                    ikeEncryption: 'string'
                    ikeIntegrity: 'string'
                    ipsecEncryption: 'string'
                    ipsecIntegrity: 'string'
                    pfsGroup: 'string'
                    saDataSizeKilobytes: int
                    saLifeTimeSeconds: int
                  }
                ]
                routingWeight: int
                sharedKey: 'string'
                useLocalAzureIpAddress: bool
                usePolicyBasedTrafficSelectors: bool
                vpnConnectionProtocolType: 'string'
                vpnGatewayCustomBgpAddresses: [
                  {
                    customBgpIpAddress: 'string'
                    ipConfigurationId: 'string'
                  }
                ]
                vpnLinkConnectionMode: 'string'
                vpnSiteLink: {
                  id: 'string'
                }
              }
            }
          ]
        }
      }
    ]
    enableBgpRouteTranslationForNat: bool
    isRoutingPreferenceInternet: bool
    natRules: [
      {
        id: 'string'
        name: 'string'
        properties: {
          externalMappings: [
            {
              addressSpace: 'string'
              portRange: 'string'
            }
          ]
          internalMappings: [
            {
              addressSpace: 'string'
              portRange: 'string'
            }
          ]
          ipConfigurationId: 'string'
          mode: 'string'
          type: 'string'
        }
      }
    ]
    virtualHub: {
      id: 'string'
    }
    vpnGatewayScaleUnit: int
  }
}

属性值

vpnGateways

名称 说明
name 资源名称 字符串 (必需)

字符限制:1-80

有效字符:
字母数字、下划线字符、句点和连字符。

以字母数字开头。 以字母数字或下划线结尾。
location 资源位置。 字符串
标记 资源标记。 标记名称和值的字典。 请参阅 模板中的标记
properties VPN 网关的属性。 VpnGatewayProperties

VpnGatewayProperties

名称 说明
bgpSettings 本地网关的 BGP 扬声器设置。 BgpSettings
connections 到网关的所有 VPN 连接的列表。 VpnConnection[]
enableBgpRouteTranslationForNat 在此 VpnGateway 上为 NAT 启用 BGP 路由转换。 bool
isRoutingPreferenceInternet 为 VpnGateway 的公共 IP 接口启用路由首选项属性。 bool
natRules 与网关关联的所有 nat 规则的列表。 VpnGatewayNatRule[]
virtualHub 网关所属的 VirtualHub。 SubResource
vpnGatewayScaleUnit 此 VPN 网关的缩放单元。 int

BgpSettings

名称 说明
asn BGP 扬声器的 ASN。 int

约束:
最小值 = 0
最大值 = 4294967295
bgpPeeringAddress 此 BGP 扬声器的 BGP 对等互连地址和 BGP 标识符。 字符串
bgpPeeringAddresses 具有虚拟网络网关 IP 配置 ID 的 BGP 对等互连地址。 IPConfigurationBgpPeeringAddress[]
peerWeight 添加到从此 BGP 扬声器学习的路由的权重。 int

IPConfigurationBgpPeeringAddress

名称 说明
customBgpIpAddresses 属于 IP 配置的自定义 BGP 对等互连地址的列表。 string[]
ipconfigurationId 属于网关的 IP 配置的 ID。 字符串

VpnConnection

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties VPN 连接的属性。 VpnConnectionProperties

VpnConnectionProperties

名称 说明
connectionBandwidth 预期带宽(以 MBPS 为单位)。 int
dpdTimeoutSeconds VPN 连接的 DPD 超时(以秒为单位)。 int
enableBgp EnableBgp 标志。 bool
enableInternetSecurity 启用 Internet 安全性。 bool
enableRateLimiting EnableBgp 标志。 bool
ipsecPolicies 此连接要考虑的 IPSec 策略。 IpsecPolicy[]
remoteVpnSite 已连接的 VPN 站点的 ID。 SubResource
routingConfiguration 路由配置,指示此连接上关联的和传播的路由表。 RoutingConfiguration
routingWeight VPN 连接的路由权重。 int
sharedKey Vpn 连接的 SharedKey。 字符串
trafficSelectorPolicies 此连接要考虑的流量选择器策略。 TrafficSelectorPolicy[]
useLocalAzureIpAddress 使用本地 Azure IP 启动连接。 bool
usePolicyBasedTrafficSelectors 启用基于策略的流量选择器。 bool
vpnConnectionProtocolType 用于此连接的连接协议。 “IKEv1”
'IKEv2'
vpnLinkConnections 到网关的所有 VPN 站点链接连接的列表。 VpnSiteLinkConnection[]

IpsecPolicy

名称 说明
dhGroup 在 IKE 阶段 1 中用于初始 SA 的 DH 组。 “DHGroup1”
'DHGroup14'
'DHGroup2'
'DHGroup2048'
'DHGroup24'
“ECP256”
“ECP384”
“None” (必需)
ikeEncryption IKE 加密算法 (IKE 阶段 2) 。 “AES128”
“AES192”
“AES256”
'DES'
“DES3”
“GCMAES128”
需要“GCMAES256” ()
ikeIntegrity IKE 第 2 阶段) (IKE 完整性算法。 “GCMAES128”
“GCMAES256”
'MD5'
“SHA1”
“SHA256”
需要“SHA384” ()
ipsecEncryption IPSec 加密算法 (IKE 阶段 1) 。 “AES128”
“AES192”
“AES256”
“DES”
“DES3”
“GCMAES128”
“GCMAES192”
“GCMAES256”
“None” (必需)
ipsecIntegrity IPSec 完整性算法 (IKE 阶段 1) 。 “GCMAES128”
“GCMAES192”
“GCMAES256”
“MD5”
“SHA1”
需要“SHA256” ()
pfsGroup IKE 阶段 2 中用于新子 SA 的 Pfs 组。 “ECP256”
“ECP384”
“None”
“PFS1”
“PFS14”
“PFS2”
“PFS2048”
“PFS24”
需要“PFSMM” ()
saDataSizeKilobytes IPSec 安全关联 (也称为快速模式或阶段 2 SA) 站点到站点 VPN 隧道的有效负载大小(以 KB 为单位)。 int (必需)
saLifeTimeSeconds IPSec 安全关联 (也称为快速模式或阶段 2 SA) 站点到站点 VPN 隧道的生存期(以秒为单位)。 int (必需)

SubResource

名称 说明 Value
id 资源 ID。 字符串

RoutingConfiguration

名称 说明
associatedRouteTable 与此 RoutingConfiguration 关联的资源 ID RouteTable。 SubResource
inboundRouteMap 与此 RoutingConfiguration 关联的 RouteMap 的资源 ID,用于入站学习的路由。 SubResource
outboundRouteMap 与出站播发路由的此 RoutingConfiguration 关联的RouteMap 的资源 ID。 SubResource
propagatedRouteTables 要向其播发路由的 RouteTable 列表。 PropagatedRouteTable
vnetRoutes 控制从 VirtualHub 到虚拟网络连接的路由的路由列表。 VnetRoute

PropagatedRouteTable

名称 说明
ids 所有 RouteTable 的资源 ID 列表。 SubResource[]
标签 标签列表。 string[]

VnetRoute

名称 说明
staticRoutes 所有静态路由的列表。 StaticRoute[]
staticRoutesConfig 此 HubVnetConnection 上的静态路由的配置。 StaticRoutesConfig

StaticRoute

名称 说明
addressPrefixes 所有地址前缀的列表。 string[]
name 在 VnetRoute 中唯一的 StaticRoute 的名称。 字符串
nextHopIpAddress 下一跃点的 IP 地址。 字符串

StaticRoutesConfig

名称 说明
vnetLocalRouteOverrideCriteria 参数,确定辐射 vnet 中的 NVA 是否绕过辐射中的目标流量。 “Contains”
“Equal”

TrafficSelectorPolicy

名称 说明
localAddressRanges 采用 CIDR 格式的本地地址空间的集合。 string[] (必需)
remoteAddressRanges 采用 CIDR 格式的远程地址空间的集合。 string[] (必需)

VpnSiteLinkConnection

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties VPN 站点链接连接的属性。 VpnSiteLinkConnectionProperties

VpnSiteLinkConnectionProperties

名称 说明
connectionBandwidth 预期带宽(以 MBPS 为单位)。 int
dpdTimeoutSeconds VpnLink 连接的死对等检测超时(以秒为单位)。 int
egressNatRules 出口 NatRules 列表。 SubResource[]
enableBgp EnableBgp 标志。 bool
enableRateLimiting EnableBgp 标志。 bool
ingressNatRules 入口 NatRules 列表。 SubResource[]
ipsecPolicies 此连接要考虑的 IPSec 策略。 IpsecPolicy[]
routingWeight VPN 连接的路由权重。 int
sharedKey Vpn 连接的 SharedKey。 字符串
useLocalAzureIpAddress 使用本地 Azure IP 启动连接。 bool
usePolicyBasedTrafficSelectors 启用基于策略的流量选择器。 bool
vpnConnectionProtocolType 用于此连接的连接协议。 “IKEv1”
'IKEv2'
vpnGatewayCustomBgpAddresses 此连接使用的 vpnGatewayCustomBgpAddresses。 GatewayCustomBgpIpAddressIpConfiguration[]
vpnLinkConnectionMode Vpn 链接连接模式。 'Default'
'InitiatorOnly'
'ResponderOnly'
vpnSiteLink 连接的 VPN 站点链接的 ID。 SubResource

GatewayCustomBgpIpAddressIpConfiguration

名称 说明
customBgpIpAddress 属于 IpconfigurationId 的自定义 BgpPeeringAddress。 字符串 (必需)
ipConfigurationId 属于网关的 ipconfiguration 的 IpconfigurationId。 字符串 (必需)

VpnGatewayNatRule

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties VpnGateway NAT 规则的属性。 VpnGatewayNatRuleProperties

VpnGatewayNatRuleProperties

名称 说明
externalMappings NAT 的专用 IP 地址外部映射。 VpnNatRuleMapping[]
internalMappings NAT 的专用 IP 地址内部映射。 VpnNatRuleMapping[]
ipConfigurationId 此 NAT 规则适用的 IP 配置 ID。 字符串
mode VPN NAT 的源 NAT 方向。 'EgressSnat'
“IngressSnat”
类型 VPN NAT 的 NAT 规则类型。 'Dynamic'
'Static'

VpnNatRuleMapping

名称 说明
addressSpace Vpn NatRule 映射的地址空间。 字符串
portRange Vpn NatRule 映射的端口范围。 字符串

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
创建虚拟 WAN资源

部署到 Azure
此模板允许创建虚拟 WAN 资源,包括虚拟 WAN、虚拟中心、VPN 网关、VPN 站点和 VPN 连接。
Azure 虚拟 WAN 路由意向和策略

部署到 Azure
此模板预配 Azure 虚拟 WAN,其中包含启用了路由意向和策略功能的两个中心。
Azure 虚拟 WAN (vWAN) 多中心部署

部署到 Azure
此模板允许创建 Azure 虚拟 WAN (vWAN) 多中心部署,包括所有网关和 VNET 连接。
使用自定义路由表进行 Azure vWAN 多中心部署

部署到 Azure
使用此模板可以创建 Azure 虚拟 WAN (vWAN) 多中心部署,包括所有网关和 VNET 连接,并演示路由表用于自定义路由。

ARM 模板资源定义

可以使用面向以下操作部署 vpnGateways 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Network/vpnGateways 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.Network/vpnGateways",
  "apiVersion": "2023-11-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "properties": {
    "bgpSettings": {
      "asn": "int",
      "bgpPeeringAddress": "string",
      "bgpPeeringAddresses": [
        {
          "customBgpIpAddresses": [ "string" ],
          "ipconfigurationId": "string"
        }
      ],
      "peerWeight": "int"
    },
    "connections": [
      {
        "id": "string",
        "name": "string",
        "properties": {
          "connectionBandwidth": "int",
          "dpdTimeoutSeconds": "int",
          "enableBgp": "bool",
          "enableInternetSecurity": "bool",
          "enableRateLimiting": "bool",
          "ipsecPolicies": [
            {
              "dhGroup": "string",
              "ikeEncryption": "string",
              "ikeIntegrity": "string",
              "ipsecEncryption": "string",
              "ipsecIntegrity": "string",
              "pfsGroup": "string",
              "saDataSizeKilobytes": "int",
              "saLifeTimeSeconds": "int"
            }
          ],
          "remoteVpnSite": {
            "id": "string"
          },
          "routingConfiguration": {
            "associatedRouteTable": {
              "id": "string"
            },
            "inboundRouteMap": {
              "id": "string"
            },
            "outboundRouteMap": {
              "id": "string"
            },
            "propagatedRouteTables": {
              "ids": [
                {
                  "id": "string"
                }
              ],
              "labels": [ "string" ]
            },
            "vnetRoutes": {
              "staticRoutes": [
                {
                  "addressPrefixes": [ "string" ],
                  "name": "string",
                  "nextHopIpAddress": "string"
                }
              ],
              "staticRoutesConfig": {
                "vnetLocalRouteOverrideCriteria": "string"
              }
            }
          },
          "routingWeight": "int",
          "sharedKey": "string",
          "trafficSelectorPolicies": [
            {
              "localAddressRanges": [ "string" ],
              "remoteAddressRanges": [ "string" ]
            }
          ],
          "useLocalAzureIpAddress": "bool",
          "usePolicyBasedTrafficSelectors": "bool",
          "vpnConnectionProtocolType": "string",
          "vpnLinkConnections": [
            {
              "id": "string",
              "name": "string",
              "properties": {
                "connectionBandwidth": "int",
                "dpdTimeoutSeconds": "int",
                "egressNatRules": [
                  {
                    "id": "string"
                  }
                ],
                "enableBgp": "bool",
                "enableRateLimiting": "bool",
                "ingressNatRules": [
                  {
                    "id": "string"
                  }
                ],
                "ipsecPolicies": [
                  {
                    "dhGroup": "string",
                    "ikeEncryption": "string",
                    "ikeIntegrity": "string",
                    "ipsecEncryption": "string",
                    "ipsecIntegrity": "string",
                    "pfsGroup": "string",
                    "saDataSizeKilobytes": "int",
                    "saLifeTimeSeconds": "int"
                  }
                ],
                "routingWeight": "int",
                "sharedKey": "string",
                "useLocalAzureIpAddress": "bool",
                "usePolicyBasedTrafficSelectors": "bool",
                "vpnConnectionProtocolType": "string",
                "vpnGatewayCustomBgpAddresses": [
                  {
                    "customBgpIpAddress": "string",
                    "ipConfigurationId": "string"
                  }
                ],
                "vpnLinkConnectionMode": "string",
                "vpnSiteLink": {
                  "id": "string"
                }
              }
            }
          ]
        }
      }
    ],
    "enableBgpRouteTranslationForNat": "bool",
    "isRoutingPreferenceInternet": "bool",
    "natRules": [
      {
        "id": "string",
        "name": "string",
        "properties": {
          "externalMappings": [
            {
              "addressSpace": "string",
              "portRange": "string"
            }
          ],
          "internalMappings": [
            {
              "addressSpace": "string",
              "portRange": "string"
            }
          ],
          "ipConfigurationId": "string",
          "mode": "string",
          "type": "string"
        }
      }
    ],
    "virtualHub": {
      "id": "string"
    },
    "vpnGatewayScaleUnit": "int"
  }
}

属性值

vpnGateways

名称 说明 Value
type 资源类型 “Microsoft.Network/vpnGateways”
apiVersion 资源 API 版本 '2023-11-01'
name 资源名称 字符串 (必需)

字符限制:1-80

有效字符:
字母数字、下划线字符、句点和连字符。

以字母数字开头。 以字母数字或下划线结尾。
location 资源位置。 字符串
标记 资源标记。 标记名称和值的字典。 请参阅 模板中的标记
properties VPN 网关的属性。 VpnGatewayProperties

VpnGatewayProperties

名称 说明
bgpSettings 本地网关的 BGP 扬声器设置。 BgpSettings
connections 到网关的所有 VPN 连接的列表。 VpnConnection[]
enableBgpRouteTranslationForNat 在此 VpnGateway 上为 NAT 启用 BGP 路由转换。 bool
isRoutingPreferenceInternet 为 VpnGateway 的公共 IP 接口启用路由首选项属性。 bool
natRules 与网关关联的所有 nat 规则的列表。 VpnGatewayNatRule[]
virtualHub 网关所属的 VirtualHub。 SubResource
vpnGatewayScaleUnit 此 VPN 网关的缩放单元。 int

BgpSettings

名称 说明
asn BGP 扬声器的 ASN。 int

约束:
最小值 = 0
最大值 = 4294967295
bgpPeeringAddress 此 BGP 扬声器的 BGP 对等互连地址和 BGP 标识符。 字符串
bgpPeeringAddresses 具有虚拟网络网关的 IP 配置 ID 的 BGP 对等互连地址。 IPConfigurationBgpPeeringAddress[]
peerWeight 添加到从此 BGP 扬声器获知的路由的权重。 int

IPConfigurationBgpPeeringAddress

名称 说明
customBgpIpAddresses 属于 IP 配置的自定义 BGP 对等互连地址的列表。 string[]
ipconfigurationId 属于网关的 IP 配置的 ID。 字符串

VpnConnection

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties VPN 连接的属性。 VpnConnectionProperties

VpnConnectionProperties

名称 说明
connectionBandwidth 预期带宽(以 MBPS 为单位)。 int
dpdTimeoutSeconds VPN 连接的 DPD 超时(以秒为单位)。 int
enableBgp EnableBgp 标志。 bool
enableInternetSecurity 启用 Internet 安全性。 bool
enableRateLimiting EnableBgp 标志。 bool
ipsecPolicies 此连接要考虑的 IPSec 策略。 IpsecPolicy[]
remoteVpnSite 已连接的 VPN 站点的 ID。 SubResource
routingConfiguration 路由配置,指示此连接上关联的和传播的路由表。 RoutingConfiguration
routingWeight VPN 连接的路由权重。 int
sharedKey Vpn 连接的 SharedKey。 字符串
trafficSelectorPolicies 此连接要考虑的流量选择器策略。 TrafficSelectorPolicy[]
useLocalAzureIpAddress 使用本地 Azure IP 启动连接。 bool
usePolicyBasedTrafficSelectors 启用基于策略的流量选择器。 bool
vpnConnectionProtocolType 用于此连接的连接协议。 “IKEv1”
'IKEv2'
vpnLinkConnections 到网关的所有 VPN 站点链接连接的列表。 VpnSiteLinkConnection[]

IpsecPolicy

名称 说明
dhGroup 在 IKE 阶段 1 中用于初始 SA 的 DH 组。 “DHGroup1”
'DHGroup14'
'DHGroup2'
'DHGroup2048'
'DHGroup24'
“ECP256”
“ECP384”
“None” (必需)
ikeEncryption IKE 加密算法 (IKE 阶段 2) 。 “AES128”
“AES192”
“AES256”
'DES'
“DES3”
“GCMAES128”
需要“GCMAES256” ()
ikeIntegrity IKE 第 2 阶段) (IKE 完整性算法。 “GCMAES128”
“GCMAES256”
'MD5'
“SHA1”
“SHA256”
需要“SHA384” ()
ipsecEncryption IPSec 加密算法 (IKE 阶段 1) 。 “AES128”
“AES192”
“AES256”
'DES'
“DES3”
“GCMAES128”
“GCMAES192”
“GCMAES256”
“None” (必需)
ipsecIntegrity IPSec 完整性算法 (IKE 阶段 1) 。 “GCMAES128”
“GCMAES192”
“GCMAES256”
'MD5'
“SHA1”
需要“SHA256” ()
pfsGroup 用于新子 SA 的 IKE 阶段 2 中使用的 Pfs 组。 “ECP256”
“ECP384”
“None”
“PFS1”
“PFS14”
'PFS2'
“PFS2048”
“PFS24”
需要“PFSMM” ()
saDataSizeKilobytes IPSec 安全关联 (也称为快速模式或阶段 2 SA) 站点到站点 VPN 隧道的有效负载大小(以 KB 为单位)。 int (必需)
saLifeTimeSeconds IPSec 安全关联 (也称为快速模式或阶段 2 SA) 站点到站点 VPN 隧道的生存期(以秒为单位)。 int (必需)

SubResource

名称 说明 Value
id 资源 ID。 字符串

RoutingConfiguration

名称 说明
associatedRouteTable 与此 RoutingConfiguration 关联的资源 ID RouteTable。 SubResource
inboundRouteMap 与此 RoutingConfiguration 关联的 RouteMap 的资源 ID,用于入站获知的路由。 SubResource
outboundRouteMap 与出站播发路由的此 RoutingConfiguration 关联的RouteMap 的资源 ID。 SubResource
propagatedRouteTables 要向其播发路由的 RouteTable 列表。 PropagatedRouteTable
vnetRoutes 控制从 VirtualHub 到虚拟网络连接的路由的列表。 VnetRoute

PropagatedRouteTable

名称 说明
ids 所有 RouteTable 的资源 ID 的列表。 SubResource[]
标签 标签列表。 string[]

VnetRoute

名称 说明
staticRoutes 所有静态路由的列表。 StaticRoute[]
staticRoutesConfig 此 HubVnetConnection 上的静态路由配置。 StaticRoutesConfig

StaticRoute

名称 说明
addressPrefixes 所有地址前缀的列表。 string[]
name 在 VnetRoute 中唯一的 StaticRoute 的名称。 字符串
nextHopIpAddress 下一跃点的 IP 地址。 字符串

StaticRoutesConfig

名称 说明
vnetLocalRouteOverrideCriteria 参数,用于确定是否为辐射 vnet 中的目标流量绕过 NVA。 “Contains”
“Equal”

TrafficSelectorPolicy

名称 说明
localAddressRanges 采用 CIDR 格式的本地地址空间的集合。 string[] (必需)
remoteAddressRanges 采用 CIDR 格式的远程地址空间的集合。 string[] (必需)

VpnSiteLinkConnection

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties VPN 站点链接连接的属性。 VpnSiteLinkConnectionProperties

VpnSiteLinkConnectionProperties

名称 说明
connectionBandwidth 预期带宽(以 MBPS 为单位)。 int
dpdTimeoutSeconds VpnLink 连接的死对等检测超时(以秒为单位)。 int
egressNatRules 出口 NatRules 列表。 SubResource[]
enableBgp EnableBgp 标志。 bool
enableRateLimiting EnableBgp 标志。 bool
ingressNatRules 入口 NatRules 列表。 SubResource[]
ipsecPolicies 此连接要考虑的 IPSec 策略。 IpsecPolicy[]
routingWeight VPN 连接的路由权重。 int
sharedKey Vpn 连接的 SharedKey。 字符串
useLocalAzureIpAddress 使用本地 Azure IP 启动连接。 bool
usePolicyBasedTrafficSelectors 启用基于策略的流量选择器。 bool
vpnConnectionProtocolType 用于此连接的连接协议。 “IKEv1”
'IKEv2'
vpnGatewayCustomBgpAddresses 此连接使用的 vpnGatewayCustomBgpAddresses。 GatewayCustomBgpIpAddressIpConfiguration[]
vpnLinkConnectionMode Vpn 链接连接模式。 'Default'
'InitiatorOnly'
'ResponderOnly'
vpnSiteLink 连接的 VPN 站点链接的 ID。 SubResource

GatewayCustomBgpIpAddressIpConfiguration

名称 说明
customBgpIpAddress 属于 IpconfigurationId 的自定义 BgpPeeringAddress。 字符串 (必需)
ipConfigurationId 属于网关的 ipconfiguration 的 IpconfigurationId。 字符串 (必需)

VpnGatewayNatRule

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties VpnGateway NAT 规则的属性。 VpnGatewayNatRuleProperties

VpnGatewayNatRuleProperties

名称 说明
externalMappings NAT 的专用 IP 地址外部映射。 VpnNatRuleMapping[]
internalMappings NAT 的专用 IP 地址内部映射。 VpnNatRuleMapping[]
ipConfigurationId 此 NAT 规则适用的 IP 配置 ID。 字符串
mode VPN NAT 的源 NAT 方向。 'EgressSnat'
“IngressSnat”
类型 VPN NAT 的 NAT 规则类型。 'Dynamic'
'Static'

VpnNatRuleMapping

名称 说明
addressSpace Vpn NatRule 映射的地址空间。 字符串
portRange Vpn NatRule 映射的端口范围。 字符串

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
创建虚拟 WAN资源

部署到 Azure
此模板允许创建虚拟 WAN 资源,包括虚拟 WAN、虚拟中心、VPN 网关、VPN 站点和 VPN 连接。
Azure 虚拟 WAN 路由意向和策略

部署到 Azure
此模板预配 Azure 虚拟 WAN,其中包含启用了路由意向和策略功能的两个中心。
Azure 虚拟 WAN (vWAN) 多中心部署

部署到 Azure
此模板允许创建 Azure 虚拟 WAN (vWAN) 多中心部署,包括所有网关和 VNET 连接。
使用自定义路由表进行 Azure vWAN 多中心部署

部署到 Azure
使用此模板可以创建 Azure 虚拟 WAN (vWAN) 多中心部署,包括所有网关和 VNET 连接,并演示路由表用于自定义路由。

Terraform (AzAPI 提供程序) 资源定义

可以使用面向以下操作部署 vpnGateways 资源类型:

  • 资源组

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Network/vpnGateways 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Network/vpnGateways@2023-11-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      bgpSettings = {
        asn = int
        bgpPeeringAddress = "string"
        bgpPeeringAddresses = [
          {
            customBgpIpAddresses = [
              "string"
            ]
            ipconfigurationId = "string"
          }
        ]
        peerWeight = int
      }
      connections = [
        {
          id = "string"
          name = "string"
          properties = {
            connectionBandwidth = int
            dpdTimeoutSeconds = int
            enableBgp = bool
            enableInternetSecurity = bool
            enableRateLimiting = bool
            ipsecPolicies = [
              {
                dhGroup = "string"
                ikeEncryption = "string"
                ikeIntegrity = "string"
                ipsecEncryption = "string"
                ipsecIntegrity = "string"
                pfsGroup = "string"
                saDataSizeKilobytes = int
                saLifeTimeSeconds = int
              }
            ]
            remoteVpnSite = {
              id = "string"
            }
            routingConfiguration = {
              associatedRouteTable = {
                id = "string"
              }
              inboundRouteMap = {
                id = "string"
              }
              outboundRouteMap = {
                id = "string"
              }
              propagatedRouteTables = {
                ids = [
                  {
                    id = "string"
                  }
                ]
                labels = [
                  "string"
                ]
              }
              vnetRoutes = {
                staticRoutes = [
                  {
                    addressPrefixes = [
                      "string"
                    ]
                    name = "string"
                    nextHopIpAddress = "string"
                  }
                ]
                staticRoutesConfig = {
                  vnetLocalRouteOverrideCriteria = "string"
                }
              }
            }
            routingWeight = int
            sharedKey = "string"
            trafficSelectorPolicies = [
              {
                localAddressRanges = [
                  "string"
                ]
                remoteAddressRanges = [
                  "string"
                ]
              }
            ]
            useLocalAzureIpAddress = bool
            usePolicyBasedTrafficSelectors = bool
            vpnConnectionProtocolType = "string"
            vpnLinkConnections = [
              {
                id = "string"
                name = "string"
                properties = {
                  connectionBandwidth = int
                  dpdTimeoutSeconds = int
                  egressNatRules = [
                    {
                      id = "string"
                    }
                  ]
                  enableBgp = bool
                  enableRateLimiting = bool
                  ingressNatRules = [
                    {
                      id = "string"
                    }
                  ]
                  ipsecPolicies = [
                    {
                      dhGroup = "string"
                      ikeEncryption = "string"
                      ikeIntegrity = "string"
                      ipsecEncryption = "string"
                      ipsecIntegrity = "string"
                      pfsGroup = "string"
                      saDataSizeKilobytes = int
                      saLifeTimeSeconds = int
                    }
                  ]
                  routingWeight = int
                  sharedKey = "string"
                  useLocalAzureIpAddress = bool
                  usePolicyBasedTrafficSelectors = bool
                  vpnConnectionProtocolType = "string"
                  vpnGatewayCustomBgpAddresses = [
                    {
                      customBgpIpAddress = "string"
                      ipConfigurationId = "string"
                    }
                  ]
                  vpnLinkConnectionMode = "string"
                  vpnSiteLink = {
                    id = "string"
                  }
                }
              }
            ]
          }
        }
      ]
      enableBgpRouteTranslationForNat = bool
      isRoutingPreferenceInternet = bool
      natRules = [
        {
          id = "string"
          name = "string"
          properties = {
            externalMappings = [
              {
                addressSpace = "string"
                portRange = "string"
              }
            ]
            internalMappings = [
              {
                addressSpace = "string"
                portRange = "string"
              }
            ]
            ipConfigurationId = "string"
            mode = "string"
            type = "string"
          }
        }
      ]
      virtualHub = {
        id = "string"
      }
      vpnGatewayScaleUnit = int
    }
  })
}

属性值

vpnGateways

名称 说明 Value
type 资源类型 “Microsoft.Network/vpnGateways@2023-11-01”
name 资源名称 字符串 (必需)

字符限制:1-80

有效字符:
字母数字、下划线字符、句点和连字符。

以字母数字开头。 以字母数字或下划线结尾。
location 资源位置。 字符串
parent_id 若要部署到资源组,请使用该资源组的 ID。 字符串 (必需)
标记 资源标记。 标记名称和值的字典。
properties VPN 网关的属性。 VpnGatewayProperties

VpnGatewayProperties

名称 说明
bgpSettings 本地网关的 BGP 扬声器设置。 BgpSettings
connections 到网关的所有 VPN 连接的列表。 VpnConnection[]
enableBgpRouteTranslationForNat 在此 VpnGateway 上为 NAT 启用 BGP 路由转换。 bool
isRoutingPreferenceInternet 为 VpnGateway 的公共 IP 接口启用路由首选项属性。 bool
natRules 与网关关联的所有 nat 规则的列表。 VpnGatewayNatRule[]
virtualHub 网关所属的 VirtualHub。 SubResource
vpnGatewayScaleUnit 此 VPN 网关的缩放单元。 int

BgpSettings

名称 说明
asn BGP 扬声器的 ASN。 int

约束:
最小值 = 0
最大值 = 4294967295
bgpPeeringAddress 此 BGP 扬声器的 BGP 对等互连地址和 BGP 标识符。 字符串
bgpPeeringAddresses 具有虚拟网络网关 IP 配置 ID 的 BGP 对等互连地址。 IPConfigurationBgpPeeringAddress[]
peerWeight 添加到从此 BGP 扬声器学习的路由的权重。 int

IPConfigurationBgpPeeringAddress

名称 说明
customBgpIpAddresses 属于 IP 配置的自定义 BGP 对等互连地址的列表。 string[]
ipconfigurationId 属于网关的 IP 配置的 ID。 字符串

VpnConnection

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties VPN 连接的属性。 VpnConnectionProperties

VpnConnectionProperties

名称 说明
connectionBandwidth 预期带宽(以 MBPS 为单位)。 int
dpdTimeoutSeconds VPN 连接的 DPD 超时(以秒为单位)。 int
enableBgp EnableBgp 标志。 bool
enableInternetSecurity 启用 Internet 安全性。 bool
enableRateLimiting EnableBgp 标志。 bool
ipsecPolicies 此连接要考虑的 IPSec 策略。 IpsecPolicy[]
remoteVpnSite 已连接的 VPN 站点的 ID。 SubResource
routingConfiguration 路由配置,指示此连接上关联的和传播的路由表。 RoutingConfiguration
routingWeight VPN 连接的路由权重。 int
sharedKey Vpn 连接的 SharedKey。 字符串
trafficSelectorPolicies 此连接要考虑的流量选择器策略。 TrafficSelectorPolicy[]
useLocalAzureIpAddress 使用本地 Azure IP 启动连接。 bool
usePolicyBasedTrafficSelectors 启用基于策略的流量选择器。 bool
vpnConnectionProtocolType 用于此连接的连接协议。 “IKEv1”
“IKEv2”
vpnLinkConnections 到网关的所有 VPN 站点链接连接的列表。 VpnSiteLinkConnection[]

IpsecPolicy

名称 说明
dhGroup 在 IKE 阶段 1 中用于初始 SA 的 DH 组。 “DHGroup1”
“DHGroup14”
“DHGroup2”
“DHGroup2048”
“DHGroup24”
“ECP256”
“ECP384”
“None” (必需)
ikeEncryption IKE 加密算法 (IKE 阶段 2) 。 “AES128”
“AES192”
“AES256”
“DES”
“DES3”
“GCMAES128”
需要“GCMAES256” ()
ikeIntegrity IKE 第 2 阶段) (IKE 完整性算法。 “GCMAES128”
“GCMAES256”
“MD5”
“SHA1”
“SHA256”
需要“SHA384” ()
ipsecEncryption IPSec 加密算法 (IKE 阶段 1) 。 “AES128”
“AES192”
“AES256”
“DES”
“DES3”
“GCMAES128”
“GCMAES192”
“GCMAES256”
“None” (必需)
ipsecIntegrity IPSec 完整性算法 (IKE 阶段 1) 。 “GCMAES128”
“GCMAES192”
“GCMAES256”
“MD5”
“SHA1”
需要“SHA256” ()
pfsGroup 用于新子 SA 的 IKE 阶段 2 中使用的 Pfs 组。 “ECP256”
“ECP384”
"None"
“PFS1”
“PFS14”
“PFS2”
“PFS2048”
“PFS24”
需要“PFSMM” ()
saDataSizeKilobytes IPSec 安全关联 (也称为快速模式或阶段 2 SA) 站点到站点 VPN 隧道的有效负载大小(以 KB 为单位)。 int (必需)
saLifeTimeSeconds IPSec 安全关联 (也称为快速模式或阶段 2 SA) 站点到站点 VPN 隧道的生存期(以秒为单位)。 int (必需)

SubResource

名称 说明 Value
id 资源 ID。 字符串

RoutingConfiguration

名称 说明
associatedRouteTable 与此 RoutingConfiguration 关联的资源 ID RouteTable。 SubResource
inboundRouteMap 与此 RoutingConfiguration 关联的 RouteMap 的资源 ID,用于入站学习的路由。 SubResource
outboundRouteMap 与出站播发路由的此 RoutingConfiguration 关联的RouteMap 的资源 ID。 SubResource
propagatedRouteTables 要向其播发路由的 RouteTable 列表。 PropagatedRouteTable
vnetRoutes 控制从 VirtualHub 到虚拟网络连接的路由的路由列表。 VnetRoute

PropagatedRouteTable

名称 说明
ids 所有 RouteTable 的资源 ID 列表。 SubResource[]
标签 标签列表。 string[]

VnetRoute

名称 说明
staticRoutes 所有静态路由的列表。 StaticRoute[]
staticRoutesConfig 此 HubVnetConnection 上的静态路由的配置。 StaticRoutesConfig

StaticRoute

名称 说明
addressPrefixes 所有地址前缀的列表。 string[]
name 在 VnetRoute 中唯一的 StaticRoute 的名称。 字符串
nextHopIpAddress 下一跃点的 IP 地址。 字符串

StaticRoutesConfig

名称 说明
vnetLocalRouteOverrideCriteria 参数,确定辐射 vnet 中的 NVA 是否绕过辐射中的目标流量。 “Contains”
“Equal”

TrafficSelectorPolicy

名称 说明
localAddressRanges CIDR 格式的本地地址空间的集合。 string[] (必需的)
remoteAddressRanges CIDR 格式的远程地址空间的集合。 string[] (必需的)

VpnSiteLinkConnection

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties VPN 站点链接连接的属性。 VpnSiteLinkConnectionProperties

VpnSiteLinkConnectionProperties

名称 说明
connectionBandwidth 预期带宽(以 MBPS 为单位)。 int
dpdTimeoutSeconds VpnLink 连接的死对等检测超时(以秒为单位)。 int
egressNatRules 出口 NatRules 列表。 SubResource[]
enableBgp EnableBgp 标志。 bool
enableRateLimiting EnableBgp 标志。 bool
ingressNatRules 入口 NatRules 列表。 SubResource[]
ipsecPolicies 此连接要考虑的 IPSec 策略。 IpsecPolicy[]
routingWeight VPN 连接的路由权重。 int
sharedKey Vpn 连接的 SharedKey。 字符串
useLocalAzureIpAddress 使用本地 azure IP 启动连接。 bool
usePolicyBasedTrafficSelectors 启用基于策略的流量选择器。 bool
vpnConnectionProtocolType 用于此连接的连接协议。 “IKEv1”
“IKEv2”
vpnGatewayCustomBgpAddresses 此连接使用的 vpnGatewayCustomBgpAddresses。 GatewayCustomBgpIpAddressIpConfiguration[]
vpnLinkConnectionMode Vpn 链接连接模式。 “Default”
“InitiatorOnly”
“ResponderOnly”
vpnSiteLink 连接的 VPN 站点链接的 ID。 SubResource

GatewayCustomBgpIpAddressIpConfiguration

名称 说明
customBgpIpAddress 属于 IpconfigurationId 的自定义 BgpPeeringAddress。 字符串 (必需)
ipConfigurationId 属于网关的 ipconfiguration 的 IpconfigurationId。 字符串 (必需)

VpnGatewayNatRule

名称 说明 Value
id 资源 ID。 字符串
name 资源组中唯一的资源的名称。 此名称可用于访问资源。 string
properties VpnGateway NAT 规则的属性。 VpnGatewayNatRuleProperties

VpnGatewayNatRuleProperties

名称 说明
externalMappings NAT 的专用 IP 地址外部映射。 VpnNatRuleMapping[]
internalMappings NAT 的专用 IP 地址内部映射。 VpnNatRuleMapping[]
ipConfigurationId 此 NAT 规则适用的 IP 配置 ID。 字符串
mode VPN NAT 的源 NAT 方向。 “EgressSnat”
“IngressSnat”
类型 VPN NAT 的 NAT 规则的类型。 “动态”
“Static”

VpnNatRuleMapping

名称 说明
addressSpace Vpn NatRule 映射的地址空间。 字符串
portRange Vpn NatRule 映射的端口范围。 字符串