Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Configuring a DHCP Server on Switches (CLI Procedure)

Note: This task uses Junos OS for EX Series switches that does not support the Enhanced Layer 2 Software (ELS) configuration style. If your switch runs software that supports ELS, see Configuring a DHCP Server on Switches (CLI Procedure). For ELS details, see Getting Started with Enhanced Layer 2 Software.

A Dynamic Host Configuration Protocol (DHCP) server can provide two valuable TCP/IP network services. DHCP can dynamically allocate IP parameters, such as an IP address, to clients and it can also deliver software upgrades to clients.

A DHCP configuration consists of two components—an optional reconfiguration of default settings on DHCP clients and the configuration of a DHCP server. This topic covers configuration of the DHCP server. For information about reconfiguring a DHCP client, see Configuring a DHCP Client (CLI Procedure).

You can configure either of two versions of a DHCP server on a switch— the extended server version or the legacy server version. We recommend that you configure the extended server unless you need to keep your DHCP server configuration backward-compatible with the legacy server version.

This topic includes the following tasks:

  1. Configuring an Extended DHCP Server on a Switch
  2. Configuring a Legacy DHCP Server on a Switch (CLI Procedure)

Configuring an Extended DHCP Server on a Switch

To configure an extended DHCP server, you must configure a DHCP pool, indicate IP addresses for the pool, and create a server group. Additional configurations are optional.

Do not assign addresses that are already in use in the network to address pools. The extended DHCP server does not check whether addresses are already in use before it assings them to clients.

  1. Create an address pool for DHCP IP addresses:
    [edit]user@switch# set access address-pool address-pool
  2. Configure an address-assignment pool that can be used by different client applications for DHCP dynamic assignment:
    [edit access address-assignment]user@switch# set pool address-pool-name
  3. Create a server group on the switch, providing a group name and an interface name for DHCP:
    [edit system services dhcp-local-server]user@switch# set group group-name interface interface-name
  4. (Optional) Process the information protocol data units (PDUs):
    [edit system services dhcp-local-server]user@switch# set overrides process-inform
  5. (Optional) Redefine the order of attribute matching for pool selection:
    [edit system services dhcp-local-server]user@switch# set pool-match-order ip-address-first
  6. (Optional) Enable dynamic reconfiguration triggered by the DHCP extended server for all DHCP clients or only for the DHCP clients serviced by the specified group of interfaces:
    [edit system services dhcp-local-server]user@switch# set reconfigure
    [edit system services dhcp-local-server group group-name]user@switch# set reconfigure

Configuring a Legacy DHCP Server on a Switch (CLI Procedure)

To configure a legacy DHCP server, you must configure a pool of IP addresses for dynamic assignment. You only need to supply a series of network addresses. Additional configurations are optional.

  1. Configure a pool of IP addresses for dynamic assignment:
    [edit system services dhcp]user@switch# set pool network-range

    Note: Step 2 through Step 15 are for assigning global values at the[edit system services dhcp] hierarchy level. You can also assign the same values to a specific pool by using those same commands at the [edit system services dhcp pool network-range] hierarchy level.

  2. (Optional) Change the domain search list used to resolve hostnames:
    [edit system services dhcp]user@switch# set domain-search [ domain-list ]
  3. (Optional) Change the domain name server (DNS) name that the DHCP server advertises to clients:
    [edit system services dhcp]user@switch# set name-server address
  4. (Optional) Change the DHCP options:
    [edit system services dhcp]user@switch# set option id-number
  5. (Optional) Change the devices advertised to clients:
    [edit system services dhcp]user@switch# set router address
  6. (Optional) Configure the name of the boot server advertised to DHCP clients. The client uses a boot file located on the boot server to complete the DHCP setup. This configuration step is equivalent to DHCP Option 66:
    [edit system services dhcp]user@switch# set boot-server (address | hostname)
  7. (Optional) Set the boot file advertised to DHCP clients. After the client receives an IP address and the boot file location from the DHCP server, the client uses the boot image stored in the boot file to complete DHCP setup. This configuration step is equivalent to DHCP Option 67:
    [edit system services dhcp]user@switch# set boot-file filename
  8. (Optional) Change the SIP server:
    [edit system services dhcp]user@switch# set sip-server addresses-or-names

    For more information, see Configuring a DHCP SIP Server (CLI Procedure).

  9. (Optional) Change the DHCP client’s hardware address:
    [edit system services dhcp]user@switch# set static-binding mac-address
  10. (Optional) Change the NetBIOS name server:
    [edit system services dhcp]user@switch# set wins-server address

Published: 2014-07-23