
Subnet Mask Cheat Sheet
Lab Video Walkthrough
Subnet Examples
Download Cisco Packet Tracer LAB
Understanding the /24 Network
A /24 subnet mask implies the first 24 bits are dedicated to network addressing, with the remaining 8 bits for host addresses. This results in a total of 256 IP addresses. However, the first address represents the network itself, and the last one is the broadcast address, making them unusable for host assignments.
Subnetting Requirements
To support four different LANs, each with varying host requirements, we need to subnet a /24 network. Allocating subnets starting from the largest LAN ensures efficient use of the address space.
Subnet Allocation
LAN2 (64 hosts):
- Subnet Size: /26 (64 addresses, 62 usable)
- Network: 192.168.5.0/26
- Usable IPs: 192.168.5.1 - 192.168.5.62
- Broadcast IP: 192.168.5.63
LAN1 (45 hosts):
- Subnet Size: /26 (64 addresses, 62 usable)
- Network: 192.168.5.64/26
- Usable IPs: 192.168.5.65 - 192.168.5.126
- Broadcast IP: 192.168.5.127
Next available subnet: 192.168.5.128.
LAN3 (14 hosts):
- Subnet Size: /28 (16 addresses, 14 usable)
- Network: 192.168.5.128/28
- Usable IPs: 192.168.5.129 - 192.168.5.142
- Broadcast IP: 192.168.5.143
LAN4 (9 hosts):
- Subnet Size: /28 (16 addresses, 14 usable)
- Network: 192.168.5.144/28
- Usable IPs: 192.168.5.145 - 192.168.5.158
- Broadcast IP: 192.168.5.159
Router Configuration Commands
For Cisco routers R1 and R2, use the following commands to set up interfaces:
- Router R1:
enable
configure terminal
interface g0/0/0
ip address 192.168.5.62 255.255.255.192
no shutdown
exit
interface g0/0/1
ip address 192.168.5.126 255.255.255.192
no shutdown
exit
- Router R2:
enable
configure terminal
interface g0/0/0
ip address 192.168.5.142 255.255.255.240
no shutdown
exit
interface g0/0/1
ip address 192.168.5.158 255.255.255.240
no shutdown
exit
PC Configuration
Configure each PC with the first usable IP of their subnet. The default gateway is the last usable IP of the subnet, which is the router interface IP. For instance, PC1 in LAN1:
- IP Address: 192.168.5.65
- Subnet Mask: 255.255.255.192
- Default Gateway: 192.168.5.62
Static Routing Configuration
For Router R1:
- The command
ip address 192.168.5.62 255.255.255.192
is applied to interface g0/0/0. - The command
ip address 192.168.5.126 255.255.255.192
is applied to interface g0/0/1.
- The command
For Router R2:
- The command
ip address 192.168.5.142 255.255.255.240
is applied to interface g0/0/0. - The command
ip address 192.168.5.158 255.255.255.240
is applied to interface g0/0/1.
- The command
So, in the static routing configuration:
On Router R1, when you see
<R2's IP>
, it refers to the IP addresses of Router R2's interfaces. Depending on your network setup, you would use either 192.168.5.142 or 192.168.5.158, depending on which interface you are routing to.On Router R2, when you see
<R1's IP>
, it refers to the IP addresses of Router R1's interfaces. Here, you would use either 192.168.5.62 or 192.168.5.126, again depending on the interface you are routing to.
Configure static routes on each router for inter-subnet communication:
- On Router R1:
ip route 192.168.5.128 255.255.255.240 <R2's IP>
ip route 192.168.5.144 255.255.255.240 <R2's IP>
- On Router R2:
ip route 192.168.5.0 255.255.255.192 <R1's IP>
ip route 192.168.5.64 255.255.255.192 <R1's IP>
For the point-to-point connection between R1 and R2, use a /30 subnet.
Verification
Conduct ping
tests for connectivity across subnets. Verify static routes with show ip route
.
By implementing these steps, you've efficiently partitioned a /24 network for four LANs and established necessary routing for inter-subnet communication.