๐ŸŽ“ BookMCQ
โ† Back to 18. Introduction to Network Layer

๐Ÿ“ Dynamic Host Configuration Protocol (DHCP) process (26 MCQs)

Automatic Configuration of IP Network Settings

Dynamic Host Configuration Protocol automatically supplies hosts with IP configuration parameters, reducing manual setup on large networks. A DHCP server can provide an IPv4 address, subnet mask, default gateway, DNS server addresses, and lease duration. DHCP allows addresses to be reused after leases expire or clients leave the network. These responsibilities connect separate IP networks while preserving a consistent addressing framework for end systems.

Client, Server and Lease Information

DHCP uses a client-server model and commonly operates over UDP ports 68 at the client and 67 at the server for IPv4. A lease defines how long a client may use an assigned address. Servers manage address pools and may also provide reservations or additional configuration options. These fields allow forwarding devices to interpret packet purpose and choose the appropriate next processing action.

The DORA Address-Allocation Exchange

A typical initial exchange contains DHCP Discover, Offer, Request, and Acknowledgement messages, commonly abbreviated DORA. The client broadcasts to locate a server, receives an offered configuration, requests the chosen address, and waits for acknowledgement. Relay agents can forward DHCP messages between clients and servers on different subnets. Each hop repeats the required lookup, while link-specific framing is rebuilt for the next transmission.

Example of a Client Joining a LAN

A new laptop broadcasts DHCP Discover after connecting to a LAN. A server offers 192.168.20.50 with a /24 mask, gateway 192.168.20.1, and a lease duration. The laptop requests that offer and receives DHCP Acknowledgement, then configures its interface with the supplied settings. This illustrates how the stated network information controls the packet's treatment at that stage.

DHCP and Other Network Services

DHCP works with DNS, routing, and local address resolution. The default gateway enables off-subnet communication, while DNS provides name-to-address resolution. DHCP reservations can associate a client identifier with a predictable address, but a reservation is still distinct from a manually configured static address on the host. This division keeps internetwork delivery separate from local transmission and end-to-end application behavior.

Misunderstandings About DHCP

'DHCP translates domain names' is incorrect because DNS performs name resolution. 'A lease gives an address permanently' is incorrect because leases expire or renew. 'DHCP always crosses routers by broadcast' is incorrect because routers do not normally forward local broadcasts; a relay agent is used when the server is remote.

Tracing DHCP Messages in Examinations

Memorize the Discover, Offer, Request, and Acknowledgement sequence and the usual UDP port numbers. Identify which party sends each message, explain the role of a lease, and interpret offered configuration fields. Distinguish a DHCP server from a relay agent, DNS server, and default gateway. Show the intermediate values and justify each choice instead of stating only the final result.

DHCP Configuration Terms

  • DHCP - automates host IP configuration
  • Lease - temporary address assignment period
  • Discover - client searches for servers
  • Offer - server proposes configuration
  • Relay agent - forwards DHCP between subnets
  • Reservation - associates client with fixed address
7
Easy
13
Medium
6
Hard

๐Ÿ“ All Dynamic Host Configuration Protocol (DHCP) process MCQs

Q1. What does the acronym DHCP stand for?

A.Dynamic Host Configuration Protocol โœ…
B.Distributed Host Control Procedure
C.Dynamic Hypertext Communication Process
D.Direct Host Configuration Protocol
๐Ÿ’ก Difficulty: easy | โœ… Correct: A

๐Ÿ“– Explanation: DHCP is defined as Dynamic Host Configuration Protocol, a network management protocol used on IP networks for automatically assigning IP addresses and other configuration parameters to devices. The other options are fabricated terms that do not correspond to the standard definition.

Q2. Which UDP port does a DHCP client use to receive replies from a server?

A.67
B.68 โœ…
C.69
D.53
๐Ÿ’ก Difficulty: medium | โœ… Correct: B

๐Ÿ“– Explanation: DHCP clients listen on UDP port 68 for replies, while servers listen on UDP port 67 for client messages. This separation allows the client and server to communicate without port conflicts. Ports 69 and 53 are used for TFTP and DNS respectively, making them incorrect in this context.

