Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

DHCP Server Options

DHCP options are tagged data items that provide information to a DHCP client. The options are sent in a variable-length field at the end of a DHCP message. For more information about various DHCP options, read this topic.

Configure DHCP Server Identifier

The server identifier identifies a DHCP server in a DHCP message. It can also be used as a destination address from clients to servers (for example, when the boot file is set, but not the boot server).

To configure a DHCP server identifier, include the server-identifier statement at [edit access address-assignment pool pool-name family inet dhcp-attributes] hierarchy level.

Example:

You can also include the server-identifier statement at the following hierarchy levels:

  • [edit logical-systems logical-system-name access address-assignment pool pool-name family inet dhcp-attributes]

  • [edit logical-systems logical-system-name routing-instances routing-instance-name access address-assignment pool pool-name family inet dhcp-attributes]

  • [edit routing-instances routing-instance-name access address-assignment pool pool-name family inet dhcp-attributes]

Configure Address Pools for DHCP Dynamic Bindings

For dynamic bindings, set aside a pool of IP addresses that can be assigned to clients. Addresses in a pool must be available to clients on the same subnet. Configure the following options:

  • Network - Include the client subnet number and prefix length (in bits). The addresses in the pool must be on the subnet in which the DHCP clients reside.

  • Address Range -Specify the range of IP addresses in the pool that are available for dynamic address assignment. This statement is optional. If no range is specified, the pool will use all available addresses within the subnet specified. (Broadcast addresses, interface addresses, and excluded addresses are not available.)

  • Excluded Addresses –Specify the addresses within the range that are not used for dynamic address assignment. You can exclude one or more addresses within the range. This statement is optional.

The following is an example of a pool configuration.

Note the following when configuring address pools:

  • You can configure multiple address pools for a DHCP server, but only one address range per pool is supported.

  • DHCP maintains the state information for all pools configured. Clients are assigned addresses from pools with subnets that match the interface on which the DHCPDISCOVER packet is received.

  • When more than one pool exists on the same interface, addresses are assigned on a rotating basis from all available pools.

Configure Manual (Static) DHCP Bindings Between a Fixed IP Address and a Client MAC Address

Static bindings provide configuration information for specific clients. This information can include one or more fixed Internet addresses, the client hostname, and a client identifier.

A static binding defines a mapping between a fixed IP address and the client’s MAC address.

The hardware-address variable specifies the MAC address of the client. This is a hardware address that uniquely identifies each client on the network.

The ip-address statement specifies the fixed IP address assigned to the client. Typically a client has one address assigned, but you can assign more.

The following is an example of a static binding configuration:

You can also include the server-identifier statement at the following hierarchy levels:

  • [edit logical-systems logical-system-name access address-assignment pool pool-name family inet]

  • [edit logical-systems logical-system-name routing-instances routing-instance-name access address-assignment pool pool-name family inet]

  • [edit routing-instances routing-instance-name access address-assignment pool pool-name family inet]

Enabling TCP/IP Propagation on a DHCP Local Server

Propagation of TCP/IP Settings for DHCP

The Juniper Networks device can operate simultaneously as a client of the DHCP server in the untrust zone and a DHCP server to the clients in the trust zone. The device takes the TCP/IP settings that it receives as a DHCP client and forwards them as a DHCP server to the clients in the trust zone. The device interface in the untrust zone operates as the DHCP client, receiving IP addresses dynamically from an Internet service provider (ISP) on the external network.

During the DHCP protocol exchange, the device receives TCP/IP settings from the external network on its DHCP client interface. Settings include the address of the ISP's DHCP name server and other server addresses. These settings are propagated to the DHCP server pools configured on the device to fulfill host requests for IP addresses on the device's internal network.

This topic describes how to configure TCP/IP settings on a DHCP local server, which includes a DHCP client and a DHCP local server.

Note:

This feature is supported on SRX300, SRX320, SRX340, SRX345, SRX550M, and SRX1500 devices.

To enable TCP/IP setting propagation on a DHCP local server:

  1. Configure the update-server option on the DHCP client.
  2. Configure the address pool to specify the interface (where update-server is configured) from which TCP/IP settings can be propagated.
  3. Configure the DHCP local server.

Specify DHCP Lease Times for IP Address Assignments

For clients that do not request a specific lease time, the default lease time is one day. You can configure a maximum lease time for IP address assignments or change the default lease time.

