Creating and configuring VNet peering

In the following demonstration, we are going to create and configure VNet peering from the Azure portal. We need two VNets for this. We are going to use the VNet that we created in the first demonstration, and with the resource group for which we created the VNet in the previous chapter, we are going to create an additional VNet, which has a different address space than the first VNet. Note that you can't use overlapping address spaces when you peer two VNets together.

To create the VNet and set up VNet peering from the Azure portal, go through the following steps:

  1. Navigate to the Azure portal by opening https://portal.azure.com/.
  2. Click Create a resource | Networking | Virtual network. Create a new VNet.
  3. Add the following values:
    • NamePacktVNetPeering
    • Address space10.2.0.0/16
    • Subscription: Pick a subscription
    • Resource group: PacktVNetResourceGroup
    • Location: East US
    • Subnet: default
    • Address range10.2.0.0/24
    • DDoS protection: Basic
    • Service endpoints: Disabled
    • Firewall: Disabled
  4. Click Create.
  1. The VNet is created for you. After its creation, open the VNet Overview blade of the VNet that we created in the first demonstration of this chapter, which is called PacktVirtualNetwork, as follows:

VNet overview blade
  1. Then, under Settings, select Peerings. Click Add in the top menu, as shown in the following screenshot:

Adding a new VNet peering
  1. In the Add peering blade, add the following values:
    • Name of the peering from PacktVirtualNetwork to PacktVNetPeeringPacktPeering.
    • Virtual network deployment model: Resource manager.
    • Subscription: Keep the default selected.
    • Virtual network: Select PacktVNetPeering.
  2. There are a couple of other settings that you can set here as well. The first one is Allow forwarded traffic from PacktVirtualNetwork to PacktVNetPeering. This means that you allow traffic from outside the peered VNet. The second one is Configure gateway transit settings. This means that the peered network uses the gateway of this VNet to connect to resources outside the peered VNet, for instance, an on-premises environment. The last one is Configure Remote Gateway Settings. For this setting, you have to enable the previous one as well, but by enabling this one, you are using the other VNet gateway to connect resources outside the VNet.
  3. Click OKand the peering is created.

We have now configured VNet peering from the Azure portal. In the next section, we are going to look at VNet-to-VNet.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.33.235