Networking addressing documentation #5
-
Since you pointed me over here from the Bicep issue, I've really taken a liking to how you have all this set up. I'm building out a POC matching the idea, but I'm at a loss for how you're working out the network addressing. You briefly speak to the fact that it's a /20 address space dividing into a hub and 7 spokes, but how you've actually got it allocated for your subnets is puzzling me. I see that you set up the lower and upper ranges here, using the values from the tenant-specific values defined here and that the third octet is determined by the DeploymentID (142- (2 * DeploymentID)) where the NetworkIDUpper is simply the NetworkID with the third octet value + 1. So then to set up the networks, we iterate through the SubnetInfo values from the tenant-specific parameters and append those Prefixes to the NetworkID (unless it's the snMT02, in which case we use NetworkIDUpper). Some questions then:
snWAF01 snFE01 snAD01 snBE01 AzureBastionSubnet AzureFirewallSubnet GatewaySubnet snMT02 I guess what I'm getting at here is why you didn't just use a 10.0. address space and assign each of these subnets to a 10.0.X/24 so they'd each have 255 addresses and just swap X with the DeploymentID. Yes, you wind up with a lot of room for additional subnets that you're not using, but you get far more IP addresses for each subnet (particularly useful if you're using VMSS instead of individual VMs for the app).
I appreciate the continued help! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Sorry for the delay on responding here. I'd be happy to get you up to speed on how things work. I deploy this solution on my customer projects. Some opt for dividing the /20 into 16 * 256 addresses. However the default here is to divide that into 8 * 512. There are other options, however let's start with those defaults. 8 separate environments per region, works well in most cases. If you clone the AOA tenant then rename it... Any of the parameter files will have ALL subnets using the 512 addresses... MT02 has a dedicated 256 addresses, then the other subnets use the other 256, divided up. The P0 is a hub, so the subnets are different than all other spoke environments. E.g. Gateways etc. Anyway, we can chat some more, to go over the details. This multi tenant model works really well, plus many best practices are built in. |
Beta Was this translation helpful? Give feedback.
-
I am interested in maybe selecting a better default number of addresses, larger than the /20. Given App gateways have recently started requesting more address space and also for AKS. Although I am starting to use WAF/App gateway less and more FrontDoor. If you have any preferences, I would be interested in feedback. The special network address for the MT02 is because I have to set the bit in the 3rd octed to 1 for that Subnet. |
Beta Was this translation helpful? Give feedback.
-
The purpose behind this method for doing IP and network address allocation is to provide 2 simple capabilities. You assign all static IP addresses, simply by providing the last octet IP address Also the Network addresses are all dynamic from the DeploymentID So you can have any 8 environments (per region), just don't repeat any numbers. e.g. S1, D2, T3, T4, U5, Q6, P7, P8 |
Beta Was this translation helpful? Give feedback.
-
Apologies - definitely missed the earlier responses in my email. Having written out my own global per-tenant ARM template now inspired by your approach, but shifted more towards my own needs, I took a little bit of a different tack. Similar to your approach, I have an While each tenant, like yours, has a /20, each tenant uses a set of flags to identify which features are enabled or not and all Azure services with any sort of networking block then definite their own blocks from that /20. While this is usually a /24 for each, there are some services (virtual network gateway comes to mind) that fail to provision if you assign them sizable blocks, so each resource maps to an "options" array that specifies defaults for each in order to get pre-picked offsets. Of course, if some resources are disabled, there's a whole wasted subnet, but I'd rather have the consistency of knowing, say, that I can always find Application Gateway on 10.X.14.0/24 no matter the tenant I'm looking at, eliminating some cross-tenant complexity. And besides, the approach means I have 255 resources I can handle and so far I haven't used up to but 10.0.21.0/24, so I'm not worried about capping out. All that aside, your framework (and feedback on so many of my Bicep issues) has been wildly influential and helpful in how I pieced together this deployment (between naming, modularizing, file organization, where to keep "constants" and tenant deployments, etc.) and I can't thank you enough for the help. Once I'm sure I've got all the secrets out of here, I'd be more than happy to publish my own for comparison. For the most part, I tried to get away from having separate JSON configuration files and instead build absolutely everything into the ARM template, using deployment scripts where ARM was lacking. As time warrants, I'd be more than happy to circle back and share my own experiences back to your project. The weightiest parts of mine are almost certainly the Managed Service Fabric pieces (and their respective application and service deployments) and Data Explorer (and setup of the tables and service mappings), but I'm sure I can find some common pieces as well. |
Beta Was this translation helpful? Give feedback.
The purpose behind this method for doing IP and network address allocation is to provide 2 simple capabilities.
You assign all static IP addresses, simply by providing the last octet IP address
Also the Network addresses are all dynamic from the DeploymentID
So you can have any 8 environments (per region), just don't repeat any numbers.
e.g. S1, D2, T3, T4, U5, Q6, P7, P8
Sandbox, Dev, Test, UAT, QA, Prod etc. <-- the letters are tags on the type of environment
The number is what determines the Network id 😎✅