Related Documentation
- EX Series
- Configuring a DHCP Client (CLI Procedure)
- Configuring a DHCP Server on EX Series Switches (CLI Procedure)
- Configuring an Extended DHCP Relay Server on EX Series Switches (CLI Procedure)
- Configuring a DHCP SIP Server (CLI Procedure)
- Upgrading Software Using Automatic Software Download on EX Series Switches
- Monitoring DHCP Services
Understanding DHCP Services for EX Series Switches
A Dynamic Host Configuration Protocol (DHCP) server on a Juniper Networks EX Series Ethernet switch can provide many valuable TCP/IP network services. For example, DHCP can dynamically allocate the four required IP parameters to each computer on the LAN: IP address, network mask, router or switch address, and name server address. Additionally, DHCP on the switch can automatically upgrade software on client systems.
This topic describes:
DHCP Client/Server Model
DHCP IP address allocation works on a client/server model in which the server, in this case a switch, assigns the client reusable IP information from an address pool. A DHCP client might receive offers from multiple DHCP servers and can accept any one of the offers; however, the client usually accepts the first offer it receives. See Figure 1.
Figure 1: DHCP Client/Server Model

Why Use DHCP?
DHCP automates network-parameter assignment to network devices. Even in small networks, DHCP is useful because it makes it easy to add new machines to the network.
DHCP access service minimizes the overhead required to add clients to the network by providing a centralized, server-based setup. This means that you do not have to manually create and maintain IP address assignments for clients. In addition, when you use DHCP to manage a pool of IP addresses among hosts, you reduce the number of IP addresses needed on the network. DHCP does this by leasing an IP address to a host for a limited period of time, allowing the DHCP server to share a limited number of IP addresses. DHCP also provides a central database of devices that are connected to the network and eliminates duplicate resource assignments. In addition to IP addresses, DHCP also provides other configuration information, particularly the IP addresses of local caching DNS resolvers, network boot servers, or other service hosts.
A second valuable DHCP feature is automatic software download for installation of software packages on Juniper Networks EX Series Ethernet Switches. DHCP clients configured for automatic software download receive messages as part of the DHCP message exchange process—when the software package name in the DHCP server message is different from that of the software package that booted the DHCP client switch, the new software is downloaded and installed. See Upgrading Software Using Automatic Software Download on EX Series Switches
How Are DHCP Relay Servers Different from DHCP Servers?
You can configure a switch either as a DHCP server or as a DHCP relay server, but not both. Whereas a DHCP server replies to a client with an IP address, a DHCP relay server relays DHCP messages to and from the configured DHCP server, even if the client and server are on different IP networks.
Configure a switch to be a DHCP relay agent if you have locally attached hosts and a remote DHCP server. For directions on configuring a DHCP relay server, see DHCP/BOOTP Relay for EX Series Switches Overview.
Legacy DHCP and Extended DHCP for Server Versions
Two versions of both DHCP server and DHCP relay are available on EX Series switches. The original legacy DHCP server and DHCP relay co-exists with extended DHCP and DHCP relay versions. You can configure one version or the other but not both versions simultaneously. Because the newer extended DHCP server version has more features, we recommend that you configure the extended DHCP server unless you have a legacy reason for not doing so. The extended DHCP server version has these added features:
- Graceful Routing Engine switchover (GRES) support that provides mirroring support for clients. For details, see High Availability Features for EX Series Switches Overview.
- Virtual routing and forwarding (VRF) support that allows multiple instances of a routing table to simultaneously co-exist on the same switch. For details, see Understanding Virtual Routing Instances on EX Series Switches .
![]() | Note: Legacy DHCP supports circuit ID and remote ID fields for the relay agent option (option-82). Extended DHCP supports configuration of only circuit ID. |
Configuration for legacy DHCP and extended DHCP servers takes place at the hierarchy levels shown in Table 1:
Table 1: Legacy DHCP and Extended DHCP Server Hierarchy Levels
DHCP Service | Hierarchy |
|---|---|
Extended DHCP server | edit system services dhcp-local-server |
Extended DHCP address pool | edit access address-assignment pool |
Legacy DHCP server | edit system services dhcp |
Legacy DHCP relay | edit forwarding-options helpers bootp |
Extended DHCP relay | edit forwarding-options dhcp-relay |
Legacy DHCP address pool | edit system services dhcp pool |
DHCP clients on a switch are always configured at the hierarchy [edit interfaces interface-name family dhcp].
How Do I Configure DHCP on a Switch?
DHCP configuration consists of two parts, configuration of a DHCP server and configuration of DHCP clients. DHCP server configuration is simple if you accept the default configurations.
When you configure a legacy DHCP server, you need only define the DHCP server name and the interface on the switch. You can use the default configuration for the rest of the settings. When you configure an extended DHCP server, you need only define a DHCP pool, indicate IP addresses for the pool, and create a server group. You can use the default configuration for the rest of the settings.
For directions for configuring either a legacy DHCP server or an extended DHCP server, see Configuring a DHCP Server on EX Series Switches (CLI Procedure).
There is only one way to configure a DHCP client.
When defining a DHCP client, you set the client’s DHCP interface address in the [edit interfaces interface-name unit 0 family inet dhcp] hierarchy. For directions for configuring a DHCP client on a switch, see Configuring a DHCP Client (CLI Procedure).
How Does DHCP Work?
DHCP consists of a four-step transfer process beginning with a broadcast DHCP discovery message from the client. The second step involves a DHCP offer message from the server to the client, which includes the IP address and mask and some other specific parameters. The client then sends a DHCP request to accept the offer it received from the server in the previous step. The DHCP server sends a DHCP response message and removes the now-allocated address from the DHCP address pool. See Figure 2.
Figure 2: DHCP Four-Step Transfer

![]() | Note: Because the DHCP discovery message from the client is a broadcast message and because broadcast messages only cross other segments when they are explicitly routed, you might have to configure a DHCP relay agent on the switch interface so that all DHCP discovery messages from the clients are forwarded to one DHCP server. |
Related Documentation
- EX Series
- Configuring a DHCP Client (CLI Procedure)
- Configuring a DHCP Server on EX Series Switches (CLI Procedure)
- Configuring an Extended DHCP Relay Server on EX Series Switches (CLI Procedure)
- Configuring a DHCP SIP Server (CLI Procedure)
- Upgrading Software Using Automatic Software Download on EX Series Switches
- Monitoring DHCP Services