To configure maximum lease time, include the maximum-lease-time statement:

To configure default lease time, include the lease-time statement:

Configure a DHCP Boot File and DHCP Boot Server

When a DHCP client starts, it contacts a boot server to download the boot file.

To configure a boot file and boot server, include the boot-file and boot-server statements:

After a client receives a DHCPOFFER response from a DHCP server, the client can communicate directly with the boot server (instead of the DHCP server) to download the boot file. This minimizes network traffic and enables you to specify separate boot server/file pairs for each client pool or subnetwork.

The boot-file statement configures the name and location of the initial boot file that the DHCP client loads and executes. This file stores the boot image for the client. In most cases, the boot image is the operating system the client uses to load.

The boot-server statement configures the IP address of the TFTP server that contains the client’s initial boot file. You must configure an IP address or a hostname for the server.

You must configure at least one boot file and boot server. Optionally, you can configure multiple boot files and boot servers. For example, you might configure two separate boot servers and files: one for static binding and one for address pools. Boot file configurations for pools or static bindings take precedence over boot file configurations at the [edit system services dhcp] hierarchy level.

The following example specifies a boot file and server for an address pool:

Configure Domain Name and Domain Search List

To configure the name of the domain in which clients search for a DHCP server host, include the domain-name statement:

The domain-name statement sets the domain name that is appended to hostnames that are not fully qualified. This statement is optional. If you do not configure a domain name, the default is the client’s current domain.

To configure a domain search list, include the option 119 statement in hexadecimal-string using hexadecimal values. Following is an example for 'jnpr.net' domain name:

See How to configure DHCP server (JDHCPD) to support domain search (option 119).

Configure Routers Available to the DHCP Client

After a DHCP client loads the boot image and has booted, the client sends packets to a router.

To configure routers available to the DHCP client, include the router statement:

The router statement specifies a list of IP addresses for routers on the client’s subnet. List routers in order of preference. You must configure at least one router for each client subnet.

Example:

Configure User-Defined DHCP Options

You can configure one or more user-defined options that are not included in the Junos default implementation of the DHCP server. For example, if a client requests a DHCP option that is not included in the DHCP server, you can create a user-defined option that enables the server to respond to the client’s request.

To configure a user-defined DHCP option, include the option statement:

The option statement specifies the following values:

  • id-number—Any whole number. The ID number is used to index the option and must be unique across a DHCP server.

  • option-type—Any of the following types: byte, byte-stream, flag, integer, ip-address, short, string, unsigned-integer, unsigned-short.

  • array—An option can include an array of values.

  • option-value—Value associated with an option. The option value must be compatible with the option type (for example, an On or Off value for a flag type).

The following example shows user-defined DHCP options:

Configure DHCP SIP Server

You can use the sip-server statement on the EX Series switch to configure option 120 on a DHCP server. The DHCP server sends configured option values—Session Initiation Protocol (SIP) server addresses or names—to DHCP clients when they request them. You specify either an IPv4 address or a fully qualified domain name to be used by SIP clients to locate a SIP server. You cannot specify both an address and name in the same statement.

To configure a SIP server using the dhcp-attributes option:

Overriding the Default DHCP Local Server Configuration Settings

Subscriber management enables you to override certain default DHCP local server configuration settings. You can override the configuration settings at the global level, for a named group of interfaces, or for a specific interface within a named group.

  • To override global default DHCP local server configuration options, include the overrides statement and its subordinate statements at the [edit system services dhcp-local-server] hierarchy level.

  • To override DHCP local server configuration options for a named group of interfaces, include the statements at the [edit system services dhcp-local-server group group-name] hierarchy level.

  • To override DHCP local server configuration options for a specific interface within a named group of interfaces, include the statements at the [edit system services dhcp-local-server group group-name interface interface-name] hierarchy level.

  • To configure overrides for DHCPv6 local server at the global level, group level, or per-interface, use the corresponding statements at the [edit system services dhcp-local-server dhcpv6] hierarchy level.

To override default DHCP local server configuration settings:

Legacy DHCP Server Configuration Options

If you are using the legacy DHCP on your device, use the following configuration options:

DHCP Server Identifier

The server identifier identifies a DHCP server in a DHCP message. It can also be used as a destination address from clients to servers (for example, when the boot file is set, but not the boot server).

You can configure DHCP server identifier in following hierarchy levels:

Example:

The following example shows a DHCP server identifier configured for an address pool:

Static-Binding