Q3. In DHCP, what is the purpose of the 'lease' time?

A.Defines how long an IP address is valid for a client โœ…
B.Specifies the interval between DHCP Discover messages
C.Determines the timeout for DHCP server response
D.Sets the maximum number of DHCP clients allowed
๐Ÿ’ก Difficulty: medium | โœ… Correct: A

๐Ÿ“– Explanation: The lease time specifies the duration for which the DHCP server grants the client use of the assigned IP address. After the lease expires, the client must renew or obtain a new address. It does not control message intervals, server timeouts, or client limits.

Q4. If a DHCP server assigns an IP address with a lease of 24 hours and the client does not renew it, what will happen after 24 hours?

A.The client will keep using the address indefinitely
B.The address becomes available for reassignment โœ…
C.The client will automatically get a new address without request
D.The network will shut down
๐Ÿ’ก Difficulty: easy | โœ… Correct: B

๐Ÿ“– Explanation: When the lease expires without renewal, the server marks the address as free, allowing it to be offered to other clients. The client must stop using the address and either request a new lease or fall back to a static configuration. The other options describe behaviors that DHCP does not exhibit.

Q5. A network has two DHCP servers with overlapping address pools. What is the most likely outcome for a client that sends a DHCPDISCOVER?

A.The client will receive two DHCPOFFERs and may accept either โœ…
B.The client will be ignored by both servers
C.Only the server with higher IP will respond
D.The client will get a NACK
๐Ÿ’ก Difficulty: easy | โœ… Correct: A

๐Ÿ“– Explanation: When multiple DHCP servers respond, the client typically receives several DHCPOFFER packets. It will select one offerโ€”often the first received or the one with preferred parametersโ€”and send a DHCPREQUEST to that server. Overlapping pools can cause address conflicts if the client later switches servers, but the initial behavior is to accept one of the offers.

Q6. Suppose a DHCP client receives a DHCPOFFER with a subnet mask of 255.255.255.0255.255.255.0 and a default gateway of 10.0.0.110.0.0.1. If the clientโ€™s assigned IP is 10.0.0.5010.0.0.50, which of the following statements is true?

A.The client can communicate directly with hosts in the 10.0.1.0/24 network
B.The client must use the default gateway to reach any IP outside 10.0.0.0/24 โœ…
C.The subnet mask prevents communication with the gateway
D.The client will have no route to the internet
๐Ÿ’ก Difficulty: easy | โœ… Correct: B

๐Ÿ“– Explanation: With a /24 mask, the clientโ€™s local network is 10.0.0.0โ€‘10.0.0.255. Any destination outside this range requires forwarding through the default gateway (10.0.0.1). Therefore the client must use the gateway for external traffic, while communication within the /24 subnet occurs directly.

Q7. A DHCP server is configured to allocate addresses from the range 192.168.1.100192.168.1.100 to 192.168.1.150192.168.1.150. If 30 clients have already obtained leases, what is the probability that the next client will receive an address ending in .120?

A.30/51
B.Jan-51 โœ…
C.Jan-30
D.Impossible to determine
๐Ÿ’ก Difficulty: medium | โœ… Correct: B

๐Ÿ“– Explanation: The pool contains 51 possible addresses (100โ€‘150 inclusive). Assuming uniform random allocation, each address has an equal chance, giving a probability of 1/51 for any specific address such as .120. The other fractions do not reflect the correct sample space.

Q8. During a DHCP lease renewal, a client sends a DHCPREQUEST to the server it received its lease from. If the server is down, but another DHCP server on the network receives the request and sends a DHCPACK, what is the effect on the lease?

A.The lease is extended using the new serverโ€™s parameters โœ…
B.The client must discard the ACK and keep the old lease
C.The client will obtain a new lease with a different IP
D.The DHCP protocol rejects the ACK as invalid
๐Ÿ’ก Difficulty: hard | โœ… Correct: A

