IP Addressing & Subnetting Questions with Answers

54 practice questions on IP Addressing & Subnetting (Computer Networks) with answers and step-by-step solutions. Try 10 samples below, then practise all 54 free in the AptiNest app.

Sample questions

Question 1Easy

How many bits long is an IPv6 address?

  1. 32
  2. 64
  3. 256
  4. 128

Answer: D. 128

Explanation

IPv4 addresses are 32 bits; IPv6 addresses are 128 bits, written as eight groups of four hex digits.

Step-by-step solution

  1. IPv4 addresses are 32 bits long.
  2. IPv6 was designed with a much larger address space to solve IPv4 exhaustion.
  3. An IPv6 address is 128 bits long, written as eight groups of four hex digits.

Why the other options are wrong

  • A. 32 bits is IPv4's address length.
  • B. 64 bits is only half of IPv6's actual length.
  • C. 256 bits is double IPv6's actual length.

Question 2Easy

What is the dotted-decimal subnet mask for a /27 prefix?

  1. 255.255.255.192
  2. 255.255.255.224
  3. 255.255.255.248
  4. 255.255.255.240

Answer: B. 255.255.255.224

Explanation

/27 = 24 ones + 3 ones in the last octet:
11100000 = 128 + 64 + 32 = 224.

Step-by-step solution

  1. a /27 prefix means 24 full octets of 1s plus 3 more 1 bits in the last octet.
  2. 3 leading 1 bits in an octet is 11100000 in binary.
  3. 11100000 = 128 + 64 + 32 = 224, giving the mask 255.255.255.224.

Why the other options are wrong

  • A. 192 is the mask value for a /26, one bit fewer in the last octet.
  • C. 248 is the mask value for a /29, two bits more.
  • D. 240 is the mask value for a /28, one bit more.

Tip: Count 1-bits from the left: 24 whole-octet ones + 3 more = 224 in the final octet.

Question 3Easy

Which classful class is reserved for multicast addresses (first octet 224 to 239)?

  1. Class E
  2. Class D
  3. Class C
  4. Class B

Answer: B. Class D

Explanation

Class D (leading bits 1110) is used for multicast; Class E is reserved/experimental.

Step-by-step solution

  1. Classful addressing assigns the first-octet range 224-239 to Class D.
  2. Class D's leading bit pattern (1110) is reserved for one-to-many multicast delivery, not ordinary unicast hosts.
  3. Class E (240-255) is reserved/experimental, separate from both multicast and ordinary unicast use.

Why the other options are wrong

  • A. Class E (240-255) is reserved/experimental, not multicast.
  • C. Class C (192-223) is a normal unicast range, not multicast.
  • D. Class B (128-191) is also a normal unicast range, not multicast.

Tip: 224-239 = multicast (Class D); 240-255 = reserved/experimental (Class E).

Question 4Easy

What is the default (classful) subnet mask of a Class A address?

  1. 255.255.0.0
  2. 255.255.255.255
  3. 255.255.255.0
  4. 255.0.0.0

Answer: D. 255.0.0.0

Explanation

Class A uses 8 network bits by default, so the mask is /8 = 255.0.0.0.

Step-by-step solution

  1. Classful addressing gives each class a default number of network bits.
  2. Class A uses 8 network bits by default.
  3. An 8-bit mask written in dotted decimal is 255.0.0.0.

Why the other options are wrong

  • A. 255.255.0.0 is the default mask for Class B, not Class A.
  • B. 255.255.255.255 is a special all-ones address, not a classful default mask.
  • C. 255.255.255.0 is the default mask for Class C, not Class A.

Question 5Medium

What is the broadcast address of the subnet containing 192.168.10.77/26?

  1. 192.168.10.127
  2. 192.168.10.128
  3. 192.168.10.255
  4. 192.168.10.63

Answer: A. 192.168.10.127

Explanation

The /26 block containing 77 is 64-127. The broadcast address is the last one in the block: 192.168.10.127.

Step-by-step solution

  1. The /26 block containing 77 spans addresses 64 to 127 in the last octet.
  2. The broadcast address is always the last address in that block.
  3. So the broadcast address is 192.168.10.127.

Why the other options are wrong

  • B. 128 is the start of the next block, not the broadcast of this one.
  • C. That is the /24 broadcast, not this /26 subnet's.
  • D. That is the broadcast of the previous block (0-63), not the one containing 77.

Tip: Broadcast = network address + block size - 1.

Question 6Medium

Which of these addresses is a private (RFC 1918) address?

  1. 11.0.0.1
  2. 172.20.5.9
  3. 192.169.1.1
  4. 172.32.5.9

Answer: B. 172.20.5.9

Explanation

The private ranges are 10.0.0.0/8, 172.16.0.0/12 (172.16 to 172.31) and 192.168.0.0/16. 172.32.x and 192.169.x fall outside them.

Step-by-step solution

  1. The three RFC 1918 private ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.
  2. 11.0.0.1 falls outside the 10.0.0.0/8 range, and 192.169.1.1 falls outside 192.168.0.0/16.
  3. 172.20.5.9 falls inside 172.16.0.0/12 (since 20 is between 16 and 31), making it the only private address among the choices.

