Watch a lease being taken, and read every field it hands over
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
- Record the full current configuration to
lab/dhcp/before.txtusingipconfig /allorip addr; ip route; cat /etc/resolv.conf. - Extract the four supplied values into
lab/dhcp/fields.csvwith headerfield,value,what_breaks_without_itcovering address, mask, gateway and DNS servers. - Release and renew the lease, capture the result to
lab/dhcp/after.txt, and record inlab/dhcp/changed.mdwhich fields changed and which did not. - Record the lease obtained and expiry times in
lab/dhcp/lease.csvwith headerobtained,expires,duration_hours. - Write
lab/dhcp/reservation.mdexplaining 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.