Hands-On Networking with Azure
上QQ阅读APP看书,第一时间看更新

Adding subnets to the virtual network

There are two types of subnets in Azure VNet:

  • Subnet: The normal form of subnets, which is the result of dividing the virtual network
  • Gateway subnet: The subnet that acts as a gateway for communication with other networks

By default, you must specify at least one subnet while creating the virtual network, as discussed earlier. However, later you might need to have other subnets, and to do so, you have to follow these steps:

  1. Navigate to the virtual network that you have created earlier and then go to SETTINGS | Subnets, as shown in the following screenshot:
Figure 1.11: Virtual Network Subnets
  1. Click on Subnets, and a new blade will be opened, where you need to specify the following:
    • Name: The name of the subnet.
    • Address range (CIDR block): The subnet's address range in CIDR notation (considering that it must be contained by the address space of the virtual network).
    • Network security group: This works like a firewall to filter what traffic that be allowed to flow in/out of the network. More information about this topic will be covered in Chapter 2, Delving into Azure Virtual Networks.
    • Route table: You can expand the communication between multiple VNets by setting a route table. More information about this topic will be covered in Chapter 4, Network Connectivity Scenarios in Azure.
    • Service endpoints (Preview): As mentioned earlier, this can be used to let some Azure services communicate in Microsoft's backbone network. More information about it will be covered in Chapter 2, Delving into Azure Virtual Networks.
Figure 1.12: Adding subnets
  1. Once you click on OK, the subnet will be added within a moment.

When specifying the subnet's address range, you must have noted that there are five reserved IPs. The first and the last IPs are reserved for protocol conformance known as network and broadcast in addition to three more IPs used for Azure services.

Creating the gateway subnet is no different than the normal subnet creation, except you cannot set the name of the gateway subnet, as shown in the following screenshot:

Figure 1.13: Adding gateway subnet

Every virtual network can only have one gateway subnet.