我有一个具有2个子网的vNet的分支模板。我正尝试使用静态私有IP地址将Nic部署到其中的一个。它曾经是动态的,它运行良好。现在它是静态的,我已经设置好了我想要的IP,但是当我部署时,它说IP是无效的。我尝试更改IP设置,但它仍然不工作...保留子网范围内的私有IP地址
从我的模板中提取:(subnetPart是一个参数化的数字,因为我们有几个将连接的vnets,但子网不需要冲突)
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."
所以不WTF
任何想法工作,要么...?非常感谢!
我相信你的最大ip是:10.100.10.14(分钟8) – MBen