Microsoft.Network localNetwork網關 2021-03-01

Bicep 資源定義

localNetworkGateways 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

使用範例

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 閘道 站對站 VPN VPN 此範本可讓您在具有 VPN 閘道的兩個 VNet 之間部署站對站 VPN,以使用 BGP 設定主動-主動。 每個 Azure VPN 閘道都會解析遠端對等的 FQDN,以判斷遠端 VPN 閘道的公用 IP。 範本會在具有可用性區域的 Azure 區域中如預期般執行。

資源格式

若要建立 Microsoft.Network/localNetworkGateways 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.Network/localNetworkGateways@2021-03-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'
      ]
    }
  }
  tags: {
    {customized property}: 'string'
  }
}

屬性值

Microsoft.Network/localNetworkGateways

名字 描述 價值
位置 資源位置。 字串
名字 資源名稱 字串

約束:
最小長度 = 1 (必要)
性能 局域網路閘道的屬性。 LocalNetworkGatewayPropertiesFormat (必要)
標籤 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤

地址空間

名字 描述 價值
address前綴 以 CIDR 表示法保留給此虛擬網路的位址區塊清單。 字串[]

Bgp設置

名字 描述 價值
asn (自動傳感器網路) BGP 喇叭的 ASN。 int

約束:
最小值 = 0
最大值 = 4294967295
bgp對等位址 這個 BGP 說話者的 BGP 對等互連位址和 BGP 識別碼。 字串
bgpPeering位址 具有虛擬網路閘道IP組態標識碼的 BGP 對等互連位址。 IPConfigurationBgpPeeringAddress[]
peerWeight 新增至此 BGP 喇叭所學習路由的權數。 整數 (int)

IPConfigurationBgpPeeringAddress

名字 描述 價值
customBgpIp位址 屬於IP組態的自訂BGP對等互連位址清單。 字串[]
ipconfigurationId 屬於閘道的IP組態標識碼。 字串

LocalNetworkGatewayPropertiesFormat

名字 描述 價值
bgp設置 局域網路閘道的 BGP 喇叭設定。 Bgp設置
FQDN 局域網路閘道的 FQDN。 字串
閘道 IpAddress 局域網路閘道的IP位址。 字串
localNetworkAddressSpace 地址空間 局域網路網站位址空間。 地址空間

資源標籤

名字 描述 價值

ARM 樣本資源定義

localNetworkGateways 資源類型可以使用目標作業來部署:

使用範例

Azure 快速入門範本

下列 Azure 快速入門範本 部署此資源類型。

範本 描述
建立站對站 VPN 連線

部署至 Azure
此範本可讓您使用虛擬網路閘道建立站對站 VPN 連線
使用 VM 建立站對站 VPN 連線

部署至 Azure
此範本可讓您使用虛擬網路閘道建立站對站 VPN 連線
建立具有兩個子網、局域網路和閘道 的 VNet

部署至 Azure
此範本會建立 VNet、2 個子網和閘道
使用 BGP 使用主動 VPN 閘道 站對站 VPN VPN

部署至 Azure
此範本可讓您在具有 VPN 閘道的兩個 VNet 之間部署站對站 VPN,以使用 BGP 設定主動-主動。 每個 Azure VPN 閘道都會解析遠端對等的 FQDN,以判斷遠端 VPN 閘道的公用 IP。 範本會在具有可用性區域的 Azure 區域中如預期般執行。

資源格式

若要建立 Microsoft.Network/localNetworkGateways 資源,請將下列 JSON 新增至範本。

{
  "type": "Microsoft.Network/localNetworkGateways",
  "apiVersion": "2021-03-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" ]
    }
  },
  "tags": {
    "{customized property}": "string"
  }
}

屬性值

Microsoft.Network/localNetworkGateways

名字 描述 價值
apiVersion API 版本 '2021-03-01'
位置 資源位置。 字串
名字 資源名稱 字串

約束:
最小長度 = 1 (必要)
性能 局域網路閘道的屬性。 LocalNetworkGatewayPropertiesFormat (必要)
標籤 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤
型別 資源類型 “Microsoft.Network/localNetworkGateways”

地址空間

名字 描述 價值
address前綴 以 CIDR 表示法保留給此虛擬網路的位址區塊清單。 字串[]

Bgp設置

名字 描述 價值
asn (自動傳感器網路) BGP 喇叭的 ASN。 int

約束:
最小值 = 0
最大值 = 4294967295
bgp對等位址 這個 BGP 說話者的 BGP 對等互連位址和 BGP 識別碼。 字串
bgpPeering位址 具有虛擬網路閘道IP組態標識碼的 BGP 對等互連位址。 IPConfigurationBgpPeeringAddress[]
peerWeight 新增至此 BGP 喇叭所學習路由的權數。 整數 (int)

IPConfigurationBgpPeeringAddress

名字 描述 價值
customBgpIp位址 屬於IP組態的自訂BGP對等互連位址清單。 字串[]
ipconfigurationId 屬於閘道的IP組態標識碼。 字串

LocalNetworkGatewayPropertiesFormat

名字 描述 價值
bgp設置 局域網路閘道的 BGP 喇叭設定。 Bgp設置
FQDN 局域網路閘道的 FQDN。 字串
閘道 IpAddress 局域網路閘道的IP位址。 字串
localNetworkAddressSpace 地址空間 局域網路網站位址空間。 地址空間

資源標籤

名字 描述 價值

Terraform (AzAPI 提供者) 資源定義

localNetworkGateways 資源類型可以使用目標作業來部署:

  • 資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。

使用範例

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資源模組

資源格式

若要建立 Microsoft.Network/localNetworkGateways 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Network/localNetworkGateways@2021-03-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"
        ]
      }
    }
  }
}

屬性值

Microsoft.Network/localNetworkGateways

名字 描述 價值
位置 資源位置。 字串
名字 資源名稱 字串

約束:
最小長度 = 1 (必要)
性能 局域網路閘道的屬性。 LocalNetworkGatewayPropertiesFormat (必要)
標籤 資源標籤 標記名稱和值的字典。
型別 資源類型 “Microsoft.Network/localNetworkGateways@2021-03-01”

地址空間

名字 描述 價值
address前綴 以 CIDR 表示法保留給此虛擬網路的位址區塊清單。 字串[]

Bgp設置

名字 描述 價值
asn (自動傳感器網路) BGP 喇叭的 ASN。 int

約束:
最小值 = 0
最大值 = 4294967295
bgp對等位址 這個 BGP 說話者的 BGP 對等互連位址和 BGP 識別碼。 字串
bgpPeering位址 具有虛擬網路閘道IP組態標識碼的 BGP 對等互連位址。 IPConfigurationBgpPeeringAddress[]
peerWeight 新增至此 BGP 喇叭所學習路由的權數。 整數 (int)

IPConfigurationBgpPeeringAddress

名字 描述 價值
customBgpIp位址 屬於IP組態的自訂BGP對等互連位址清單。 字串[]
ipconfigurationId 屬於閘道的IP組態標識碼。 字串

LocalNetworkGatewayPropertiesFormat

名字 描述 價值
bgp設置 局域網路閘道的 BGP 喇叭設定。 Bgp設置
FQDN 局域網路閘道的 FQDN。 字串
閘道 IpAddress 局域網路閘道的IP位址。 字串
localNetworkAddressSpace 地址空間 局域網路網站位址空間。 地址空間

資源標籤

名字 描述 價值