Knowledge Center Search


 

SRX Getting Started - Configure DHCP Server

  [KB15754] Show KB Properties

  [KB15754] Hide KB Properties

Categories:
Knowledge Base ID: KB15754
Last Updated: 02 Feb 2014
Version: 6.0

Summary:

This article describes how to configure an SRX Series device as a DHCP server and how to verify and troubleshoot your configuration.

For other topics, go to the SRX Getting Started main page.

Problem or Goal:

Configure an SRX Series device as a DHCP server for a subnet.

Cause:

Solution:

This article describes how to configure an SRX Series device as a DHCP server and how to verify and troubleshoot your configuration.

Configure an SRX Series device as a DHCP server for a subnet.

This section contains the following:

Note: An SRX Series device can act as a DHCP client, DHCP server, and DHCP relay agent at the same time, but you cannot configure more than one DHCP role on a single interface.

For information about configuring the device as a DHCP client, see KB15753 - SRX Getting Started - Configure DHCP Client. For information about configuring the device as a DHCP relay agent, see KB15755 - Getting Started - Configure Global DHCP Relay Service.


J-Web Configuration

Note: This example does not use every option available for DHCP server configuration. For information about additional DHCP server configuration options, see the Technical Documentation section for links to JUNOS documentation that explains all available DHCP options.

To configure DHCP server settings for a subnet:
  1. Select Configure>Services>DHCP>DHCP Service.
  2. Click the DHCP Pools tab.
  3. To add a DHCP pool, click Add.
  4. In the Address Pool Subnet box, type the subnet for which DHCP is configured (for example, 192.168.1.0/24).
  5. In the Address Range Low box, type the lowest IP address of the pool range (for example, 192.168.1.33).
  6. In the Address Range High box, type the highest IP address of the pool range (for example, 192.168.1.64).
  7. Expand the Server Information heading.
  8. In the Domain Name box, type the domain name to be assigned to DHCP clients (for example, example.net).
  9. In the Name Servers box (next to the Add button), type the IP address of a DNS server that DHCP clients use (for example, 192.168.1.1).
  10. Click Add. The server appears in the Name Servers list.
  11. In the Gateway Routers box (next to the Add button), type the IP address of the router assigned to clients for the DHCP pool (for example, 192.168.1.1).
  12. Click Add. The router appears in the Gateway Routers list.
  13. Expand the Lease Time heading.
  14. Under Lease Time and Boot Options, in the Default Lease Time box, type the number of seconds a client can hold a lease if a client does not request a specific lease length (for example, 3600)
  15. Click OK. The DHCP Pools tab is active.
  16. If you are finished creating DHCP pools, click Apply.
To create additional DHCP pools, repeat this procedure for each pool.

Next, you must specify DHCP as an allowed inbound service for each interface that is associated with DHCP. The IP address of the interface must be in the same network as the DHCP pool. For information about configuring an interface, see Junos OS Interfaces Library for Security Devices.
  1. Select Configure>Security>Zones.
  2. Click the security zone that you want to modify (for example, untrust).
  3. Under Interfaces Configuration, select an interface in the zone that is associated with DHCP, and click Edit.
  4. In the Host Inbound Traffic Option section, under System Services, select Allow Selected Services.
  5. In the Allowed Selected Services box, select dhcp, and click Add.
  6. Click OK.
  7. To apply your changes, click Apply.
Repeat this procedure for each interface that is associated with DHCP.

If you are finished configuring the device, click Commit to commit the configuration.


CLI Configuration

To configure the device as a DHCP server for a subnet:
  1. Specify the lowest IP address of the pool range (for example, 192.168.1.33).
  2. user@host# set system services dhcp pool 192.168.1.0/24 address-range low 192.168.1.33
  3. Specify the highest IP address of the pool range (for example, 192.168.1.64).
  4. user@host# set system services dhcp pool 192.168.1.0/24 address-range high 192.168.1.64
  5. Specify the domain to be specified for DHCP clients (for example, example.net).
  6. user@host# set system services dhcp pool 192.168.1.0/24 domain-name example.net
  7. Specify the DNS server that clients use (for example, 192.168.1.1).
  8. user@host# set system services dhcp pool 192.168.1.0/24 name-server 192.168.1.1
  9. Specify the IP address of the router assigned to clients for the DHCP pool (for example, 192.168.1.1).
  10. user@host# set system services dhcp pool 192.168.1.0/24 router 192.168.1.1
  11. Specify the number of seconds a client can hold a lease if a client does not request a specific lease length (for example, 3600).
  12. user@host# set system services dhcp pool 192.168.1.0/24 default-lease-time 3600
  13. Specify DHCP as an allowed inbound service for each interface that is associated with DHCP. In the following example, DHCP discovery messages are expected on the fe-0/0/5.0 and fe-0/0/6.0 interfaces, so DHCP is configured as an inbound service for fe-0/0/5.0 and fe-0/0/6.0.

user@host# set security zones security-zone untrust interfaces fe-0/0/5.0 host-inbound-traffic system-services dhcp
user@host# set security zones security-zone untrust interfaces fe-0/0/6.0 host-inbound-traffic system-services dhcp

Note: The IP address of the interface must be in the same network as the DHCP pool. For example, if the subnet for the DHCP pool is 192.168.1.0/24, use the set interfaces command to specify the appropriate IP address:

user@host# set interfaces fe-0/0/6 unit 0 family inet address 192.168.1.1/24



Technical Documentation

Administration Guide for Security Devices



Verification

To verify the DHCP service configuration, use the following operational commands:

  • user@host> show system services dhcp pool

For sample output, see show system services dhcp pool.

  • user@host> show system services dhcp binding
For sample output, see show system services dhcp binding.
  • user@host> show system services dhcp statistics

For sample output, see show system services dhcp statistics.

  • user@host> show system services dhcp conflict

For sample output, see show system services dhcp conflict

For more information about verifying DHCP configuration, see Verifying Global DHCP Information.


Troubleshooting

Use the following commands to troubleshoot your DHCP server configuration:

user@host# set system services dhcp traceoptions file dhcp.dbg
user@host#
set system services dhcp traceoptions flag all



Purpose:
Configuration

Related Links:

 

 

ASK THE KB

Question or KB ID:


 


 

 
Copyright© 1999-2012 Juniper Networks, Inc. All rights reserved.