Configure DHCP Server in Juniper SRX Device

DHCP (Dynamic Host Configuration Protocol) has been proved to be very useful protocol. DHCP provides IP addresses to its hosts automatically. You can configure DHCP server on SRX for one or multiple VLANs. You can also configure DHCP Server in Juniper switches. Here we will setup DHCP server for one VLAN. So, lets configure DHCP Server in Juniper SRX device.

Configure DHCP Server in Juniper SRX Device

The diagram above shows the network scenario. We will configure DHCP Server in SRX 240 device. The device is connected to the internet. The EX2200 switch is connected to ge-0/0/0 interface of SRX. The ge-0/0/0 interface of SRX have the IP address of 192.168.1.1/24.

So to make the SRX device as DHCP server hit the following commands in the SRX device’s cli.

[edit]
sysvn@SRX210# edit system services
[edit system services]
sysvn@SRX210# set dhcp pool 192.168.1.0/24 address-range low 192.168.1.3
[edit system services]
sysvn@SRX210# set dhcp pool 192.168.1.0/24 address-range high 192.168.1.20
[edit system services]
sysvn@SRX210# set dhcp pool 192.168.1.0/24 router 192.168.1.1
[edit system services]
sysvn@SRX210# set dhcp pool 192.168.1.0/24 domain-name xyz.com
[edit system services]
sysvn@SRX210# set system services dhcp pool 192.168.1.0/24 name-server 192.168.1.2
[edit system services]
sysvn@SRX210# set system services dhcp pool 192.168.1.0/24 default-lease-time 3600

At last you must configure ge-0/0/0 interface to zone and allows DHCP protocol.

sysvn@SRX210# set security zones security-zone untrust interfaces fe-0/0/0.0 host-inbound-traffic system-services dhcp

DHCP Server Troubleshooting

The EX2200 switch is in layer 2 domain. So the clients will obtain IP address from SRX device via DHCP Server. Other useful commands for troubleshooting DHCP Server are,

sysvn@SRX210> show system services dhcp binding
sysvn@SRX210> show system services dhcp client
sysvn@SRX210> show system services dhcp conflict
sysvn@SRX210> show system services dhcp pool
sysvn@SRX210> show system services dhcp statistics

For information about DHCP visit Juniper website.