Queries related to utilization, distribution and pricing of IP addresses on Azure - azure

I have queries related to utilization, distribution and pricing of IP addresses on Azure.
Taking an example, 10.0.0.0/27. It says, 10.0.0.0 - 10.0.0.31 (32 addresses).
After expanding I found as..
CIDR Range: 10.0.0.0/27
Netmask: 255.255.255.224
Wildcard Bits: 0.0.0.31
First IP: 10.0.0.0
Last IP: 10.0.0.31
Total Host: 32
I assigned 10.0.0.0/27 for both VNet and Subnet on Azure Portal.
After creating the virtual network, I see available address 27.
1) No virtual machine created yet, then why the available addresses are 27?
2) What is the IP range for 27 available addresses?
While creating Gateway Subnet, I see errors like...
The specified address space overlaps with subnet 'Subnet1' which has a range of '10.0.0.0/27'.
Your subnet is not contained within the address space for this virtual network: 10.0.0.0/27.
3) How to calculate and decide the available gateway subnet address space for a virtual network?
4) For using gateway subnet, is it mandatory or recommended to add another subnet before or after creating gateway subnet?
5) Why address space is required for creating a gateway subnet? Is gateway subnet not a fixed or static IP address for creating connection?
6) In case of virtual network, 10.0.0.0/27, is pricing done on the basis of utilized IP addresses only?
7) In case of virtual network, 10.0.0.0/27, if there are some un-utilized IP addresses, are they blocked to me or my subscription or un-utilized IP addresses can be used by someone else on his azure portal?
I sincerely request to clarify all seven queries.

Q1-Q3:
Read Azure VNet FAQ, Azure reserves 5 IP addresses within each subnet. These are x.x.x.0-x.x.x.3 and the last address of the subnet. So you have 27 available addresses for the address range 10.0.0.0/27. It's address range 10.0.0.4 - 10.0.0.30
Q4: It's not mandatory for creating Gateway subnet order, you only need to calculate the CIDR Range for each subnet including in your current virtual network address range.
Q5: If you need to configure a virtual network gateway. The gateway subnet contains the IP addresses that the virtual network gateway services use. All gateway subnets must be named GatewaySubnet to work properly. Read here. If you don't need a VPN gateway, you don't need to create Gateway subnet in this VNet.
Q6-Q7: Have a look at Azure VNet pricing and VPN gateway pricing.
Azure Virtual Network is free of charge. Every subscription is allowed
to create up to 50 virtual networks across all regions.
Public IP addresses, and reserved IP addresses used on services inside
a virtual network, are charged.
Network appliances such as VPN Gateway and Application Gateway that
are run inside a virtual network are also charged.
For the un-utilized IP addresses, It looks like unassigned private IP address in your on-premise network. They can continue to be assigned to the resources when you deployed some resources in the VNet or subnet.
For more details, you can read this blog: Understanding CIDR Notation when designing Azure Virtual Networks and Subnets

Azure reserves 5 IP addresses within each subnet. These are x.x.x.0-x.x.x.3 and the last address of the subnet.
x.x.x.0 and the last address of the subnet is reserved for protocol conformance.
x.x.x.1-x.x.x.3 is reserved in each subnet for Azure services.
Address space is the super set of subnets. So, your Address space needs to be bigger and should be able to accommodate the IPs which you are defining for the Subnets.
Basic Subnetting would help.
It is not recommended to deploy your workloads on Gateway subnet. So you need other subnets to deploy your workloads.
Gateways does have a Private IP address which it gets from the Gateway subnet. As I mentioned in Point 2, Address space is the super set of subnets.
Only Public IPs are charged. Private IP which you define in Azure VNET is not charged.
Since it is Private IP address, you can create another 10.0.0.0/27 VNET in the same region. VNET provides a isolation and the address which you define is isolated to that VNET.

Related

Azure VNet IP address charges

I have created a Virtual network with following CIDR. This address space has 256 total address.
CIDR 10.0.0.0/24
will i be billed for all available/reserved IP addresses? If we check Azure IP Address Price it says we need to pay for both reserved and used IP addresses. In this case if someone creates a vnet of say /16 or /8 his bill should sky rocket.
Azure has also create default subnet with CIDR /8 when i create kubernetes cluster without mentioning virtaul network with it. If they charge for reserved address space then this should have huge cost associated with.
Please confirm how azure charge for IP address range created using CIDR.
Azure only charges you for reserved PUBLIC IP addresses. Your VNET uses a private address space, so no costs for that will occur.

networking in azure kubernetes services

Here in Azure AKS networking using kubenet it is mentioned that IP address range for --dns-cidr, --service-cide and --docker-brige-ip range should be an address space that isn't in use elsewhere in your network environment. I have also created Vnet and this AKS should be in that vnet.
Does this mean, for DNS, Service and Docker bridge, IP address range should be different then VNet IP range?
Pod CIDR, can we have it different then VNet range? As I am using Kubenet pod IP will not be from Vnet subnet.
yes, they should not overlap.
this is virtual pod ip address space, not the one they will get from your vnet (if you would be using Azure CNI). these would be the internal only kubernetes ip addresses. With kubenet they would get routed to the appropriate nodes with UDR and then the node would forward traffic to the appropriate pod.

How the IP adressess are connected in Azure vnet to vnet connection

