Soru

Zorluk: OrtaConfigure User-Defined Routes and Routing Tables

An administrator is managing an Azure virtual network named `VNet-Enterprise` with an address space of 172.16.0.0/12172.16.0.0/12. The virtual network includes the following subnets:
- `Subnet-Public` (172.16.1.0/24172.16.1.0/24)
- `Subnet-FW` (172.16.2.0/24172.16.2.0/24) containing a firewall network virtual appliance (NVA) at IP address 172.16.2.4172.16.2.4
- `Subnet-Private` (172.20.0.0/16172.20.0.0/16)

A route table named `RT-Public` is associated with `Subnet-Public`. The route table contains the following user-defined routes:
- Route 1: Address prefix: 172.20.0.0/24172.20.0.0/24, Next hop type: Virtual appliance, Next hop address: 172.16.2.4172.16.2.4
- Route 2: Address prefix: 172.20.0.0/16172.20.0.0/16, Next hop type: Virtual network gateway

IP forwarding is enabled on the firewall NVA. A virtual machine in `Subnet-Public` attempts to initiate a connection to a database server at IP address 172.20.0.50172.20.0.50.

How will Azure route the traffic destined for the database server?

  1. To the virtual appliance at 172.16.2.4172.16.2.4 because the route with the address prefix 172.20.0.0/24172.20.0.0/24 has the longest prefix match.Cevap
  2. B
    To the virtual network gateway because Route 2 has a higher precedence than Route 1 due to the next hop type definition.
  3. C
    Directly to the database server in Subnet-Private because the system route for the virtual network address space (172.16.0.0/12172.16.0.0/12) overrides user-defined routes.
  4. D
    The traffic is dropped because Route 1 defines a next hop address that is in a different subnet than the destination IP address.

Cevap

To the virtual appliance at 172.16.2.4172.16.2.4 because the route with the address prefix 172.20.0.0/24172.20.0.0/24 has the longest prefix match.
The destination IP address 172.20.0.50172.20.0.50 matches both Route 1 (172.20.0.0/24172.20.0.0/24) and Route 2 (172.20.0.0/16172.20.0.0/16). According to Azure's routing rules, the route with the longest prefix match (most specific mask, which is /24 in this case) is selected. Since Route 1 is selected, the traffic is forwarded to the virtual appliance at 172.16.2.4172.16.2.4.

Adım Adım Çözüm

1
Determine the destination IP address and check which address prefixes in the route table and system routes match this destination.
The destination IP 172.20.0.50172.20.0.50 matches three prefixes: the system route for the virtual network (172.16.0.0/12172.16.0.0/12), Route 1 (172.20.0.0/24172.20.0.0/24), and Route 2 (172.20.0.0/16172.20.0.0/16).
Before applying routing logic, all matching routes must be identified.
2
Apply the Longest Prefix Match (LPM) rule to select the most specific route.
The prefix 172.20.0.0/24172.20.0.0/24 (/24) is longer and more specific than 172.20.0.0/16172.20.0.0/16 (/16) and 172.16.0.0/12172.16.0.0/12 (/12). Therefore, Route 1 is selected.
Azure uses the longest prefix match to choose the route for a packet.
3
Determine the routing action based on the selected route's next hop configuration.
The next hop is the virtual appliance at 172.16.2.4172.16.2.4, so traffic is forwarded to this IP address.
The selected route dictates the next hop where the packet will be sent.

Anahtar Kavram

Azure route selection order and Longest Prefix Match (LPM)
Bu soruyu puanla