What is the subnet mask for a Class C IP address with 30 usable hosts?
Practice Questions
Q1
What is the subnet mask for a Class C IP address with 30 usable hosts?
255.255.255.252
255.255.255.240
255.255.255.248
255.255.255.254
Questions & Step-by-Step Solutions
What is the subnet mask for a Class C IP address with 30 usable hosts?
Step 1: Understand that a Class C IP address typically has a default subnet mask of 255.255.255.0, which allows for 256 total IP addresses.
Step 2: Calculate how many IP addresses are needed for 30 usable hosts. Remember that for every subnet, 2 IP addresses are reserved (one for the network and one for the broadcast).
Step 3: To find the total number of IP addresses needed, add 2 to the number of usable hosts: 30 + 2 = 32.
Step 4: Determine the smallest power of 2 that can accommodate 32 IP addresses. The smallest power of 2 that is greater than or equal to 32 is 64 (2^6 = 64).
Step 5: Since we need 64 IP addresses, we need to borrow bits from the host part of the address. A Class C address has 8 bits for hosts. If we use 2 bits for the network, we have 6 bits left for hosts (2^2 = 4 total addresses).
Step 6: The subnet mask for 2 bits borrowed from the host part is 255.255.255.252, which means the last octet is 252 (binary: 11111100).
Step 7: Verify that 255.255.255.252 allows for 4 IP addresses, but only 2 are usable (1 for network and 1 for broadcast).