Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[EX] Example - Configuring an EX Series switch as a DHCP server (including gateway, DNS, and others)



Article ID: KB11018 KB Last Updated: 25 Aug 2020Version: 4.0

This article explains how to configure legacy EX Series switches as a Dynamic Host Configuration Protocol (DHCP) server, and lists the optional knobs that can be used.



Defining a DHCP pool

The DHCP pool name is identified by a subnet on the EX switch, which is configured on a physical layer 3 interface or on a VLAN interface (IRB). For example, if the switch has ports on VLAN 20, and interface VLAN 20 has IP address, then the pool to assign IP addresses for this subnet will be configured as set system services dhcp pool

Alternately the IP address could also be assigned to a physical L3 interface. In either case, when the switch receives DHCP DISCOVER / REQUEST packets on either the layer 2 VLAN 20 ports, or the layer 3 port with an interface IP address, the switch knows to assign IP addresses from the pool identified by This is how the switch can map DHCP requests to a specific pool.

You can create more pools for other subnets as needed.

Configuring the DHCP pool parameters

Reference the DHCP pool by name and configure these parameters.

  • Address range for IP assignment

  • Lease time in seconds

  • DHCP Server Identifier

  • Gateway / Router, WINS, DNS addresses

  • DHCP Options if any, etc

Configure L2 ports with correct VLAN assignment, or assign appropriate IP addresses to the layer 3 interface. Attach DHCP clients to those ports.


root@4200-48-2# show system services dhcp 
pool {
    address-range low high;
    default-lease-time 3600;
    name-server {;
    wins-server {;
    router {;

root@4200-48-2# show system services dhcp | display set 
set system services dhcp pool address-range low
set system services dhcp pool address-range high
set system services dhcp pool default-lease-time 3600
set system services dhcp pool name-server
set system services dhcp pool wins-server
set system services dhcp pool router
set system services dhcp pool server-identifier

root@4200-48-2# show interfaces vlan.20   
family inet {

root@4200-48-2# show interfaces ge-0/0/0 
unit 0 {
    family ethernet-switching {
        vlan {
            members 20;

Attach a PC to ge-0/0/0 and a DHCP assignment takes place.

Verifying the DHCP service

root@4200-48-2> show system services dhcp pool 
Pool name           Low address      High address     Excluded addresses  

root@4200-48-2> show system services dhcp ?      
Possible completions:
  binding              Show DHCP client binding information
  conflict             Show DHCP address conflict
  global               Show DHCP global scope information
  pool                 Show DHCP address pool information
  statistics           Show DHCP statistics


Modification History:

2020-08-25: Article reviewed for accuracy; specific platforms (legacy EX) added; article relevant and valid


Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search