Overview
BreadLab runs on a private network with an address range of 192.168.1.0/24. This series will explain the key concepts of IP addresses and subnets using this setup as an example.
Background
At BreadLab, we use a private network to manage our home lab infrastructure. The network is defined by the subnet 192.168.1.0/24, which means that the first 24 bits are reserved for the network, leaving us with 254 usable host addresses (from .1 to .254). Each device in my rack has a specific address; for instance, the AMP game server is at 192.168.1.x and the vCloud Director cell is at 192.168.1.x.
How It Works
Private IP Address Ranges
Private ranges are defined by RFC 1918 and include:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
These addresses are not routable on the public internet, which is why we use them for home and small business networks. Every home network can reuse these ranges without conflicting with each other or public IP addresses.
Static vs DHCP
In BreadLab, servers receive static IP assignments because services depend on specific addresses that remain constant. For example, if the AMP game server address were to change, it would break the reverse proxy configuration. On the other hand, laptops and phones use DHCP (Dynamic Host Configuration Protocol) for dynamic IP assignment.
CIDR Notation
CIDR (Classless Inter-Domain Routing) notation is a compact way of representing an IP address range. Here are some examples:
- /24 = 255.255.255.0 netmask, which allows for 254 usable hosts.
- /16 = 255.255.0.0 netmask, allowing for 65534 hosts.
- /30 = 255.255.255.252 netmask, providing only two usable host addresses (useful for point-to-point links).
Docker and Private Networks
Docker adds another layer of private networking inside the host. Containers run on a separate subnet managed by Docker's bridge network, which is distinct from the main LAN. This means that both your laptop and a container can be "on the network" but in different subnets.
Results
Using 192.168.1.0/24 as our example, we've seen how to manage static IP assignments for servers and dynamic ones for mobile devices. We also explored CIDR notation and the importance of documenting static assignments.
Lessons Learned
One key lesson from my lab is the importance of documentation. Discovering what 192.168.1.x was by running nmap is not a good practice; it's better to write down your static IP assignments somewhere, ensuring that you always know where everything is.
By understanding these basics, you can better manage and troubleshoot your own home lab or network setup.
Want to skip the mental math? Our free subnet calculator does all of this for any address and prefix, with a bit-by-bit breakdown.