๐Ÿ“– Explanation: RFC 2131 permits any DHCP server that receives a DHCPREQUEST to respond with a DHCPACK, effectively extending the lease and possibly providing updated configuration. The client accepts the ACK, updates its lease information, and continues operation, even though the original server is unavailable.

Q9. Consider a network where the DHCP serverโ€™s address pool is exhausted. A client sends a DHCPREQUEST for renewal, and the server responds with a DHCPNAK. According to RFC 2131, what should the client do next?

A.Immediately stop using the IP and restart the DHCP discovery process โœ…
B.Continue using the IP until a new lease is granted
C.Ignore the NAK and keep the old lease
D.Send a DHCPDECLINE to the server
๐Ÿ’ก Difficulty: hard | โœ… Correct: A

๐Ÿ“– Explanation: When a DHCPNAK is received, the client must abandon the current address and re-enter the initialization phase (INIT), sending a new DHCPDISCOVER to obtain a valid lease. Continuing to use the address or ignoring the NAK would violate the protocol and could cause address conflicts.

Q10. If a DHCP client receives multiple DHCPOFFER messages with different lease times, how should the client decide which offer to accept according to typical client implementations?

A.Choose the offer with the longest lease time
B.Choose the first offer received โœ…
C.Choose the offer with the shortest lease time
D.Randomly select an offer
๐Ÿ’ก Difficulty: medium | โœ… Correct: B

๐Ÿ“– Explanation: Most DHCP client implementations accept the first DHCPOFFER they receive, simplifying the selection process and reducing delay. While some clients may evaluate lease length, the default behavior is to respond quickly to the earliest offer, making option B the typical choice.

Q11. A router is configured as a DHCP relay agent forwarding DHCPDISCOVER messages from a subnet 10.0.2.0/24 to a DHCP server on 10.0.1.1. Which field in the relayed packet contains the original clientโ€™s IP address?

A.ciaddr
B.yiaddr
C.giaddr โœ…
D.chaddr
๐Ÿ’ก Difficulty: medium | โœ… Correct: C

๐Ÿ“– Explanation: The giaddr (gateway IP address) field is populated by the relay agent with the IP address of the interface that received the clientโ€™s broadcast. This informs the DHCP server about the originating subnet, allowing it to allocate an appropriate address. The other fields serve different purposes in the DHCP transaction.

Q12. When a DHCP clientโ€™s lease expires without renewal, what state does the client enter according to the DHCP state machine?

A.BOUND
B.RENEWING
C.INIT โœ…
D.SELECTING
๐Ÿ’ก Difficulty: medium | โœ… Correct: C

๐Ÿ“– Explanation: If a lease expires and the client cannot renew it, the client returns to the INIT state, discarding any previously assigned configuration. It then restarts the discovery process by broadcasting a DHCPDISCOVER. This behavior ensures the client obtains a fresh lease before resuming normal operation.

Q13. Compare the advantages of using DHCP over static IP addressing in a large enterprise network.

A.Simplifies address management and reduces configuration errors โœ…
B.Increases manual workload
C.Prevents IP address reuse
D.Eliminates need for routers
๐Ÿ’ก Difficulty: easy | โœ… Correct: A

๐Ÿ“– Explanation: DHCP automates the distribution and management of IP addresses, dramatically reducing the chance of human error, avoiding duplicate assignments, and simplifying network reconfiguration. Static addressing requires administrators to manually assign and track each address, which is laborโ€‘intensive and errorโ€‘prone in large environments.

Q14. Which of the following best differentiates DHCPv4 from DHCPv6?

A.DHCPv4 uses UDP port 67/68, DHCPv6 uses TCP
B.DHCPv6 supports address prefix delegation, DHCPv4 does not โœ…
C.DHCPv4 can assign IPv6 addresses
D.DHCPv6 does not support lease times
๐Ÿ’ก Difficulty: easy | โœ… Correct: B