I have just started working on Azure Cloud Services and was trying to establish v-net to v-net Connection within the same subscription and a different location.
Vnet name = vnetOne
Address space = 10.1.0.0/16
Resource Group = RG
Location = Australia East
Subnet name = SubnetOne
Address range = 10.1.0.0/24
GatewaySubnet = 10.1.1.0/24
Virtual network gateway name = VnetOneGateway
Gateway type = VPN
VPN type = Route-based
SKU = vpnGw1
Public IPAddress=13.75.198.231
VnetOneGateway=13.75.192.172(13.75.198.231)
Connection(VnetOneGatewayToVnetTwoGateway)=52.232.102.16
Vnet name = VnetTwo
Address space = 10.6.0.0/16
Resource Group = RG
Location = EuropeWest
Subnet name = SubnetTWo
Address range = 10.6.0.0/24
GatewaySubnet = 10.6.1.0/24
Virtual network gateway name = VnetTwoGateway
Gateway type = VPN
VPN type = Route-based
SKU = VpnGw1
Public IP Address=104.40.194.26
VMTwo: 51.145.142.190
VMTWo=13.75.193.47 and 10.1.0.4
VnetTwoGateway=52.232.102.16(40.115.46.34)
Connection (VnetTwoGatewayToVnetOneGateway) =13.75.192.172
Question 1. I created vnet's with defined Address spaces and then created subnet.Inside subnet I have created VM's which has two ip's one is from taken Subnet Address space and other ---is it assigned randomly?
Question 2. What is difference between GatewaySubnet and VirtualNetwork Gateway.Means their use.I have seen lot of videos but no one has explained the logical aspect of it.A diagramtic representation will help a lot to understand this.I have only understanding that Virtual Network gateway creates tunnel for interaction between the vnet's using shared key,then what's the role of gateway Subnet?
Question 3. We have to create the public IP Address and we map it with Virtual Network Gateway.Once the Virtual Network Gateway is created there is IP Address assigned to these gateways
VnetOneGateway=13.75.192.172(13.75.198.231)
VnetTwoGateway=52.232.102.16(40.115.46.34)
which is different from Mapped Public IP Address
Public IPAddress=13.75.198.231(Created for mapping Virtual Network Gateway)
Public IP Address=104.40.194.26.Not able to understand the logic in this scenario.What does the Virtual Network IP Address does and what does the Public Address IP does which is mapped to Virtual Network Gateway?
Question 4. Can I get the diagrammatic representation of all the IP's interacting with each other.May be I am missing something thats why I am not able to get the logical connection in this.
Any shared link will also be a great help.
Thanks in Advance!!
As I see what you want is to get a connection between vnets. So I suggest the Vnet Peering, it's just a simple way to set up.
Question 1: If you have a VM with two IPs, all the IPs will be assigned be the subnet in order, for example, the one is 10.0.0.4 and the other is 10.0.0.5. You can get more details about Virtual Network Peering here.
Question 2: IPs in GatewaySubnet is used to transmit the flow from one network to another as Network Routing does. And the Virtual Network Gateway is a tool that used to create the VPN, also as you say:
Virtual Network gateway creates a tunnel for interaction between the
vnets using a shared key.
Question 3: All the Public IPs are used to connect our logic network to the Internet no matter what they are mapped. The Virtual Network IP Addresses are assigned to the devices, let them have an address in Vnet. And the Public Address IP which is mapped to Virtual Network Gateway just makes the Virtual Network Gateway can connect the Internet.
You can get more details about Public IPs here.
Question 4: This question is too difficult to list particularly, you can get what you want from the link here.

How to add a gateway subnet to Vnet that contains VMs on Azure

My existing Vnet has a default subnet: 10.0.1.0/24
And I have a VM in it with IP address: 10.0.1.8
Now I want to add a gateway subnet so that I can connect web app to it, and the web app should be able to use the VM's private IP to access it.
But when I try to add a gateway subnet, I can't specify 10.0.1.0/24 because it overlaps with the default. I can't specify 10.0.0.0/24 either because the VM is not within this range.
How do I do it, then?
You cannot add a gateway subnet that uses the same address space (10.0.1.0/24) as VNet.
If you original subnet has a smaller address space (ie: /26, /28) then you can add a gateway subnet using that format.
If you original subnet is using the whole address space (ie: /24) then a work around will be to add a new address space to the VNet and add new subnets on that address to the VNet splitting them up correctly.

Why Azure reserves first four IP address of a subnet

As the question says, I want to know, why Azure reserves first four and the last IP address of a subnet?
Yes. Azure reserves 5 IP addresses within each subnet. These are x.x.x.0-x.x.x.3 and the last address of the subnet. x.x.x.1-x.x.x.3 is reserved in each subnet for Azure services.
x.x.x.0: Network address
x.x.x.1: Reserved by Azure for the default gateway
x.x.x.2, x.x.x.3: Reserved by Azure to map the Azure DNS IPs to the VNet space
x.x.x.255: Network broadcast address
See the Azure faq
Azure reserves the first and last address in each subnet for protocol conformance. And three additional addresses are reserved for Azure service usage. Azure do not go into detail about the services that uses the reserved ip addresses, but we can say for sure that the default gateway is an Azure service that will use the reserved ip addresses

Resources