我有一个带有 2 个子网的 vNet 的 arm 模板。我正在尝试使用静态私有 IP 地址将 Nic 部署到其中一个。它曾经是动态的,并且运行良好。现在它是静态的,我已经设置了我希望网卡拥有的 IP,但是当我部署时,它说 IP 无效。我尝试更改我设置的IP,但它仍然不起作用......
从我的模板中提取:(subnetPart 是一个参数化的数字,因为我们有几个要连接的 vnet,但子网不需要冲突)
variables
"virtualNetworkRange": "[concat('10.', parameters('subnetPart'), '.10.0/26')]",
"ssrsSubnetRange": "[concat('10.', parameters('subnetPart'), '.10.8/29')]",
"ssrsPrivateIP": "[concat('10.', parameters('subnetPart'), '.10.10')]",
resources
{
"name": "[variables('ExternalServicesVNET')]",
"type": "Microsoft.Network/virtualNetworks",
"location": "[resourceGroup().location]",
"apiVersion": "2015-05-01-preview",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('virtualNetworkRange')]"
]
},
"subnets": [
{
"name": "[variables('jumpSubnetName')]",
"properties": {
"addressPrefix": "[variables('jumpSubnetRange')]"
}
},
{
"name": "[variables('ssrsSubnetName')]",
"properties": {
"addressPrefix": "[variables('ssrsSubnetRange')]"
}
}
]
}
},
{
"name": "[variables('SSRSvmNicName')]",
"type": "Microsoft.Network/networkInterfaces",
"location": "[resourceGroup().location]",
"apiVersion": "2015-06-15",
"dependsOn": [
"[concat('Microsoft.Network/virtualNetworks/', variables('ExternalServicesVNET'))]"
],
"tags": {
"displayName": "SSRSvmNic"
},
"properties": {
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"privateIPAllocationMethod": "Static",
"privateIPAddress": "[variables('ssrsPrivateIP')]",
"subnet": {
"id": "[variables('ssrsSubnetRef')]"
},
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('nsgName'))]"
}
}
}
]
}
}
这是错误消息:
Resource Microsoft.Network/networkInterfaces 'hub2e40SsrsNic' failed with message '{
"error": {
"code": "PrivateIPAddressInReservedRange",
"message": "Private static IP address 10.100.10.10 falls within reserved IP range of subnet prefix 10.100.10.8/29.",
嗯好的,所以它不能在子网范围内,因为这些地址是保留的?好的,所以我将 IP 的最后一位更改为 16,超出子网范围。
Resource Microsoft.Network/networkInterfaces 'hub2e40SsrsNic' failed with message '{
"error": {
"code": "PrivateIPAddressNotInSubnet",
"message": "Private static IP address 10.100.10.16 does not belong to the range of subnet prefix 10.100.10.8/29."
所以这也行不通...
有任何想法吗?非常感谢!