๐Ÿ“– Explanation: DHCPv6 introduces support for prefix delegation, enabling the assignment of network prefixes to downstream routersโ€”a capability absent in DHCPv4, which only provides individual IPv4 addresses. Both versions still use UDP (not TCP), and lease concepts exist in both.

Q15. Evaluate the impact of DHCP lease time length on network performance and address utilization. Which statement is most accurate?

A.Short leases increase network traffic due to frequent renewals โœ…
B.Long leases guarantee optimal address utilization
C.Short leases prevent address exhaustion in dynamic environments
D.Lease length has no effect on performance
๐Ÿ’ก Difficulty: medium | โœ… Correct: A

๐Ÿ“– Explanation: Short lease durations cause clients to renew more often, generating additional DHCP traffic and processing load on servers. While this can help reclaim unused addresses quickly, it also adds overhead. Longer leases reduce renewal traffic but may waste addresses if devices frequently leave the network.

Q16. Given two DHCP server configurations: Server A offers a lease time of 8 hours, Server B offers 24 hours. In a network where devices are mobile and frequently change subnets, which serverโ€™s configuration is more suitable and why?

A.Server A, because shorter leases adapt to mobility โœ…
B.Server B, because longer leases reduce renew traffic
C.Both are equally suitable
D.Neither, static IP is required
๐Ÿ’ก Difficulty: medium | โœ… Correct: A

๐Ÿ“– Explanation: Mobile devices that often move between subnets benefit from shorter lease times, allowing the network to reclaim addresses quickly when a device departs. This reduces the risk of stale IP assignments and improves address pool efficiency, despite the increased renewal traffic.

Q17. Contrast the behavior of a DHCP client when it receives a DHCPNAK in response to a DHCPREQUEST versus when it receives a DHCPACK. Which outcomes differ?

A.NAK causes the client to restart discovery; ACK extends the lease โœ…
B.Both cause the client to keep the old lease
C.NAK leads to immediate IP release; ACK does nothing
D.NAK and ACK have identical effects
๐Ÿ’ก Difficulty: medium | โœ… Correct: A

๐Ÿ“– Explanation: A DHCPACK confirms and renews the existing lease, updating any parameters as needed. A DHCPNAK indicates the server rejects the requestโ€”typically because the lease is no longer validโ€”forcing the client to discard the address and restart the DHCP discovery process to obtain a new lease.

Q18. Analyze the security implications of DHCP snooping in a switched network. Which of the following statements correctly describes its primary benefit?

A.Prevents unauthorized DHCP servers from assigning IPs โœ…
B.Encrypts DHCP messages
C.Ensures all clients receive the same IP
D.Eliminates the need for DHCP relay agents
๐Ÿ’ก Difficulty: hard | โœ… Correct: A

๐Ÿ“– Explanation: DHCP snooping builds a trusted database of legitimate DHCP server MAC addresses on a switch. By filtering DHCP messages, it blocks rogue servers that could hand out malicious or conflicting IP configurations, thereby protecting the network from IP spoofing and related attacks.

Q19. A network administrator observes that many DHCP clients experience delays during the lease renewal phase. Which of the following root causes is most plausible?

A.DHCP server overloaded with simultaneous renewal requests โœ…
B.Clients have incorrect subnet masks
C.DHCP uses TCP which is slow
D.Lease times are set to zero
๐Ÿ’ก Difficulty: hard | โœ… Correct: A

๐Ÿ“– Explanation: When many clients attempt to renew at the same time, the DHCP server can become a bottleneck, leading to delayed responses. Incorrect subnet masks affect routing, not renewal timing, and DHCP already uses UDP (which is fast). Zero lease times would prevent any lease from being granted, not cause renewal delays.

Q20. Consider a scenario where a DHCP server is configured with option 66 (TFTP server name) and option 67 (Bootfile name). Which type of devices benefit most from these options?

A.Workstations needing DNS
B.Network printers
C.PXE booting computers โœ…
D.VoIP phones
๐Ÿ’ก Difficulty: medium | โœ… Correct: C

