AI InterviewSearch…Search problems, topics, or pages…Ctrl KGet started
Mediumnetworkssubnetting

~75s

Hosts in a /26

How many usable host addresses does an IPv4 subnet with a /26 prefix provide?

Show the answer and the worked solution

Correct answer: B.

62

Worked solution

  1. A /26 prefix leaves 32 − 26 = 6 bits for the host part.
  2. Six bits address 2^6 = 64 distinct values within the subnet.
  3. The all-zeros value names the network and the all-ones value is the broadcast address, so 64 − 2 = 62 addresses remain usable by hosts.

Answer: 62.

The idea

The formula is 2^(32 − prefix) − 2. Forgetting to subtract the network and broadcast addresses is what the neighbouring distractor is there to catch.

Shortcut. A /26 is a quarter of a /24's 256 addresses, 64, and removing the network and broadcast addresses leaves 62.

Common trap. 64 counts all 2⁶ addresses and forgets that the all-zeros and all-ones host values are reserved.

Hosts in a /26 — OS, DBMS & Networks Aptitude Question

Hosts in a /26: How many usable host addresses does an IPv4 subnet with a /26 prefix provide? Answer and worked solution on CodeKairo.

Question

How many usable host addresses does an IPv4 subnet with a /26 prefix provide?

Options

  1. 30
  2. 62
  3. 64
  4. 126
Show the answer and the worked solution

Correct answer: B. 62

Worked solution

  1. A /26 prefix leaves 32 − 26 = 6 bits for the host part.
  2. Six bits address 2^6 = 64 distinct values within the subnet.
  3. The all-zeros value names the network and the all-ones value is the broadcast address, so 64 − 2 = 62 addresses remain usable by hosts.

Answer: 62.

The idea

The formula is 2^(32 − prefix) − 2. Forgetting to subtract the network and broadcast addresses is what the neighbouring distractor is there to catch.

Shortcut. A /26 is a quarter of a /24's 256 addresses, 64, and removing the network and broadcast addresses leaves 62.

Common trap. 64 counts all 2⁶ addresses and forgets that the all-zeros and all-ones host values are reserved.

All OS, DBMS & Networks questions · placement mock tests