使用受控網路網狀架構服務設定 L2 和 L3 隔離網域
隔離網域可在裝載於相同機架(機架內部通訊)或不同機架(機架間通訊)的工作負載之間進行通訊。 本操作說明說明如何使用 Azure 命令行介面 (AzureCLI) 來管理第 2 層和第 3 層隔離網域。 您可以建立、更新、刪除和檢查第 2 層和第 3 層隔離網域的狀態。
必要條件
確定已建立網路網狀架構控制器 (NFC) 和網路網狀架構。
安裝最新版 的必要 CLI 擴充功能。
使用下列命令登入您的 Azure 帳戶,並將訂用帳戶設定為您的 Azure 訂用帳戶標識碼。 這應該與您用於 Azure 操作員 Nexus 實例中所有資源的訂用帳戶標識碼相同。
az login
az account set --subscription ********-****-****-****-*********
- 註冊受控網路網狀架構的提供者:
在 Azure CLI 中,輸入 命令
az provider register --namespace Microsoft.ManagedNetworkFabric
。使用 命令
az provider show -n Microsoft.ManagedNetworkFabric -o table
監視註冊程式。註冊最多可能需要 10 分鐘的時間。 完成時,
RegistrationState
在輸出中會變更為Registered
。
隔離網域可用來啟用裝載於 Azure 操作員 Nexus 實例和外部網路之工作負載之間的第 2 層或第 3 層連線。
注意
操作員 Nexus 會保留 VLAN <=500 供平臺使用,因此此範圍內的 VLAN 無法用於您的(租使用者)工作負載網路。 您應該使用介於 501 到 4095 之間的 VLAN 值。
隔離網域管理的參數
參數 | 描述 | 範例 | 必要 |
---|---|---|---|
resource-group |
請特別針對您選擇的ISD使用適當的資源組名 | resourceGroupName | True |
resource-name |
l2isolationDomain 的資源名稱 | example-l2domain | True |
location |
NFC 建立期間使用的 AODS Azure 區域 | eastus | True |
nf-Id |
網路網狀架構標識碼 | “/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFresourcegroupname/providers/Microsoft.ManagedNetworkFabric/NetworkFabrics/NFname” | True |
Vlan-id |
VLAN 識別碼值。 VLAN 1-500 已保留且無法使用。 一旦指定,就無法變更 VLAN 標識符值。 如果需要修改 VLAN 識別碼值,則必須刪除隔離網域並重新建立。 範圍介於 501-4095 之間 | 501 | True |
mtu |
最大傳輸單位預設為 1500,如果未指定 | 1500 | |
administrativeState |
啟用/停用表示 isolationDomain 的系統管理狀態 | 啟用 | |
subscriptionId |
操作員 Nexus 實例的 Azure subscriptionId。 | ||
provisioningState |
指出布建狀態 |
L2 Isolation-Domain
您可以使用 L2 隔離網域,在操作員 Nexus 計算節點上執行的工作負載之間建立第 2 層連線。
建立 L2 隔離網域
建立 L2 隔離網域:
az networkfabric l2domain create \
--resource-group "ResourceGroupName" \
--resource-name "example-l2domain" \
--location "eastus" \
--nf-id "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/NetworkFabrics/NFname" \
--vlan-id 750\
--mtu 1501
預期輸出:
{
"administrativeState": "Disabled",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain",
"location": "eastus",
"mtu": 1501,
"name": "example-l2domain",
"networkFabricId": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFresourcegroupname/providers/Microsoft.ManagedNetworkFabric/networkFabrics/NFName",
"provisioningState": "Succeeded",
"resourceGroup": "ResourceGroupName",
"systemData": {
"createdAt": "2023-XX-XXT14:57:59.167177+00:00",
"createdBy": "email@address.com",
"createdByType": "User",
"lastModifiedAt": "2023-XX-XXT14:57:59.167177+00:00",
"lastModifiedBy": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"lastModifiedByType": "Application"
},
"type": "microsoft.managednetworkfabric/l2isolationdomains",
"vlanId": 750
}
顯示 L2 隔離網域
此指令會顯示 L2 隔離網域的詳細資料,包括其系統管理狀態:
az networkfabric l2domain show --resource-group "ResourceGroupName" --resource-name "example-l2domain"
預期的輸出
{
"administrativeState": "Disabled",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain",
"location": "eastus",
"mtu": 1501,
"name": "example-l2domain",
"networkFabricId": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/NFName",
"provisioningState": "Succeeded",
"resourceGroup": "ResourceGroupName",
"systemData": {
"createdAt": "2023-XX-XXT14:57:59.167177+00:00",
"createdBy": "email@address.com",
"createdByType": "User",
"lastModifiedAt": "2023-XX-XXT14:57:59.167177+00:00",
"lastModifiedBy": "d1bd24c7-b27f-477e-86dd-939e1078890",
"lastModifiedByType": "Application"
},
"type": "microsoft.managednetworkfabric/l2isolationdomains",
"vlanId": 750
}
列出所有 L2 隔離網域
此命令會列出資源群組中所有可用的 l2 隔離網域。
az networkfabric l2domain list --resource-group "ResourceGroupName"
預期的輸出
{
"administrativeState": "Enabled",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain",
"location": "eastus",
"mtu": 1501,
"name": "example-l2domain",
"networkFabricId": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxxxxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/NFName",
"provisioningState": "Succeeded",
"resourceGroup": "ResourceGroupName",
"systemData": {
"createdAt": "2022-XX-XXT22:26:33.065672+00:00",
"createdBy": "email@address.com",
"createdByType": "User",
"lastModifiedAt": "2022-XX-XXT14:46:45.753165+00:00",
"lastModifiedBy": "d1bd24c7-b27f-477e-86dd-939e107873d7",
"lastModifiedByType": "Application"
},
"type": "microsoft.managednetworkfabric/l2isolationdomains",
"vlanId": 750
}
變更 L2 隔離網域的系統管理狀態
您必須啟用隔離網域,才能將設定推送至網路網狀架構裝置。 使用下列命令來變更隔離網域的系統管理狀態:
az networkfabric l2domain update-admin-state --resource-group "ResourceGroupName" --resource-name "example-l2domain" --state Enable/Disable
預期的輸出
{
"administrativeState": "Enabled",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l2IsolationDomains/example-l2domain",
"location": "eastus",
"mtu": 1501,
"name": "example-l2domain",
"networkFabricId": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/NFName",
"provisioningState": "Succeeded",
"resourceGroup": "ResourceGroupName",
"systemData": {
"createdAt": "2023-XX-XXT14:57:59.167177+00:00",
"createdBy": "email@address.com",
"createdByType": "User",
"lastModifiedAt": "2023-XX-XXT14:57:59.167177+00:00",
"lastModifiedBy": "d1bd24c7-b27f-477e-86dd-939e107873d7",
"lastModifiedByType": "Application"
},
"type": "microsoft.managednetworkfabric/l2isolationdomains",
"vlanId": 501
}
刪除 L2 隔離網域
使用此指令移除 L2 隔離網域:
az networkfabric l2domain delete --resource-group "ResourceGroupName" --resource-name "example-l2domain"
預期輸出:
Please use show or list command to validate that isolation-domain is deleted. Deleted resources will not appear in result
設定 L3 隔離網域
第 3 層隔離網域可在操作員 Nexus 計算節點上執行的工作負載之間啟用第 3 層連線。 L3 隔離網域可讓工作負載與網路網狀架構裝置交換第3層資訊。
第 3 層隔離網域有兩個元件:
- 內部網路定義在 Azure 操作員 Nexus 計算節點和選擇性外部網路上執行之網路網狀架構之間的第 3 層連線。 您必須建立至少一個內部網路。
- 外部 網路 會透過您的 PES 提供因特網與內部網路之間的連線。
L3 隔離網域可讓您透過 BGP 將服務 IP 公告至網狀架構的工作負載。
L3 隔離網域有兩個 ASN:
- 網狀架構 ASN 是指網狀架構上網路裝置的 ASN。 建立網路網狀架構時已指定 Fabric ASN。
- 對等 ASN 是指運算元 Nexus 中網路函式的 ASN,它不能與網狀架構 ASN 相同。
成功布建 L3 隔離網域的工作流程如下所示:
- 建立 L3 隔離網域
- 建立一或多個內部網路
- 啟用 L3 隔離網域
若要變更 L3 隔離網域,請先停用 L3 隔離定義域 (管理員 istrative 狀態)。 完成變更之後,重新啟用 L3 隔離網域 (管理員 istrativeState 狀態):
- 停用 L3 隔離網域
- 變更 L3 隔離網域
- 重新啟用 L3 隔離網域
顯示、啟用/停用和刪除 IPv6 型隔離網域的程式與用於 IPv4 的程式相同。 用於建立隔離網域 501-4095 的 Vlan 範圍
下列參數可用於設定 L3 隔離網域。
參數 | 描述 | 範例 | 必要 |
---|---|---|---|
resource-group |
請特別針對您選擇的ISD使用適當的資源組名 | resourceGroupName | True |
resource-name |
l3isolationDomain 的資源名稱 | example-l3domain | True |
location |
NFC 建立期間使用的 AODS Azure 區域 | eastus | True |
nf-Id |
NFC 建立期間使用的 Azure subscriptionId | /subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/NetworkFabrics/NFName” | True |
隔離網域的下列參數是選擇性的。
參數 | 描述 | 範例 | 必要 |
---|---|---|---|
redistributeConnectedSubnet |
公告連線的子網預設值為 True | True | |
redistributeStaticRoutes |
公告靜態路由的值可以是 true/False。 預設值為 False | False | |
aggregateRouteConfiguration |
Ipv4 和 Ipv6 路由組態的清單 | ||
connectedSubnetRoutePolicy |
IPv4 或 Ipv6 L3 ISD 連線子網的路由原則設定。 請參閱說明檔,以使用正確的語法 |
建立 L3 隔離網域
使用此指令建立 L3 隔離網域:
az networkfabric l3domain create
--resource-group "ResourceGroupName"
--resource-name "example-l3domain"
--location "eastus"
--nf-id "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/NetworkFabrics/NFName"
注意
針對 MPLS 選項 10 (B) 透過 PE 裝置連線到外部網路,您可以在建立隔離網域時指定選項 (B) 參數。
預期的輸出
{
"administrativeState": "Disabled",
"configurationState": "Succeeded",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain",
"location": "eastus",
"name": "example-l3domain",
"networkFabricId": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/NFName",
"provisioningState": "Succeeded",
"redistributeConnectedSubnets": "True",
"redistributeStaticRoutes": "False",
"resourceGroup": "ResourceGroupName",
"systemData": {
"createdAt": "2022-XX-XXT06:23:43.372461+00:00",
"createdBy": "email@example.com",
"createdByType": "User",
"lastModifiedAt": "2023-XX-XXT09:40:38.815959+00:00",
"lastModifiedBy": "d1bd24c7-b27f-477e-86dd-939e10787367",
"lastModifiedByType": "Application"
},
"type": "microsoft.managednetworkfabric/l3isolationdomains"
}
建立不受信任的 L3 隔離網域
az networkfabric l3domain create --resource-group "ResourceGroupName" --resource-name "l3untrust" --location "eastus" --nf-id "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/NFName"
建立受信任的 L3 隔離網域
az networkfabric l3domain create --resource-group "ResourceGroupName" --resource-name "l3trust" --location "eastus" --nf-id "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/NFName"
建立管理 L3 隔離網域
az networkfabric l3domain create --resource-group "ResourceGroupName" --resource-name "l3mgmt" --location "eastus" --nf-id "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/NFName"
顯示 L3 隔離網域
您可以取得 L3 隔離網域詳細資料和系統管理狀態。
az networkfabric l3domain show --resource-group "ResourceGroupName" --resource-name "example-l3domain"
預期的輸出
{
"administrativeState": "Disabled",
"configurationState": "Succeeded",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain",
"location": "eastus",
"name": "example-l3domain",
"networkFabricId": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/NFName",
"provisioningState": "Succeeded",
"redistributeConnectedSubnets": "True",
"redistributeStaticRoutes": "False",
"resourceGroup": "2023-XX-XXT09:40:38.815959+00:00",
"systemData": {
"createdAt": "2023-XX-XXT09:40:38.815959+00:00",
"createdBy": "email@example.com",
"createdByType": "User",
"lastModifiedAt": "2023-XX-XXT09:40:46.923037+00:00",
"lastModifiedBy": "d1bd24c7-b27f-477e-86dd-939e10787456",
"lastModifiedByType": "Application"
},
"type": "microsoft.managednetworkfabric/l3isolationdomains"
}
列出所有 L3 隔離網域
使用此指令取得資源群組中所有可用的 L3 隔離網域清單:
az networkfabric l3domain list --resource-group "ResourceGroupName"
預期的輸出
{
"administrativeState": "Disabled",
"configurationState": "Succeeded",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain",
"location": "eastus",
"name": "example-l3domain",
"networkFabricId": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/NFName",
"provisioningState": "Succeeded",
"redistributeConnectedSubnets": "True",
"redistributeStaticRoutes": "False",
"resourceGroup": "ResourceGroupName",
"systemData": {
"createdAt": "2023-XX-XXT09:40:38.815959+00:00",
"createdBy": "email@example.com",
"createdByType": "User",
"lastModifiedAt": "2023-XX-XXT09:40:46.923037+00:00",
"lastModifiedBy": "d1bd24c7-b27f-477e-86dd-939e10787890",
"lastModifiedByType": "Application"
},
"type": "microsoft.managednetworkfabric/l3isolationdomains"
}
變更 L3 隔離網域的系統管理狀態
使用下列命令來變更 L3 隔離網域的系統管理狀態,以啟用或停用:
##Note:至少應該有一個內部網络可用來變更 L3 隔離網域的系統管理狀態。
az networkfabric l3domain update-admin-state --resource-group "ResourceGroupName" --resource-name "example-l3domain" --state Enable/Disable
預期的輸出
{
"administrativeState": "Enabled",
"configurationState": "Succeeded",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/ResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain",
"location": "eastus",
"name": "example-l3domain",
"networkFabricId": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/NFresourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/networkFabrics/NFName",
"provisioningState": "Succeeded",
"redistributeConnectedSubnets": "True",
"redistributeStaticRoutes": "False",
"resourceGroup": "NFResourceGroupName",
"systemData": {
"createdAt": "2023-XX-XXT06:23:43.372461+00:00",
"createdBy": "email@address.com",
"createdByType": "User",
"lastModifiedAt": "2023-XX-XXT06:25:53.240975+00:00",
"lastModifiedBy": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"lastModifiedByType": "Application"
},
"type": "microsoft.managednetworkfabric/l3isolationdomains"
}
az show
使用 命令來確認系統管理狀態是否已變更為 Enabled
。
刪除 L3 隔離網域
使用此指令移除 L3 隔離網域:
az networkfabric l3domain delete --resource-group "ResourceGroupName" --resource-name "example-l3domain"
show
使用或 list
命令來驗證隔離網域是否已刪除。
建立內部網路
成功建立 L3 隔離網域之後,下一個步驟是建立內部網路。 內部網路可藉由與網狀架構交換路由,在工作負載之間啟用第 3 層機架間和機架內部通訊。 L3 隔離網域可以支援多個內部網路,每個網路都位於不同的 VLAN 上。
下圖代表具有三個內部網路的範例網路函式:受信任、不受信任和管理。 每個內部網路都會在自己的 L3 隔離網域中建立。
這些網路的 IPv4 前置詞如下:
- 信任的網路:10.151.1.11/24
- 管理網路:10.151.2.11/24
- 未受信任的網路:10.151.3.11/24
下列參數可用於建立內部網路。
參數 | 描述 | 範例 | 必要 |
---|---|---|---|
vlan-Id |
範圍從 501 到 4095 的 Vlan 識別碼 | 1001 | True |
resource-group |
使用對應的 NFC 資源組名 | NFCresourcegroupname | True |
l3-isolation-domain-name |
l3isolationDomain 的資源名稱 | example-l3domain | True |
location |
NFC 建立期間使用的 AODS Azure 區域 | eastus | True |
下列參數是建立內部網路的選擇性參數。
參數 | 描述 | 範例 | 必要 |
---|---|---|---|
connectedIPv4Subnets |
HAKS 叢集工作負載所使用的 IPv4 子網 | 10.0.0.0/24 | |
connectedIPv6Subnets |
HAKS 叢集工作負載所使用的 IPv6 子網 | 10:101:1::1/64 | |
staticRouteConfiguration |
靜態路由的 IPv4/IPv6 前置詞 | IPv4 10.0.0.0/24 和 Ipv6 10:101:1::1/64 | |
staticRouteConfiguration->extension |
內部網路靜態路由的擴充旗標 | NoExtension/NPB | |
bgpConfiguration |
IPv4 nexthop 位址 | 10.0.0.0/24 | |
defaultRouteOriginate |
True/False「允許透過 BGP 公告路由時產生預設路由」 | True | |
peerASN |
網路函式的對等 ASN | 65047 | |
allowAS |
允許接收和處理路由,即使路由器在 AS-Path 中偵測到自己的 ASN 也一樣。 輸入為 0 為停用,可能的值為 1-10,預設值為 2。 | 2 | |
allowASOverride |
啟用或停用allowAS | 啟用 | |
extension |
內部網路的擴充旗標 | NoExtension/NPB | |
ipv4ListenRangePrefixes |
BGP IPv4 接聽範圍,/28允許的最大範圍 | 10.1.0.0/26 | |
ipv6ListenRangePrefixes |
BGP IPv6 接聽範圍,/127允許的最大範圍 | 3FFE:FFFF:0:CD30::/127 | |
ipv4ListenRangePrefixes |
BGP IPv4 接聽範圍,/28允許的最大範圍 | 10.1.0.0/26 | |
ipv4NeighborAddress |
IPv4 芳鄰位址 | 10.0.0.11 | |
ipv6NeighborAddress |
IPv6 芳鄰位址 | 10:101:1::11 | |
isMonitoringEnabled |
在內部網路上啟用或不允許監視 | False |
您必須先建立內部網路,才能啟用 L3 隔離網域。 此指令會建立具有 BGP 組態和指定對等互連地址的內部網路:
az networkfabric internalnetwork create
--resource-group "ResourceGroupName"
--l3-isolation-domain-name "example-l3domain"
--resource-name "example-internalnetwork"
--vlan-id 805
--connected-ipv4-subnets '[{"prefix":"10.1.2.0/24"}]'
--mtu 1500
--bgp-configuration '{"defaultRouteOriginate": "True", "allowAS": 2, "allowASOverride": "Enable", "PeerASN": 65535, "ipv4ListenRangePrefixes": ["10.1.2.0/28"]}'
預期的輸出
{
"administrativeState": "Enabled",
"bgpConfiguration": {
"allowAS": 2,
"allowASOverride": "Enable",
"defaultRouteOriginate": "True",
"fabricASN": 65050,
"ipv4ListenRangePrefixes": [
"10.1.2.0/28"
],
"peerASN": 65535
},
"configurationState": "Succeeded",
"connectedIPv4Subnets": [
{
"prefix": "10.1.2.0/24"
}
],
"extension": "NoExtension",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork",
"isMonitoringEnabled": "True",
"mtu": 1500,
"name": "example-internalnetwork",
"provisioningState": "Succeeded",
"resourceGroup": "ResourceGroupName",
"systemData": {
"createdAt": "2023-XX-XXT04:32:00.8159767Z",
"createdBy": "email@example.com",
"createdByType": "User",
"lastModifiedAt": "2023-XX-XXT04:32:00.8159767Z",
"lastModifiedBy": "email@example.com",
"lastModifiedByType": "User"
},
"type": "microsoft.managednetworkfabric/l3isolationdomains/internalnetworks",
"vlanId": 805
}
為 L3 隔離網域建立不受信任的內部網路
az networkfabric internalnetwork create --resource-group "ResourceGroupName" --l3-isolation-domain-name l3untrust --resource-name untrustnetwork --location "eastus" --vlan-id 502 --fabric-asn 65048 --peer-asn 65047--connected-i-pv4-subnets prefix="10.151.3.11/24" --mtu 1500
建立 L3 隔離網域的受信任內部網路
az networkfabric internalnetwork create --resource-group "ResourceGroupName" --l3-isolation-domain-name l3trust --resource-name trustnetwork --location "eastus" --vlan-id 503 --fabric-asn 65048 --peer-asn 65047--connected-i-pv4-subnets prefix="10.151.1.11/24" --mtu 1500
建立 L3 隔離網域的內部管理網路
az networkfabric internalnetwork create --resource-group "ResourceGroupName" --l3-isolation-domain-name l3mgmt --resource-name mgmtnetwork --location "eastus" --vlan-id 504 --fabric-asn 65048 --peer-asn 65047--connected-i-pv4-subnets prefix="10.151.2.11/24" --mtu 1500
使用單一躍點建立多個靜態路由
az networkfabric internalnetwork create --resource-group "fab2nfrg180723" --l3-isolation-domain-name "example-l3domain" --resource-name "example-internalNetwork" --vlan-id 2600 --mtu 1500 --connected-ipv4-subnets "[{prefix:'10.2.0.0/24'}]" --static-route-configuration '{extension:NPB,bfdConfiguration:{multiplier:5,intervalInMilliSeconds:300},ipv4Routes:[{prefix:'10.3.0.0/24',nextHop:['10.5.0.1']},{prefix:'10.4.0.0/24',nextHop:['10.6.0.1']}]}'
預期的輸出
{
"administrativeState": "Enabled",
"configurationState": "Succeeded",
"connectedIPv4Subnets": [
{
"prefix": "10.2.0.0/24"
}
],
"extension": "NoExtension",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/internalNetworks/example-internalnetwork",
"isMonitoringEnabled": "True",
"mtu": 1500,
"name": "example-internalNetwork",
"provisioningState": "Succeeded",
"resourceGroup": "ResourceGroupName",
"staticRouteConfiguration": {
"bfdConfiguration": {
"administrativeState": "Disabled",
"intervalInMilliSeconds": 300,
"multiplier": 5
},
"extension": "NoExtension",
"ipv4Routes": [
{
"nextHop": [
"10.5.0.1"
],
"prefix": "10.3.0.0/24"
},
{
"nextHop": [
"10.6.0.1"
],
"prefix": "10.4.0.0/24"
}
]
},
"systemData": {
"createdAt": "2023-XX-XXT13:46:26.394343+00:00",
"createdBy": "email@example.com",
"createdByType": "User",
"lastModifiedAt": "2023-XX-XXT13:46:26.394343+00:00",
"lastModifiedBy": "email@example.com",
"lastModifiedByType": "User"
},
"type": "microsoft.managednetworkfabric/l3isolationdomains/internalnetworks",
"vlanId": 2600
}
使用 IPv6 建立內部網路
az networkfabric internalnetwork create --resource-group "fab2nfrg180723" --l3-isolation-domain-name "example-l3domain" --resource-name "example-internalnetwork" --vlan-id 2800 --connected-ipv6-subnets '[{"prefix":"10:101:1::0/64"}]' --mtu 1500
預期的輸出
{
"administrativeState": "Enabled",
"configurationState": "Succeeded",
"connectedIPv6Subnets": [
{
"prefix": "10:101:1::0/64"
}
],
"extension": "NoExtension",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3domain2/internalNetworks/example-internalnetwork",
"isMonitoringEnabled": "True",
"mtu": 1500,
"name": "example-internalnetwork",
"provisioningState": "Succeeded",
"resourceGroup": "ResourceGroupName",
"systemData": {
"createdAt": "2023-XX-XXT10:34:33.933814+00:00",
"createdBy": "email@example.com",
"createdByType": "User",
"lastModifiedAt": "2023-XX-XXT10:34:33.933814+00:00",
"lastModifiedBy": "email@example.com",
"lastModifiedByType": "User"
},
"type": "microsoft.managednetworkfabric/l3isolationdomains/internalnetworks",
"vlanId": 2800
}
建立外部網路
外部網路可讓工作負載與提供者邊緣進行第 3 層連線。 它們也允許工作負載與防火牆和 DNS 等外部服務互動。 您需要網狀架構 ASN(在網路網狀架構建立期間建立)才能建立外部網路。
使用 Azure CLI 建立外部網路的命令包含下列參數。
參數 | 描述 | 範例 | 必要 |
---|---|---|---|
peeringOption | 使用 optionA 或 optionb 進行對等互連。 可能的值 OptionA 和 OptionB | OptionB | True |
optionBProperties | OptionB 屬性組態。 若要指定使用 exportIPv4/IPv6RouteTargets 或 importIpv4/Ipv6RouteTargets | “exportIpv4/Ipv6RouteTargets”: [“1234:1234”]}} | |
optionAProperties | OptionA 屬性的組態。 請參閱下一節中的OptionA範例 | ||
external | 這是選擇性參數,可透過 Provider Edge 裝置輸入 MPLS 選項 10 (B) 連線到外部網路。 使用此選項時,使用者可以輸入匯入和導出路由目標,如範例所示 |
針對選項 A,您需要先建立外部網路,才能啟用 L3 隔離網域。 外部相依於內部網路,因此若沒有內部網路,就無法啟用外部。 vlan-id 值應介於 501 到 4095 之間。
使用選項 B 建立外部網路
az networkfabric externalnetwork create --resource-group "ResourceGroupName" --l3domain "examplel3-externalnetwork" --resource-name "examplel3-externalnetwork" --peering-option "OptionB" --option-b-properties "{routeTargets:{exportIpv4RouteTargets:['65045:2001'],importIpv4RouteTargets:['65045:2001']}}"
預期的輸出
{
"administrativeState": "Enabled",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/externalNetworks/examplel3-externalnetwork",
"name": "examplel3-externalnetwork",
"optionBProperties": {
"exportRouteTargets": [
"65045:2001"
],
"importRouteTargets": [
"65045:2001"
],
"routeTargets": {
"exportIpv4RouteTargets": [
"65045:2001"
],
"importIpv4RouteTargets": [
"65045:2001"
]
}
},
"peeringOption": "OptionB",
"provisioningState": "Succeeded",
"resourceGroup": "ResourceGroupName",
"systemData": {
"createdAt": "2023-XX-XXT15:45:31.938216+00:00",
"createdBy": "email@address.com",
"createdByType": "User",
"lastModifiedAt": "2023-XX-XXT15:45:31.938216+00:00",
"lastModifiedBy": "email@address.com",
"lastModifiedByType": "User"
},
"type": "microsoft.managednetworkfabric/l3isolationdomains/externalnetworks"
}
使用選項 A 建立外部網路
az networkfabric externalnetwork create --resource-group "ResourceGroupName" --l3domain "example-l3domain" --resource-name "example-externalipv4network" --peering-option "OptionA" --option-a-properties '{"peerASN": 65026,"vlanId": 2423, "mtu": 1500, "primaryIpv4Prefix": "10.18.0.148/30", "secondaryIpv4Prefix": "10.18.0.152/30"}'
預期的輸出
{
"administrativeState": "Enabled",
"id": "/subscriptions/xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/externalNetworks/example-externalipv4network",
"name": "example-externalipv4network",
"optionAProperties": {
"fabricASN": 65050,
"mtu": 1500,
"peerASN": 65026,
"primaryIpv4Prefix": "10.21.0.148/30",
"secondaryIpv4Prefix": "10.21.0.152/30",
"vlanId": 2423
},
"peeringOption": "OptionA",
"provisioningState": "Succeeded",
"resourceGroup": "ResourceGroupName",
"systemData": {
"createdAt": "2023-07-19T09:54:00.4244793Z",
"createdAt": "2023-XX-XXT07:23:54.396679+00:00",
"createdBy": "email@address.com",
"lastModifiedAt": "2023-XX-XX1T07:23:54.396679+00:00",
"lastModifiedBy": "email@address.com",
"lastModifiedByType": "User"
},
"type": "microsoft.managednetworkfabric/l3isolationdomains/externalnetworks"
}
使用 Ipv6 建立外部網路
az networkfabric externalnetwork create --resource-group "ResourceGroupName" --l3domain "example-l3domain" --resource-name "example-externalipv6network" --peering-option "OptionA" --option-a-properties '{"peerASN": 65026,"vlanId": 2423, "mtu": 1500, "primaryIpv6Prefix": "fda0:d59c:da16::/127", "secondaryIpv6Prefix": "fda0:d59c:da17::/127"}'
支援的主要和次要 IPv6 前置詞大小為 /127。
預期的輸出
{
"administrativeState": "Enabled",
"id": "/subscriptions//xxxxxx-xxxxxx-xxxx-xxxx-xxxxxx/resourceGroups/NFResourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/example-l3domain/externalNetworks/example-externalipv6network",
"name": "example-externalipv6network",
"optionAProperties": {
"fabricASN": 65050,
"mtu": 1500,
"peerASN": 65026,
"primaryIpv6Prefix": "fda0:d59c:da16::/127",
"secondaryIpv6Prefix": "fda0:d59c:da17::/127",
"vlanId": 2423
},
"peeringOption": "OptionA",
"provisioningState": "Succeeded",
"resourceGroup": "ResourceGroupName",
"systemData": {
"createdAt": "2022-XX-XXT07:52:26.366069+00:00",
"createdBy": "email@address.com",
"createdByType": "User",
"lastModifiedAt": "2022-XX-XXT07:52:26.366069+00:00",
"lastModifiedBy": "email@address.com",
"lastModifiedByType": "User"
},
"type": "microsoft.managednetworkfabric/l3isolationdomains/externalnetworks"
}
啟用 L2 隔離網域
az networkfabric l2domain update-administrative-state --resource-group "ResourceGroupName" --resource-name "l2HAnetwork" --state Enable
啟用 L3 隔離網域
使用此指令來啟用不受信任的 L3 隔離網域:
az networkfabric l3domain update-admin-state --resource-group "ResourceGroupName" --resource-name "l3untrust" --state Enable
使用此指令來啟用受信任的 L3 隔離網域:
az networkfabric l3domain update-admin-state --resource-group "ResourceGroupName" --resource-name "l3trust" --state Enable
使用此指令來啟用管理 L3 隔離網域:
az networkfabric l3domain update-admin-state --resource-group "ResourceGroupName" --resource-name "l3mgmt" --state Enable