๐Ÿ“– Explanation: PXE (Preboot Execution Environment) clients rely on option 66 to locate a TFTP server and option 67 to obtain the bootfile needed for network booting. These options are essential for diskless workstations, thin clients, or servers that boot via the network, whereas the other device categories typically do not require them.

Q21. Apply the DHCP four-step process to fill in the missing step: DHCPOFFER, DHCPREQUEST, __________, DHCPACK.

A.DHCPDECLINE
B.DHCPDISCOVER โœ…
C.DHCPINFORM
D.DHCPRELEASE
๐Ÿ’ก Difficulty: easy | โœ… Correct: B

๐Ÿ“– Explanation: The standard DHCP sequence is DHCPDISCOVER (client broadcast), DHCPOFFER (server reply), DHCPREQUEST (client selects an offer), and DHCPACK (server confirms lease). DHCPDECLINE is used to reject an offered address, while DHCPINFORM and DHCPRELEASE serve other purposes.

Q22. Explain why DHCP uses broadcast messages during the initial discovery phase.

A.Broadcast ensures the message reaches all potential servers on the local network โœ…
B.Broadcast encrypts the data
C.Broadcast limits the message to a single server
D.Broadcast reduces network load
๐Ÿ’ก Difficulty: medium | โœ… Correct: A

๐Ÿ“– Explanation: During discovery, the client does not yet know the serverโ€™s IP address, so it broadcasts the DHCPDISCOVER on the local subnet. This guarantees that any DHCP server present will receive the request and can respond, enabling the client to obtain configuration without prior knowledge of server locations.

Q23. Synthesize a scenario where DHCP option 121 (Classless Static Route) would be useful. Which description fits?

A.Providing a default gateway for all hosts
B.Specifying a static route to a remote subnet for DHCP clients โœ…
C.Assigning DNS servers
D.Setting lease time
๐Ÿ’ก Difficulty: medium | โœ… Correct: B

๐Ÿ“– Explanation: Option 121 allows the DHCP server to deliver classless static routes to clients, enabling them to reach specific remote subnets without manual router configuration. This is valuable in environments where certain hosts need direct routes to particular networks, such as branch office links or VPN segments.

Q24. If a DHCP client is configured with a static IP address that falls within the serverโ€™s dynamic pool, what conflict may arise?

A.The client will be denied network access
B.The server may assign the same IP to another client, causing IP conflict โœ…
C.The static address will override the DHCP lease
D.No conflict occurs
๐Ÿ’ก Difficulty: medium | โœ… Correct: B

๐Ÿ“– Explanation: When the static address lies inside the DHCP pool, the server is unaware that the address is already in use. It may allocate the same address to another client, leading to duplicate IP situations, network communication problems, and the need for manual conflict resolution.

Q25. Design a DHCP failover mechanism that ensures high availability. Which of the following components is essential for state synchronization?

A.Primary serverโ€™s MAC address
B.Shared lease database โœ…
C.Clientโ€™s hostname
D.Routerโ€™s ARP table
๐Ÿ’ก Difficulty: hard | โœ… Correct: B

๐Ÿ“– Explanation: A shared lease database (or stateโ€‘sync channel) allows primary and secondary DHCP servers to keep each other's lease information consistent. This prevents duplicate address assignments and ensures that either server can take over seamlessly if the other fails. MAC addresses, hostnames, or ARP tables do not provide lease state continuity.

Q26. In IPv6, DHCPv6 can operate in two modes: stateful and stateless. Which statement correctly distinguishes them?

A.Stateful provides only address configuration, stateless also provides DNS
B.Stateful assigns addresses and other info; stateless provides only other configuration without addresses โœ…
C.Stateless assigns IPs, stateful does not
D.Both modes are identical
๐Ÿ’ก Difficulty: hard | โœ… Correct: B

๐Ÿ“– Explanation: Stateful DHCPv6 supplies both IPv6 addresses and additional configuration (e.g., DNS). Stateless DHCPv6 provides only supplemental information such as DNS or domain search lists, relying on other mechanisms like SLAAC for address assignment. The other options mis

๐Ÿ”— Related Topics (MCQs)