Why the other options are wrong

  • A. 11.0.0.1 is a public address; only 10.0.0.0/8 (not 11.x) is private.
  • C. 192.169.1.1 is public; only 192.168.0.0/16 (not 192.169.x) is private.
  • D. 172.32.5.9 is public; the private 172 range stops at 172.31.

Tip: Memorise the exact boundaries: 10.0.0.0/8, 172.16.0.0/12 (16 through 31), 192.168.0.0/16.

Question 7Medium

What does NAT (Network Address Translation) primarily allow?

  1. Many hosts with private addresses to share one or a few public IP addresses
  2. Encrypting all traffic between two private networks that communicate over the Internet
  3. Translating domain names into IP addresses
  4. Automatically assigning IP addresses to hosts

Answer: A. Many hosts with private addresses to share one or a few public IP addresses

Explanation

NAT (usually with port translation) rewrites source addresses and ports at the edge router. DNS resolves names and DHCP assigns addresses.

Step-by-step solution

  1. NAT rewrites the source address (and usually port) of outgoing packets at the network edge.
  2. This lets many internal hosts with private addresses appear to the outside world as one (or a few) public IP addresses.
  3. Encrypting traffic is a VPN's job, resolving names is DNS's job, and assigning addresses is DHCP's job, none of which is NAT's purpose.

Why the other options are wrong

  • B. Encrypting traffic between networks is a VPN's job, not NAT's.
  • C. Translating domain names into addresses is DNS's job.
  • D. Assigning IP addresses automatically is DHCP's job.

Tip: NAT solves address scarcity by sharing public addresses, not encryption or naming.

Question 8Medium

What is the network (subnet) address of host 172.20.147.9/21?

  1. 172.20.146.0
  2. 172.20.144.0
  3. 172.20.144.1
  4. 172.20.151.255

Answer: B. 172.20.144.0

Explanation

/21 leaves 11 host bits. ANDing 172.20.147.9 with mask 255.255.248.0 gives 172.20.144.0.

Step-by-step solution

  1. A /21 prefix places its boundary inside the third octet, with block size 2^(24-21) = 8.
  2. The boundaries in the third octet are 0, 8, 16, ..., 144, 152, and 147 falls between 144 and 151.
  3. So the network address is 172.20.144.0.

Why the other options are wrong

  • A. 146 is not a multiple of 8, so it cannot be a valid /21 block boundary.
  • C. That is a host address inside the subnet (one above the network address), not the network address itself.
  • D. That is the broadcast address of this same subnet (the last address of the block), not its network address.

Tip: /21 steps by 8 in the third octet: 0, 8, 16, 24, ..., 248.

Question 9Hard

Which single route exactly summarises the contiguous networks 10.1.16.0/24, 10.1.17.0/24 ... 10.1.23.0/24?

  1. 10.1.16.0/23
  2. 10.1.16.0/22
  3. 10.1.16.0/20
  4. 10.1.16.0/21

Answer: D. 10.1.16.0/21

Explanation

The networks share their first 21 bits and together fill 10.1.16.0/21 exactly, so the summary is 10.1.16.0/21.

Step-by-step solution

  1. There are 8 contiguous /24 networks here (16 through 23), and 8 = 2^3.
  2. Aggregating 2^3 contiguous /24s shortens the prefix by exactly 3 bits, from /24 to /21.
  3. 10.1.16.0/21 exactly covers 10.1.16.0 through 10.1.23.255, matching the full set.

Why the other options are wrong

  • A. /23 only covers two of these eight /24s, far too narrow.
  • B. /22 covers only four of these /24s (16-19), missing 20-23.
  • C. /20 is too broad: 10.1.16.0/20 also covers 10.1.24.0 through 10.1.31.0, which are not part of this set.

Tip: Aggregating 2^n contiguous /24s shortens the prefix by exactly n bits.

Question 10Hard

A company is given 200.10.20.0/24 and needs 6 subnets of equal size, each as large as possible. What prefix length should each subnet use?

  1. /28
  2. /26
  3. /27
  4. /29

Answer: C. /27

Explanation

Borrowing 2 bits gives only 4 subnets; 3 bits gives 2^3 = 8 >= 6.

So 24 + 3 = /27, with 30 usable hosts per subnet.

Step-by-step solution

  1. We need the smallest number of borrowed bits s with 2^s >= 6 subnets.
  2. s = 2 gives 4 subnets, too few.
  3. s = 3 gives 8 subnets, enough, so the new prefix is 24 + 3 = /27, with 30 usable hosts per subnet.

Why the other options are wrong

  • A. /28 borrows 4 bits (16 subnets), smaller subnets than necessary just to cover 6.
  • B. /26 only borrows 2 bits (4 subnets), not enough for the required 6.
  • D. /29 borrows 5 bits (32 subnets), far smaller than needed.

Tip: Find the smallest s with 2^s >= the required subnet count; new prefix = original prefix + s.

Practise all 54 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Computer Networks topics · All topics