Lion Cipher Lab
Plan subnets with CIDR math, then hand out addresses with a dnsmasq DHCP server
- Cyber / Security Engineer
- Intermediate
- ~60 min
- Free · no account required
Why it matters
Almost every device on a network gets its address from DHCP, and the address plan behind it decides how big each network can grow, where the firewall can draw lines and how many things will break when it fills up. A subnet that is too small runs out of leases at the worst moment; one that is too big wastes address space and puts everything in one blast radius. A DHCP server is also a trusted voice: whatever router and DNS it announces, clients believe. Planning the subnets and running a server yourself makes those trade-offs concrete, and shows what an administrator watches in the logs.
What you'll learn
- working out network size, usable hosts and address ranges from a prefix length
- splitting one block into three subnets sized for staff, guests and servers without overlap
- checking your arithmetic with Python's ipaddress module
- running a DHCP server with dnsmasq inside a namespace, with a small address pool and a router option
- reading the server's log and lease file, and recognising what an exhausted pool looks like
Steps in this lab
- CIDR in five minutes: what the slash number means
- Plan the subnets for a small office
- Check your arithmetic with Python
- Build the staff network: a server namespace with a bridge
- Start dnsmasq as a DHCP-only server with a pool of two
- Give two clients a lease
- Run out of addresses on purpose
- Size the pool, and what a professional does differently
- Clean up
Open the full interactive lab →