To B, A or C?
Just like how the internet task force has oversees public address space, you, humble reader, will find it necessary to coordinate the address space of your homelab environment. As administrator, you will choose from the 3 private address spaces outlined in the request for comment 1918 paper.
RFC 1918 name | IP address range | Number of addresses | Largest CIDR block (subnet mask) | Host ID size | Mask bits | Classful description |
24-bit block | 10.0.0.0 – 10.255.255.255 | 16777216 | 10.0.0.0/8 (255.0.0.0) | 24 bits | 8 bits | single class A network |
20-bit block | 172.16.0.0 – 172.31.255.255 | 1048576 | 172.16.0.0/12 (255.240.0.0) | 20 bits | 12 bits | 16 contiguous class B networks |
16-bit block | 192.168.0.0 – 192.168.255.255 | 65536 | 192.168.0.0/16 (255.255.0.0) | 16 bits | 16 bits | 256 contiguous class C networks |
Reviewing the options, for a relatively small homelab network, I would presume a class C network would include enough addresses. This also avoids complications that could arise if you VPN into another private network at work, or small business, places that most likely utilize A and B networks.
Deciding to use the 192.168.0.0/16 address space, you then must decide how to subnetwork the addresses. To keep it simple, I concentrated on building a network that will allow for VLANs of around 100 addresses, while also dividing addresses far enough apart to allow for expansion in the future. That is, changing the subnet mask, to allow for more or less host bits. Shifting around the network bits can get you in trouble, as expanding one network into overlapping with another would not work.
Using a subnet calculator I set the network at 192.168.4.0/24, and then reduced the network bits by 5, giving me more host bits. This would allow me to expand the address space, if needed, to support 8190 addresses. I started planning with 192.168.4.0, to avoid the 192.168.0.1 and 192.168.1.0 networks, as they are commonly used as the default IPs for routers.
Subnet | Start Address | End Address | Network Address | Broadcast Address |
192.168.0.0/19 | 192.168.0.1 | 192.168.31.254 | 192.168.0.0 | 192.168.31.255 |
Conversely, I could increase the network bits, reducing hosts and increasing the number of subnetworks available, by adding 2 subnet bits, creating a /26 subnet mask. These smaller networks can then be labeled into VLANs. Smaller networks reduce broadcast traffic.
Subnet | Start Address | End Address | Network Address | Broadcast Address |
192.168.4.0/26 | 192.168.4.1 | 192.168.4.62 | 192.168.4.0 | 192.168.4.63 |
192.168.4.64/26 | 192.168.4.65 | 192.168.4.126 | 192.168.4.64 | 192.168.4.127 |
192.168.4.128/26 | 192.168.4.129 | 192.168.4.190 | 192.168.4.128 | 192.168.4.191 |
192.168.4.192/26 | 192.168.4.193 | 192.168.4.254 | 192.168.4.192 | 192.168.4.255 |
With these possibilities in mind, I will utilize the /24 to start out with, as it is easiest to understand, the /24 landing on the bit boundary, makes it the easy to count networks by increments of 1. However, to allow for the potential /19 (255.255.255.224) network expansion, I will logically divide the networks along the bit boundary corresponding to that reduction in network bits. To determine that for /19, find ‘interesting octet,’ which is found by subtracting 256 - 224 (subnet mask) = 32. The interesting octets will always be a power of 2.
Subnet | Start Address | End Address | Usable Hosts | Network Address | Broadcast Address | Purpose |
192.168.4.0/24 | 192.168.4.1 | 192.168.4.254 | 254 | 192.168.4.0 | 192.168.4.255 | servers and VMs |
192.168.32.0/24 | 192.168.32.1 | 192.168.32.254 | 254 | 192.168.32.0 | 192.168.32.255 | static devices |
192.168.64.0/30 | 192.168.64.1 | 192.168.64.2 | 2 | 192.168.64.0 | 192.168.64.3 | DHCP server1 |
192.168.64.4/30 | 192.168.64.5 | 192.168.64.6 | 2 | 192.168.64.4 | 192.168.64.7 | DHCP server2 |
192.168.96.0/24 | 192.168.96.1 | 192.168.96.254 | 254 | 192.168.96.0 | 192.168.96.255 | VPN |
192.168.128.0/24 | 192.168.128.1 | 192.168.128.254 | 254 | 192.168.128.0 | 192.168.128.255 | dynamic ip from DHCP server1 |
192.168.160.0/24 | 192.168.160.1 | 192.168.160.254 | 254 | 192.168.160.0 | 192.168.160.255 | dynamic ip from DHCP server2 |
192.168.192.0/24 | 192.168.192.1 | 192.168.192.254 | 254 | 192.168.192.0 | 192.168.192.255 | ㅤ |
192.168.224.0/24 | 192.168.224.1 | 192.168.224.254 | 254 | 192.168.224.0 | 192.168.224.255 | ntwk hardware |
Each /24 network can support 254 hosts. Implementing VLANs in the network is determined partly by the ports on the routers and/or switches that will compose the network. To determine the VLANs number, I will follow the convention 192.168.<VLAN>.x.
With the network addressing decided, it is not time to implement and track the use of the address space. Even on a homelab, it is almost necessary to use an IP Address Management (IPAM) software. Two options I am most interested in are phpIPAM and NetBox. ChatGPT compares their capabilities: “NetBox is more focused on data center and network infrastructure management, while phpIPAM offers a broader range of features, including active network scanning capabilities.” phpIPAM is also an older application, so I assume more plugins and tutorials are available for it, so I will start utilizing it to plan out the above homelab network space.