Transit, routing and DNS design
Peering, shared networks and hubs
Peering links two virtual networks. Ordinary peering does not automatically let traffic transit a third peer: A-B and B-C do not establish A-C reachability. A managed transit hub is designed to forward traffic between eligible attachments using explicit route tables and propagation. A shared network instead lets multiple administrative projects or accounts use a centrally managed network; subnet sharing is not equivalent to peering. AWS VPC sharing, Azure hub-and-spoke VNets and Google Shared VPC have different ownership and permissions models. A hub reduces pairwise connections (five spokes need five hub links rather than ten full-mesh pairs), but concentrates dependencies and processing costs. Segment routing domains by trust, and avoid assuming every connected spoke should communicate.
Trace a route in both directions
Use the fictional bookstore topology from the previous lesson. A request from 10.10.1.5 to 10.20.8.4 travels from office router to hub to application inspection path. The application reply needs a route back to 10.10.1.5 through the expected inspection path. Stateful firewalls may reject replies that traverse a different appliance without shared state. Route-table association selects the table used for incoming traffic at the relevant hub attachment; propagation determines which eligible learned prefixes are installed in target tables. A route can be present in the wrong table and therefore have no effect.
| Test | Forward path | Return path | Expected modeled result |
|---|---|---|---|
| Office to app | Hub and inspector | Same inspector | Reachable if permitted |
| Office to analytics | No route | Not applicable | Unreachable |
| Office to app, bad return | Hub and inspector | Bypasses inspector | Stateful session may fail |
| Primary lost | Backup after convergence | Backup after convergence | Reachable if capacity and rules permit |
AWS TGW peering uses static routing in the documented model; do not assume dynamic inter-region propagation. Azure virtual hub routing supports distinct route tables and routing intent. NCC hybrid spokes can exchange routes through supported BGP arrangements; verify which spokes are eligible for site-to-site transfer. For cross-region links, measure latency, plan independent regional failure domains and check inter-region transfer charges. Reachability does not imply authorization.
Handle overlapping CIDRs
Suppose an acquired office already uses 10.20.8.0/24. This overlaps the application spoke 10.20.0.0/16. Routers cannot infer which organization owns a destination address from the address alone. Prefer coordinated IP address management and renumbering when feasible. If renumbering cannot happen immediately, evaluate supported NAT/translation or application proxies, with explicit mappings and return paths. Some peering mechanisms reject overlapping address ranges outright. Do not assume NAT solves DNS, embedded addresses, certificates or audit identity. A candidate 10.40.0.0/16 does not overlap any of the three original networks, but must still be checked against the full enterprise inventory.
Run a local longest-prefix example
The following Python standard-library exercise models only IPv4 longest-prefix matching with a deliberately ambiguous equal-prefix tie. Real routers use additional precedence, BGP attributes, policy and ECMP, and can reject invalid or conflicting routes. The model has no sockets and cannot test real forwarding.
from ipaddress import ip_address, ip_network
def next_hop(destination, routes): address = ip_address(destination) matches = [(ip_network(prefix), hop) for prefix, hop in routes if address in ip_network(prefix)] if not matches: return "NO_ROUTE" longest = max(network.prefixlen for network, _ in matches) winners = {hop for network, hop in matches if network.prefixlen == longest} return next(iter(winners)) if len(winners) == 1 else "AMBIGUOUS"
routes = [("10.20.0.0/16", "HUB"), ("10.20.8.0/24", "INSPECT")]print(next_hop("10.20.8.4", routes))print(next_hop("10.20.9.4", routes))print(next_hop("10.30.1.4", routes))Expected output:
INSPECTHUBNO_ROUTEThe more-specific /24 selects inspection for 10.20.8.4. The /16 serves other application destinations. The analytics network has no entry. Equal-length different next hops return AMBIGUOUS rather than inventing a vendor tie-break. A default route, if present, would change the no-route outcome. Add return-route tests independently.
Private DNS and packet size
Private DNS resolves internal names in authorized network contexts. A hybrid design often forwards selected private suffixes between on-premises resolvers and cloud resolver endpoints. For example, an internal test zone shop.example can return 10.20.8.4 to authorized office clients. DNS forwarding requires reachable resolver endpoints, allowed query/response traffic and correct zone association. Avoid forwarding loops, stale records, unintended public fallback, and conflicting zones. Test the answer from each network and then test application reachability; a correct DNS answer cannot repair a missing route.
MTU is the largest IP packet allowed on a link. Encapsulation adds overhead; the smallest effective path MTU constrains the path. In a simplified model with a 1,500-byte outer IP MTU and 80 bytes of assumed encapsulation overhead, the inner IP MTU is 1,420 bytes. For IPv4/TCP with 20-byte headers each and no options, the MSS is 1,380 bytes. Actual tunnel overhead varies. Packet loss for large transfers despite small successful probes can indicate MTU or path-MTU discovery problems. Check supported provider MTUs, ICMP handling and approved MSS adjustment; avoid blanket firewall changes. Enforce egress control with routing plus explicit firewall/proxy policy and logging; a private path is not a security boundary by itself.
Practice and review
Add a proposed overlapping office CIDR to the topology, trace the forward and return paths, and document DNS and MTU checks. Identify which route tables should receive which prefixes and why a default route may leak traffic. Produce a failure matrix with expected outcome, observation and unresolved risks. Use only offline fixtures. Next: observability and operational intelligence.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Transit, routing and DNS design — knowledge check
Choose the best answer for each offline scenario.
A peers with B and B with C. What follows for A to C?
Which prefix wins in the example for 10.20.8.4?
Why might an asymmetric reply fail?
What should you do when two connected networks overlap?
Outer MTU is 1500 and modeled overhead is 80 bytes. What is inner MTU?