Design an address plan that survives a merger

short · 35 min · Objective 1.3

Task

Choose an address range for three environments in two regions, plus room for a partner network you may one day have to peer with. The constraint that makes this hard is the one from the lesson: overlapping ranges cannot be peered, and the decision is effectively permanent.

Steps

  1. In lab/addressing.md, allocate a range for production, staging and development, in two regions each -- six virtual networks. State the CIDR for each and the number of usable addresses. Also list the six, plus the partner reserve from step 4, in lab/ranges.txt: one per line as name CIDR, for example prod-east 10.20.0.0/16.
  2. Inside the production network, carve public and private subnets across three availability zones. Remember the provider reserves several addresses per subnet and show the usable count AFTER that reservation.
  3. Deliberately avoid 10.0.0.0/16, and write the sentence explaining why the most popular default is the worst choice for a network you may need to peer.
  4. Reserve a range for a future partner or acquisition, and state what you would do if their network overlapped yours anyway.
  5. Calculate how many more instances each production subnet can hold before address exhaustion, and note that this is the number to monitor.

Verify

grep -Ec '/(1[6-9]|2[0-8])' lab/addressing.md
grep -Eci 'reserv' lab/addressing.md
python3 - <<'EOF'
import ipaddress
rows = [l.split() for l in open('lab/ranges.txt') if l.strip()]
nets = [(r[0], ipaddress.ip_network(r[1])) for r in rows]   # ValueError: host bits set
print(len(nets), "range(s) -- need 7: six networks and the partner reserve")
default = ipaddress.ip_network('10.0.0.0/16')
for i, (a, x) in enumerate(nets):
    if x.overlaps(default):
        print("OVERLAPS 10.0.0.0/16:", a, x)
    for b, y in nets[i + 1:]:
        if x.overlaps(y):
            print("OVERLAP -- these two could never be peered:", a, x, b, y)
EOF

Seven ranges and no OVERLAP line. The overlap is the check that matters: two networks sharing addresses cannot be peered, and grepping for the text 10.0.0.0/16 would not notice a 10.0.1.0/24 that sits inside it anyway. A ValueError means a range was written with host bits set (10.1.0.1/16) -- the network address is the first one in the block.

This is an independent study companion for CompTIA Cloud+ CV0-004 and is not produced by or endorsed by CompTIA.