Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Supported Platforms

Configuring DHCP and BOOTP Relay

You can configure the QFX Series to act as a Dynamic Host Configuration Protocol (DHCP) and Bootstrap Protocol (BOOTP) relay agent. This means that if a locally attached host can issue a DHCP or BOOTP request as a broadcast message and the switch relays the message to a specified DHCP or BOOTP server. You should configure a switch to be a DHCP and BOOTP relay agent if you have locally attached hosts and a remote DHCP or BOOTP server.

Note: This task uses a release of Junos OS that does not support the Enhanced Layer 2 Software (ELS) configuration style. If your switch runs software that supports ELS, see Configuring DHCP and BOOTP. For ELS details, see Getting Started with Enhanced Layer 2 Software.

If you configure a switch to be a DHCP relay agent, you can also enable smart DHCP relay, which allows you to configure alternative gateway addresses for a DHCP server so that if the server fails to reply to the requests sent using the primary gateway address, the switch can resend the requests via the alternative gateway addresses. To use this feature, you must configure a routed VLAN interface or Layer 3 logical interface with multiple IP addresses and configure that interface to be a relay agent.

Configuring a DHCP and BOOTP Relay Agent

To configure a switch to act as a DHCP and BOOTP relay agent, include the bootp statement at the [edit forwarding-options helpers] hierarchy level:

[edit forwarding-options helpers]
bootp {apply-secondary-as-giaddr text-description;client-response-ttl number;description text-description;interface (interface-name | interface-group) {client-response-ttl number;description text-description;maximum-hop-count number;minimum-wait-time seconds;no-listen;server address apply-secondary-as-giaddr}maximum-hop-count number;minimum-wait-time seconds;relay-agent-option;server server-identifier }

To include a description of the BOOTP service, DHCP service, or interface, use the description statement.

To configure a logical interface or a group of logical interfaces with a specific DHCP relay or BOOTP configuration, include the interface statement.

To stop packets from being forwarded, include the no-listen statement.

To set the maximum allowed number in the hops field of the BOOTP message, include the maximum-hop-count statement. BOOTP messages that have a larger number in the hops field than the maximum allowed are not forwarded. If you omit the maximum-hop-count statement, the default maximum number of hops is four.

To set the minimum allowed number of seconds in the secs field of the BOOTP message, include the minimum-wait-time statement. This setting configures a minimum number of seconds since the client sent its first BOOTP request. BOOTP messages that have a smaller number in the secs field than the allowed minimum are not forwarded. The default value for the minimum wait time is zero (0).

To set the IP address that specify the DHCP or BOOTP server for the router, switch, or interface, include the server statement. You can include multiple server statements.

To set an IP time-to-live (TTL) value for DHCP response packets sent to a DHCP client, include the client-response-ttl statement.

The following example demonstrates a BOOTP relay agent configuration.

user@host# show forwarding-options
helpers {bootp {description "dhcp relay agent global parameters";server 192.168.55.44;server 172.16.0.3 routing-instance c3;maximum-hop-count 10;minimum-wait-time 8;interface {xe-0/0/1 {description "use this info for this interface";server 10.10.10.10;server 192.168.14.14;maximum-hop-count 11;minimum-wait-time 3;}xe-0/0/2 {no-listen; ###ignore DHCPDISCOVER messages on this interface}all {description "globals apply to all other interfaces";}}}}

Configuring DHCP Smart Relay

You can use DHCP smart relay to provide redundancy and resiliency to your DHCP relay configuration. Smart relay provides additional relay functionality and requires all of the configuration settings required by DHCP relay. To use DHCP smart relay, you also need an interface with multiple IP addresses assigned to it. You can achieve this by doing either of the following tasks:

Once you have created an interface with multiple IP addresses, complete the smart relay configuration by entering one of the following statements:

  • set forwarding-options helpers bootp smart-relay-global: Use this statement to enable smart relay on all the interfaces that are configured as relay agents.
  • set forwarding-options helpers bootp interface interface-name smart-relay-agent: Use this statement to enable smart relay on a specific interface.

When smart relay is configured for an interface, the switch initially sends DHCP request (discover) messages out of that interface using the primary address of the interface as the gateway IP address (in the giaddr field) for the DHCP message. If no DHCP offer message is received from a server in reply, the switch allows the client to send as many as three more discover messages using the same gateway IP address. If no DHCP offer message is received after three retries, the switch resends the discover message using the alternate IP address as the gateway IP address. If you configure more than two IP addresses on the relay agent interface, the switch repeats this process until a DHCP offer message is received or all of the IP addresses have been used without success.

Published: 2014-10-02

Supported Platforms

Published: 2014-10-02