This article provides information on how to configure the Legacy EX-series switch as a DHCP server.
The Dynamic Host Configuration Protocol (DHCP) server provides a framework to pass configuration information to client hosts (such as PCs) on a TCP/IP network.
A router or interface that acts as a DHCP server can allocate network IP addresses and deliver configuration settings to client hosts, without user intervention.
The DHCP access service minimizes the overhead that is required to add clients to the network by providing a centralized, server-based setup.
You do not have to manually create and maintain IP address assignments for clients. DHCP is defined in RFC 2131 Dynamic Host Configuration Protocol .
The following steps are used to configure the EX-Series switch as a DHCP server:
juniper@EX# set system services dhcp pool 10.0.0.0/24
juniper@EX# set system services dhcp pool 10.0.0.0/24 address-range low 10.0.0.2 high 10.0.0.252
juniper@EX# set system services dhcp pool 10.0.0.0/24 router 10.0.0.1
Juniper@EX# set interface vlan unit 0 family inet address 10.0.0.1/24
Juniper@EX> set vlan default l3-interface vlan.0
set system services dhcp pool 10.0.0.0/24 address-range low 10.0.0.2 set system services dhcp pool 10.0.0.0/24 address-range high 10.0.0.252 set system services dhcp pool 10.0.0.0/24 router 10.0.0.1 set interfaces vlan unit 0 family inet address 10.0.0.1/24 set vlans default l3-interface vlan.0
juniper@EX# run show system services dhcp statistics Packets dropped: Total 2233 Messages received: BOOTREQUEST 0 DHCPDECLINE 0 DHCPDISCOVER 2 DHCPINFORM 0 DHCPRELEASE 0 DHCPREQUEST 8 Messages sent: BOOTREPLY 0 DHCPOFFER 2 DHCPACK 4 DHCPNAK 0
juniper@EX# run show system services dhcp binding IP address Hardware address Type Lease expires at 10.0.0.3 00:23:9c:04:e3:43 dynamic 2012-11-14 18:04:40 PDT 10.0.0.4 00:a0:12:00:13:02 dynamic 2012-11-14 18:04:42 PDT
juniper@EX> show system services dhcp binding 10.0.0.3 detail Dynamic binding information: IP address 10.0.0.3 Hardware address 00:23:9c:04:e3:43 Pool 10.0.0.0/24 Request received on vlan.0 Lease information: Type DHCP Obtained at 2012-11-13 18:04:40 PDT Expires at 2012-11-14 18:04:40 PDT State active DHCP options: Code: 1, Type: ip-address, Value: 255.255.255.0 Code: 28, Type: ip-address, Value: 10.0.0.255 Name: router, Value: [ 10.0.0.1 ]
Debugging DHCP operations on the switches :
Set traceoptions under DHCP to capture packets in log file:
juniper@EX# set system services dhcp traceoptions file juniper@EX# set system services dhcp traceoptions flag all
juniper@EX# run file show /var/log/
juniper@EX# run monitor start
2020-05-02: Article reviewed for accuracy; added specific platforms (Legacy EX). 2022-01-25: Article very similar to KB11018 [juniper.net]. KB11018 [juniper.net] has additional configuration knobs and examples, tagged as duplicate of it.