我有一個具有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