你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
- 最新
- 2025-05-01
- 2025-03-01
- 2025-01-01
- 2024-10-01
- 2024-07-01
- 2024-05-01
- 2024-03-01
- 2024-01-01
- 2023-11-01
- 2023-09-01
- 2023-06-01
- 2023-05-01
- 2023-04-01
- 2023-02-01
- 2022-11-01
- 2022-09-01
- 2022-07-01
- 2022-05-01
- 2022-01-01
- 2021-08-01
- 2021-05-01
- 2021-03-01
- 2021-02-01
- 2020-11-01
- 2020-08-01
- 2020-07-01
- 2020-06-01
- 2020-05-01
- 2020-04-01
- 2020-03-01
- 2019-12-01
- 2019-11-01
- 2019-09-01
- 2019-08-01
- 2019-07-01
- 2019-06-01
- 2019-04-01
- 2019-02-01
- 2018-12-01
- 2018-11-01
- 2018-10-01
- 2018-08-01
- 2018-07-01
- 2018-06-01
- 2018-04-01
- 2018-02-01
- 2018-01-01
- 2017-11-01
- 2017-10-01
- 2017-09-01
- 2017-08-01
- 2017-06-01
- 2017-03-30
- 2017-03-01
- 2016-12-01
- 2016-09-01
- 2016-06-01
- 2016-03-30
- 2015-06-15
- 2015-05-01-预览版
Bicep 资源定义
可以使用目标操作部署 localNetworkGateways 资源类型:
- 资源组 - 请参阅 资源组部署命令
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.Network/localNetworkGateways 资源,请将以下 Bicep 添加到模板。
resource symbolicname 'Microsoft.Network/localNetworkGateways@2025-05-01' = {
location: 'string'
name: 'string'
properties: {
bgpSettings: {
asn: int
bgpPeeringAddress: 'string'
bgpPeeringAddresses: [
{
customBgpIpAddresses: [
'string'
]
ipconfigurationId: 'string'
}
]
peerWeight: int
}
fqdn: 'string'
gatewayIpAddress: 'string'
localNetworkAddressSpace: {
addressPrefixes: [
'string'
]
ipamPoolPrefixAllocations: [
{
numberOfIpAddresses: 'string'
pool: {
id: 'string'
}
}
]
}
}
tags: {
{customized property}: 'string'
}
}
属性值
Microsoft.Network/localNetworkGateways
| 名字 | 描述 | 价值 |
|---|---|---|
| 位置 | 资源位置。 | 字符串 |
| 名字 | 资源名称 | 字符串 约束: 最小长度 = 1 (必需) |
| 性能 | 本地网络网关的属性。 | LocalNetworkGatewayPropertiesFormat (必需) |
| 标签 | 资源标记 | 标记名称和值的字典。 请参阅模板 中的 |
Bgp设置
| 名字 | 描述 | 价值 |
|---|---|---|
| ASN | BGP 扬声器的 ASN。 | int 约束: 最小值 = 0 最大值 = 4294967295 |
| bgp对等地址 | 此 BGP 扬声器的 BGP 对等互连地址和 BGP 标识符。 | 字符串 |
| bgpPeering地址 | 具有虚拟网络网关 IP 配置 ID 的 BGP 对等互连地址。 | IPConfigurationBgpPeeringAddress[] |
| peerWeight | 添加到从此 BGP 扬声器中学习的路由的权重。 | 整数 (int) |
公共地址空间
| 名字 | 描述 | 价值 |
|---|---|---|
| address前缀 | CIDR 表示法中为此虚拟网络保留的地址块列表。 | 字符串[] |
| ipamPoolPrefix分配 | IPAM 池分配 IP 地址前缀的列表。 | CommonIpamPoolPrefixAllocation[] |
CommonIpamPoolPrefixAllocation
| 名字 | 描述 | 价值 |
|---|---|---|
| IpAddresses 数量 | 要分配的 IP 地址数。 | 字符串 |
| 池 | CommonIpamPoolPrefixAllocationPool |
CommonIpamPoolPrefixAllocationPool
| 名字 | 描述 | 价值 |
|---|---|---|
| 身份证 | 关联的 Azure IpamPool 资源的资源 ID。 | 字符串 |
CommonResourceTags
| 名字 | 描述 | 价值 |
|---|
IPConfigurationBgpPeeringAddress
| 名字 | 描述 | 价值 |
|---|---|---|
| customBgpIp地址 | 属于 IP 配置的自定义 BGP 对等互连地址的列表。 | 字符串[] |
| ipconfigurationId | 属于网关的 IP 配置的 ID。 | 字符串 |
LocalNetworkGatewayPropertiesFormat
| 名字 | 描述 | 价值 |
|---|---|---|
| bgp设置 | 本地网络网关的 BGP 扬声器设置。 | Bgp设置 |
| FQDN | 本地网关的 FQDN。 | 字符串 |
| 网关 IpAddress | 本地网络网关的 IP 地址。 | 字符串 |
| localNetworkAddressSpace 地址空间 | 本地网络站点地址空间。 | 公共地址空间 |
用法示例
Bicep 示例
部署本地网络网关连接的基本示例,可在其上配置特定连接。
param resourceName string = 'acctest0001'
param location string = 'westeurope'
resource localNetworkGateway 'Microsoft.Network/localNetworkGateways@2022-07-01' = {
name: resourceName
location: location
properties: {
gatewayIpAddress: '168.62.225.23'
localNetworkAddressSpace: {
addressPrefixes: [
'10.1.1.0/24'
]
}
}
}
Azure 验证模块
以下 Azure 验证模块 可用于部署此资源类型。
| 模块 | 描述 |
|---|---|
| 本地网络网关 | 本地网络网关的 AVM 资源模块 |
Azure 快速入门示例
以下 Azure 快速入门模板 包含用于部署此资源类型的 Bicep 示例。
| Bicep 文件 | 描述 |
|---|---|
| 使用具有 BGP 的主动-主动 VPN 网关 |
通过此模板,可以使用 BGP 在配置主动-主动的两个 VNet 之间部署站点到站点 VPN VPN。 每个 Azure VPN 网关解析远程对等方的 FQDN,以确定远程 VPN 网关的公共 IP。 模板在具有可用性区域的 Azure 区域中按预期运行。 |
ARM 模板资源定义
可以使用目标操作部署 localNetworkGateways 资源类型:
- 资源组 - 请参阅 资源组部署命令
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.Network/localNetworkGateways 资源,请将以下 JSON 添加到模板。
{
"type": "Microsoft.Network/localNetworkGateways",
"apiVersion": "2025-05-01",
"name": "string",
"location": "string",
"properties": {
"bgpSettings": {
"asn": "int",
"bgpPeeringAddress": "string",
"bgpPeeringAddresses": [
{
"customBgpIpAddresses": [ "string" ],
"ipconfigurationId": "string"
}
],
"peerWeight": "int"
},
"fqdn": "string",
"gatewayIpAddress": "string",
"localNetworkAddressSpace": {
"addressPrefixes": [ "string" ],
"ipamPoolPrefixAllocations": [
{
"numberOfIpAddresses": "string",
"pool": {
"id": "string"
}
}
]
}
},
"tags": {
"{customized property}": "string"
}
}
属性值
Microsoft.Network/localNetworkGateways
| 名字 | 描述 | 价值 |
|---|---|---|
| apiVersion | API 版本 | '2025-05-01' |
| 位置 | 资源位置。 | 字符串 |
| 名字 | 资源名称 | 字符串 约束: 最小长度 = 1 (必需) |
| 性能 | 本地网络网关的属性。 | LocalNetworkGatewayPropertiesFormat (必需) |
| 标签 | 资源标记 | 标记名称和值的字典。 请参阅模板 中的 |
| 类型 | 资源类型 | “Microsoft.Network/localNetworkGateways” |
Bgp设置
| 名字 | 描述 | 价值 |
|---|---|---|
| ASN | BGP 扬声器的 ASN。 | int 约束: 最小值 = 0 最大值 = 4294967295 |
| bgp对等地址 | 此 BGP 扬声器的 BGP 对等互连地址和 BGP 标识符。 | 字符串 |
| bgpPeering地址 | 具有虚拟网络网关 IP 配置 ID 的 BGP 对等互连地址。 | IPConfigurationBgpPeeringAddress[] |
| peerWeight | 添加到从此 BGP 扬声器中学习的路由的权重。 | 整数 (int) |
公共地址空间
| 名字 | 描述 | 价值 |
|---|---|---|
| address前缀 | CIDR 表示法中为此虚拟网络保留的地址块列表。 | 字符串[] |
| ipamPoolPrefix分配 | IPAM 池分配 IP 地址前缀的列表。 | CommonIpamPoolPrefixAllocation[] |
CommonIpamPoolPrefixAllocation
| 名字 | 描述 | 价值 |
|---|---|---|
| IpAddresses 数量 | 要分配的 IP 地址数。 | 字符串 |
| 池 | CommonIpamPoolPrefixAllocationPool |
CommonIpamPoolPrefixAllocationPool
| 名字 | 描述 | 价值 |
|---|---|---|
| 身份证 | 关联的 Azure IpamPool 资源的资源 ID。 | 字符串 |
CommonResourceTags
| 名字 | 描述 | 价值 |
|---|
IPConfigurationBgpPeeringAddress
| 名字 | 描述 | 价值 |
|---|---|---|
| customBgpIp地址 | 属于 IP 配置的自定义 BGP 对等互连地址的列表。 | 字符串[] |
| ipconfigurationId | 属于网关的 IP 配置的 ID。 | 字符串 |
LocalNetworkGatewayPropertiesFormat
| 名字 | 描述 | 价值 |
|---|---|---|
| bgp设置 | 本地网络网关的 BGP 扬声器设置。 | Bgp设置 |
| FQDN | 本地网关的 FQDN。 | 字符串 |
| 网关 IpAddress | 本地网络网关的 IP 地址。 | 字符串 |
| localNetworkAddressSpace 地址空间 | 本地网络站点地址空间。 | 公共地址空间 |
用法示例
Azure 快速入门模板
以下 Azure 快速入门模板 部署此资源类型。
| 模板 | 描述 |
|---|---|
|
创建站点到站点 VPN 连接 |
使用此模板,可以使用虚拟网络网关创建站点到站点 VPN 连接 |
|
使用 VM 创建站点到站点 VPN 连接 |
使用此模板,可以使用虚拟网络网关创建站点到站点 VPN 连接 |
|
创建包含两个子网、本地网络和网关 的 VNet |
此模板创建 VNet、2 个子网和网关 |
| 使用具有 BGP 的主动-主动 VPN 网关 |
通过此模板,可以使用 BGP 在配置主动-主动的两个 VNet 之间部署站点到站点 VPN VPN。 每个 Azure VPN 网关解析远程对等方的 FQDN,以确定远程 VPN 网关的公共 IP。 模板在具有可用性区域的 Azure 区域中按预期运行。 |
Terraform (AzAPI 提供程序)资源定义
可以使用目标操作部署 localNetworkGateways 资源类型:
- 资源组
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.Network/localNetworkGateways 资源,请将以下 Terraform 添加到模板。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Network/localNetworkGateways@2025-05-01"
name = "string"
parent_id = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
bgpSettings = {
asn = int
bgpPeeringAddress = "string"
bgpPeeringAddresses = [
{
customBgpIpAddresses = [
"string"
]
ipconfigurationId = "string"
}
]
peerWeight = int
}
fqdn = "string"
gatewayIpAddress = "string"
localNetworkAddressSpace = {
addressPrefixes = [
"string"
]
ipamPoolPrefixAllocations = [
{
numberOfIpAddresses = "string"
pool = {
id = "string"
}
}
]
}
}
}
}
属性值
Microsoft.Network/localNetworkGateways
| 名字 | 描述 | 价值 |
|---|---|---|
| 位置 | 资源位置。 | 字符串 |
| 名字 | 资源名称 | 字符串 约束: 最小长度 = 1 (必需) |
| 性能 | 本地网络网关的属性。 | LocalNetworkGatewayPropertiesFormat (必需) |
| 标签 | 资源标记 | 标记名称和值的字典。 |
| 类型 | 资源类型 | “Microsoft.Network/localNetworkGateways@2025-05-01” |
Bgp设置
| 名字 | 描述 | 价值 |
|---|---|---|
| ASN | BGP 扬声器的 ASN。 | int 约束: 最小值 = 0 最大值 = 4294967295 |
| bgp对等地址 | 此 BGP 扬声器的 BGP 对等互连地址和 BGP 标识符。 | 字符串 |
| bgpPeering地址 | 具有虚拟网络网关 IP 配置 ID 的 BGP 对等互连地址。 | IPConfigurationBgpPeeringAddress[] |
| peerWeight | 添加到从此 BGP 扬声器中学习的路由的权重。 | 整数 (int) |
公共地址空间
| 名字 | 描述 | 价值 |
|---|---|---|
| address前缀 | CIDR 表示法中为此虚拟网络保留的地址块列表。 | 字符串[] |
| ipamPoolPrefix分配 | IPAM 池分配 IP 地址前缀的列表。 | CommonIpamPoolPrefixAllocation[] |
CommonIpamPoolPrefixAllocation
| 名字 | 描述 | 价值 |
|---|---|---|
| IpAddresses 数量 | 要分配的 IP 地址数。 | 字符串 |
| 池 | CommonIpamPoolPrefixAllocationPool |
CommonIpamPoolPrefixAllocationPool
| 名字 | 描述 | 价值 |
|---|---|---|
| 身份证 | 关联的 Azure IpamPool 资源的资源 ID。 | 字符串 |
CommonResourceTags
| 名字 | 描述 | 价值 |
|---|
IPConfigurationBgpPeeringAddress
| 名字 | 描述 | 价值 |
|---|---|---|
| customBgpIp地址 | 属于 IP 配置的自定义 BGP 对等互连地址的列表。 | 字符串[] |
| ipconfigurationId | 属于网关的 IP 配置的 ID。 | 字符串 |
LocalNetworkGatewayPropertiesFormat
| 名字 | 描述 | 价值 |
|---|---|---|
| bgp设置 | 本地网络网关的 BGP 扬声器设置。 | Bgp设置 |
| FQDN | 本地网关的 FQDN。 | 字符串 |
| 网关 IpAddress | 本地网络网关的 IP 地址。 | 字符串 |
| localNetworkAddressSpace 地址空间 | 本地网络站点地址空间。 | 公共地址空间 |
用法示例
Terraform 示例
部署本地网络网关连接的基本示例,可在其上配置特定连接。
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "localNetworkGateway" {
type = "Microsoft.Network/localNetworkGateways@2022-07-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
gatewayIpAddress = "168.62.225.23"
localNetworkAddressSpace = {
addressPrefixes = [
"10.1.1.0/24",
]
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
Azure 验证模块
以下 Azure 验证模块 可用于部署此资源类型。
| 模块 | 描述 |
|---|---|
| 本地网络网关 | 本地网络网关的 AVM 资源模块 |