A static binding defines a mapping between a fixed IP address and the client’s MAC address.

Static bindings provide configuration information for specific clients. This information can include one or more fixed Internet addresses, the client hostname, and a client identifier.

In the static-binding configuration, you must configure following parameters:

  • The mac-address variable specifies the MAC address of the client. This is a hardware address that uniquely identifies each client on the network.

  • The fixed-address statement specifies the fixed IP address assigned to the client. Typically a client has one address assigned, but you can assign more.

  • The host statement specifies the hostname of the client requesting the DHCP server. The name can include the local domain name. Otherwise, the name is resolved based on the domain-name statement.

  • The client-identifier statement is used by the DHCP server to index the database of address bindings. The client identifier is either an ASCII string or hexadecimal digits. It can include a type-value pair as specified in RFC 1700, Assigned Numbers. Either a client identifier or the client’s MAC address must be configured to uniquely identify the client on the network.

    For each unique client-identifier client-id value, the DHCP server issues a unique lease and IP address from the pool. Previously, when the client provided an incorrect client-identifier client-id value, the DHCP server did not issue a lease.

Example:

Configuring Address Pools

For dynamic bindings, set aside a pool of IP addresses that can be assigned to clients. Addresses in a pool must be available to clients on the same subnet. Configure the following options:

Example:

Maximum Lease Time

For clients that do not request a specific lease time, the default lease time is one day. You can configure a maximum lease time for IP address assignments or change the default lease time.

To configure maximum lease time, include the maximum-lease-time statement:

You can include these statements at the following hierarchy levels:

Lease times defined for static bindings and address pools take priority over lease times defined at the [edit system services dhcp] hierarchy level.

The maximum-lease-time statement configures the maximum length of time in seconds for which a client can request and hold a lease. If a client requests a lease longer than the maximum specified, the lease is granted only for the maximum time configured on the server. After a lease expires, the client must request a new lease.

Note:

Maximum lease times do not apply to dynamic BOOTP leases. These leases are not specified by the client and can exceed the maximum lease time configured.

The following example shows a configuration for maximum and default lease times:

Boot File and Boot Server

When a DHCP client starts, it contacts a boot server to download the boot file.

To configure a boot file and boot server, include the boot-file and boot-server statements:

After a client receives a DHCPOFFER response from a DHCP server, the client can communicate directly with the boot server (instead of the DHCP server) to download the boot file. This minimizes network traffic and enables you to specify separate boot server/file pairs for each client pool or subnetwork.

You can include these statements at the following hierarchy levels:

Example:

Domain Name and Domain Search

You can include this statement at the following hierarchy levels:

To configure a domain search list, include the domain-search statement:

You can include this statement at the following hierarchy levels:

The domain-search statement sets the order in which clients append domain names when searching for the IP address of a host. You can include one or more domain names in the list. For more information, see RFC 3397, Dynamic Host Configuration Protocol (DHCP) Domain Search Option.

The domain-search statement is optional, if you do not configure a domain search list, the default is the client’s current domain.

Router Name

After a DHCP client loads the boot image and has booted, the client sends packets to a router.

To configure routers available to the DHCP client, include the router statement:

The router statement specifies a list of IP addresses for routers on the client’s subnet. List routers in order of preference. You must configure at least one router for each client subnet.

The following example shows routers configured at the [edit system services dhcp] hierarchy level:

Example:

You can include this statement at the following hierarchy levels:

DHCP Options

You can configure one or more user-defined options that are not included in the Junos default implementation of the DHCP server. For example, if a client requests a DHCP option that is not included in the DHCP server, you can create a user-defined option that enables the server to respond to the client’s request.

Example

User-defined options that conflict with DHCP configuration statements are ignored by the server. For example, in the following configuration, the DHCP server ignores the user-defined option 3 router statement and uses the router statement instead:

You can include this statement at the following hierarchy levels:

DHCP SIP Server

You can use the sip-server statement on the EX Series switch to configure option 120 on a DHCP server. The DHCP server sends configured option values—Session Initiation Protocol (SIP) server addresses or names—to DHCP clients when they request them. Previously, you were only allowed to specify a SIP server by address using [edit system services dhcp option 120]. You specify either an IPv4 address or a fully qualified domain name to be used by SIP clients to locate a SIP server. You cannot specify both an address and name in the same statement.

For example, to configure one address:

To configure a SIP server using the name option:

For example, to configure a name: