Network Design and Operations
Hosts in VLAN 20 (192.168.20.0/24) are to get addresses from a DHCP server, 10.0.0.5, on another network. A DHCP relay agent is therefore configured on the L3 switch interface 192.168.20.1, which is VLAN 20's default gateway. Which statement correctly describes what the relay agent does?
- AIt receives the DHCP messages that hosts broadcast, writes its own VLAN 20 address 192.168.20.1 into them and forwards them by unicast to 10.0.0.5. From this address, the server chooses an address from the range for 192.168.20.0/24
- BThe L3 switch starts forwarding the broadcasts it receives to every network, so the DHCP messages reach the server
- CThe L3 switch chooses addresses and leases them to hosts in place of the DHCP server, only reporting the results to 10.0.0.5
Show answer and explanation
Answer: A. It receives the DHCP messages that hosts broadcast, writes its own VLAN 20 address 192.168.20.1 into them and forwards them by unicast to 10.0.0.5. From this address, the server chooses an address from the range for 192.168.20.0/24
A host that has no address yet broadcasts a Discover to find a DHCP server, but routers and L3 switches do not forward broadcasts to other networks. A DHCP relay agent receives these messages, relays them to the server by unicast, and passes the server's replies back to the host. When relaying, it writes the address of its host-side interface (192.168.20.1 here) into a field of the message (giaddr). From this address, the server learns which subnet the host is on (192.168.20.0/24) and chooses an address from the range for that subnet. This way, a single DHCP server can serve many subnets without a server in every VLAN.
- A. Correct. It turns the broadcast into unicast and tells the server which subnet the host is on.
- B. A relay agent relays only DHCP messages to a configured server. It does not forward broadcasts in general.
- C. The DHCP server chooses and leases the addresses. The relay agent only relays.