It is common for network engineers to get a batch of IPv4 addresses and a network topology, and have to allocate addresses. Normally I would request a batch of RFC-1918 (non-internet-routable) address space for loopbacks, p2p links, and IP phones. End hosts would get internet-routable space if available. In this case we only have one /24 of internet-routable space.
You want to be able to grow in two areas over time:
- Growth in number of hosts in each access-subnet
- Growth in number of access subnets
Here's what you currently need for IP addresses in your network:
- 3 /32 loopback addresses (one for each router)
- 3 /31 p2p links (normally you can't use host .0 or the all-broadcast address but /31 is an exception per RFC 3021 https://tools.ietf.org/rfc/rfc3021.txt)
- 3 access subnets
Since this is a class exercise, lets forget about #2 (growth in number of access subnets). Having access-subnets smaller than /26 is usually problematic. /27's are pretty darn small.
We can split one /24 into four /26's. We have 3 subnets. So lets allocate one /26 to each access subnet. That leaves one /26 for p2p, loopback addresses, and growth. That gives us this first-level allocation:
- 223.1.0.0/26: For loopbacks, p2p links, and growth
- 223.1.0.64/26: For hosts on subnet connected to R1
- 223.1.0.128/26: For hosts on subnet connected to R2
- 223.1.0.192/26: For hosts on subnet connected to R3
Since we have 3 routers, a /30 (4 IPs) is sufficient for loopbacks, but lets allocate a /29 (8 IPs) for growth. To achieve artistry, lets have the last octet of the IP match the router name.
For each access-subnet, I always reserve the first 3 IPs for routers. That's usually subnet+1 for the default route (which might be a HSRP or VRRP IP) and subnet+2 and subnet+3 for redundant routers. In this case we have one router per subnet so it goes at subnet+1.
That gives us this 2nd level allocation:
223.1.0.0/29: For loopbacks
223.1.0.1: R1-loopback
223.1.0.2: R2-loopback
223.1.0.3: R3-loopback
223.1.0.8/29: For /31 p2p links
223.1.0.8/31: R1-R2 p2p link
223.1.0.10/31: R2-R3 p2p link
223.1.0.12/31: R3-R1 p2p link
223.1.0.16/28: For growth (possible future p2p links)
- 223.1.0.32/27: For growth (possible future subnet)
223.1.0.64/26: For hosts on subnet connected to R1
223.1.0.65: R1-eth
223.1.0.66-67: reserved for possible future router interfaces
223.1.0.68: host
223.1.0.69: host
223.1.0.70-126: reserved for future hosts
223.1.0.128/26: For hosts on subnet connected to R2
223.1.0.129: R2-eth
223.1.0.130-131: reserved for possible future router interfaces
223.1.0.132: host
223.1.0.133: host
223.1.0.134-190: reserved for future hosts
223.1.0.192/26: For hosts on subnet connected to R3
223.1.0.193: R3-eth
223.1.0.194-195: reserved for possible future router interfaces
223.1.0.196: host
223.1.0.197: host
223.1.0.198-254: reserved for future hosts
If we were concerned about growth in number of subnets over time, we would have no choice but to reduce each subnet allocation from a /26 to a /27. But that's pretty small for a real access subnet (only 30 usable IPs). That's where you begin to think about using RFC1918 address space and setting up NAT.
At some point, professors should start assigning IPv6 allocations. What if the same network was assigned 2001:0db8:0123:4500::/56 ?