Watch a lease being taken, and read every field it hands over

short · 40 min · Objective 2.1

Task

Release and renew a lease on your own machine and record all four things DHCP supplies, then prove that three of them matter more than the address.

Steps

  1. Record the full current configuration to lab/dhcp/before.txt using ipconfig /all or ip addr; ip route; cat /etc/resolv.conf.
  2. Extract the four supplied values into lab/dhcp/fields.csv with header field,value,what_breaks_without_it covering address, mask, gateway and DNS servers.
  3. Release and renew the lease, capture the result to lab/dhcp/after.txt, and record in lab/dhcp/changed.md which fields changed and which did not.
  4. Record the lease obtained and expiry times in lab/dhcp/lease.csv with header obtained,expires,duration_hours.
  5. Write lab/dhcp/reservation.md explaining the difference between a reservation and a static address, and which of the four fields a static configuration would leave you responsible for setting.

Verify

grep -c . lab/dhcp/before.txt
awk -F, 'NR>1 && NF>=3 {n++} END {print n" field(s) recorded"}' lab/dhcp/fields.csv
grep -c . lab/dhcp/after.txt
awk -F, 'NR>1 && NF>=3 {print $3" hour lease"}' lab/dhcp/lease.csv
grep -Eic 'reservation|static' lab/dhcp/reservation.md

Four fields recorded with a consequence each, both captures present, a lease duration, and the reservation note. If what_breaks_without_it is empty for the mask, re-read lesson 12 -- that is the field that decides every delivery.

Notes

On a virtual machine this is entirely safe and takes seconds. On your main machine the release briefly drops the connection, which matters only if something is mid-transfer.

This is an independent study companion for CompTIA A+ Core 1 220-1201 and is not produced by or endorsed by CompTIA.