3.5 Subnetting & DHCP

The Mathematics of Network Boundaries

In a small home network, your router gives your phone an IP address, and everything magically works. But when you are building an enterprise network with 5,000 computers, 400 security cameras, and 50 servers across different VLANs, you cannot rely on magic. You have to understand the exact mathematical boundaries of your networks and how to automate the distribution of addresses.

1. The DHCP Lifeline (The D.O.R.A. Process)

Manually typing IP addresses into thousands of computers is impossible. The Dynamic Host Configuration Protocol (DHCP) automates this.

When a brand-new computer is plugged into a network switch, it has no IP address, no idea where the router is, and no idea how to talk to the internet. It initiates a 4-step sequence called D.O.R.A.:

Enterprise Reservation: Servers and network printers should never have changing IP addresses. Instead of manually typing a static IP on the server itself, engineers create a "DHCP Reservation." They tell the DHCP server: "Whenever you see the physical MAC address of the printer, always give it 10.0.0.100." This keeps all IP management centralized on one server.

2. The Subnet Mask: The Decoder Ring

An IP address like 192.168.1.50 is just a string of numbers. By looking at it, a computer does not know if that IP is sitting on the desk next to it, or if it is located in a datacenter in Japan.

To figure this out, the computer uses the Subnet Mask.

3. CIDR Notation and Network Math

Writing out 255.255.255.0 is tedious. Modern engineers use CIDR (Classless Inter-Domain Routing) Notation. Instead of writing the mask, they write a slash followed by the number of "Network Bits."

4. (Addition) Rogue DHCP and Security Hacking

Stuff to add: What happens if a well-meaning employee brings a cheap Wi-Fi router from home and plugs it into the corporate wall jack so they get better signal at their desk?

That home router has its own DHCP server turned on by default. It becomes a Rogue DHCP Server. When other enterprise PCs ask for an IP address, the rogue home router might answer faster than the corporate server. It hands out fake, dead-end IP addresses, completely taking down the internet for the entire floor. In enterprise switches, engineers must enable a security feature called DHCP Snooping, which explicitly blocks DHCP offers from unauthorized switch ports.

Powered by Forestry.md