Application Control Engine Module Routing and Bridging Configuration Guide (Software Version A1(2))
Configuring the DHCP Relay

Table Of Contents

Configuring the DHCP Relay

DHCP Server and Client Overview

DHCP Relay Configuration Quick Start

Configuring the DHCP Relay Agent

Enabling the DHCP Relay

Specifying the DHCP Server IP Address

Configuring a Relay Agent Information Reforwarding Policy

Viewing DHCP Relay Configuration and Statistics


Configuring the DHCP Relay


Dynamic Host Configuration Protocol (DHCP) servers provide configuration parameters to DHCP clients. DHCP is a protocol that supplies network settings, including the host IP address, the default gateway, and a DNS server. When DHCP clients and associated servers do not reside on the same IP network or subnet, a DHCP relay agent can transfer DHCP messages between them. The DHCP relay agent operates as the interface between DHCP client and the server. It listens for client requests and adds vital configuration data, such as the client's link information which is needed by the server to allocate address for the client. When the DHCP server responds, the DHCP relay agent forwards the reply back it to the DHCP client.


Note The ACE does not support DHCP relay for DHCP broadcast packets received on shared VLANs.


This chapter includes the following major sections:

DHCP Server and Client Overview

DHCP Relay Configuration Quick Start

Configuring the DHCP Relay Agent

Viewing DHCP Relay Configuration and Statistics

DHCP Server and Client Overview

DHCP provides a framework for passing configuration information dynamically to hosts on a TCP/IP network. A DHCP client is an Internet host using DHCP to obtain configuration parameters such as an IP address.

A DHCP relay agent is any host that forwards DHCP packets between clients and servers. Relay agents are used to forward requests and replies between clients and servers when they are not on the same physical subnet. Relay agent forwarding is distinct from the normal forwarding of an IP router, where IP datagrams are switched between networks somewhat transparently. By contrast, relay agents receive DHCP messages and then generate a new DHCP message to send on another interface.

Figure 5-1 illustrates the basic steps that occur when a DHCP client requests an IP address from a DHCP server. The client, Host A, sends a DHCPDISCOVER broadcast message to locate a DHCP server. A relay agent forwards the packets between the DHCP client and server. A DHCP server offers configuration parameters (such as an IP address, a MAC address, a domain name, and a lease for the IP address) to the client in a DHCPOFFER unicast message.

Figure 5-1 DHCP Request for an IP Address from a DHCP Server

DHCP Relay Configuration Quick Start

Table 5-1 provides a quick overview of the steps required to configure the DHCP relay function on the ACE. Each step includes the CLI command required to complete the task. For a complete description of each feature and all the options associated with the CLI command, see the sections following Table 5-1.

Table 5-1 DHCP Relay Configuration Quick Start

Task and Command Example

1. If you are operating in multiple contexts, observe the CLI prompt to verify that you are operating in the desired context. If necessary, log directly in to, or change to, the correct context.

host1/Admin# changeto C1
host1/C1# 

The rest of the examples in this table use the Admin context for illustration purposes, unless otherwise specified. For details on creating contexts, refer to the Cisco Application Control Engine Module Virtualization Configuration Guide.

2. Enter configuration mode by entering config.

host1/Admin# config 
Enter configuration commands, one per line. End with CNTL/Z
host1/Admin(config)#

3. Enable the DHCP relay agent to accept DHCP requests from clients on the associated context or VLAN interface.

host1/Admin(config)# ip dhcp relay enable

4. Specify the IP address of a DHCP server to which the DHCP relay agent forwards client requests.

host1/Admin(config)# ip dhcp relay server 192.168.20.1

5. (Optional) Configure a relay agent information reforwarding policy on the DHCP server to identify what the DHCP server should do if a forwarded message already contains relay information.

host1/Admin(config)# ip dhcp relay information policy replace

6. (Optional) If necessary, save your configuration changes to Flash memory.

host1/Admin(config)# exit
host1/Admin# copy running-config startup-config

Configuring the DHCP Relay Agent

This section describes how to configure the DHCP relay agent on the ACE. When you configure the ACE as a DHCP relay agent, it is responsible for forwarding the requests and responses negotiating between the DHCP clients and the server. By default, the DHCP relay agent is disabled. You must configure a DHCP server in conjunction with enabling the DHCP relay.

The DHCP relay agent can be configured at both the context and VLAN interface level of the ACE. Note the following configuration considerations:

If you configure the DHCP relay agent at the context level, the configuration is applicable to all interfaces associated with the context.

If you configure the DHCP relay agent at the VLAN interface level, the configuration is applicable to that particular interface only; the remaining interfaces revert to the context level configuration.

This section includes the following topics:

Enabling the DHCP Relay

Specifying the DHCP Server IP Address

Configuring a Relay Agent Information Reforwarding Policy

Enabling the DHCP Relay

To accept DHCP requests from clients on the associated context or VLAN interface and enable the DHCP relay agent, use the ip dhcp relay enable command. The DHCP relay starts forwarding packets to the DHCP server address specified in the ip dhcp relay server command for the associated VLAN interface or context.

The syntax of this command is:

ip dhcp relay enable

For example, to enable the DHCP relay to all interfaces associated with a context, enter:

host1/Admin(config)# ip dhcp relay enable

For example, to enable the DHCP relay at the VLAN interface level, enter:

host1/Admin(config)# interface vlan 50
host1/Admin(config-if)# ip dhcp relay enable

To disable the DHCP relay for all interfaces associated with a context, enter:

host1/Admin(config)# no ip dhcp relay enable

To disable the DHCP relay on the VLAN interface, enter:

host1/Admin(config-if)# no ip dhcp relay enable

Specifying the DHCP Server IP Address

To set the IP address of a DHCP server to which the DHCP relay agent forwards client requests, use the ip dhcp relay server command.

The syntax of this command is:

ip dhcp relay server ip_address

The ip_address argument specifies the IP address of the DHCP server. Enter the address in dotted-decimal IP notation (for example, 192.168.20.1).

For example, to set the IP address of a DHCP relay server to all interfaces associated with a context, enter:

host1/Admin(config)# ip dhcp relay enable
host1/Admin(config)# ip dhcp relay server 192.168.20.1

For example, to set the IP address of a DHCP relay server at the VLAN interface level, enter:

host1/Admin(config)# interface vlan 50
host1/Admin(config-if)# ip dhcp relay enable
host1/Admin(config-if)# ip dhcp relay server 192.168.20.1

To remove the IP address of a DHCP server, enter:

host1/Admin(config-if)# no ip dhcp relay server 192.168.20.1

Configuring a Relay Agent Information Reforwarding Policy

To configure the DHCP relay to identify what is to be performed if a forwarded message already contains relay information, use the ip dhcp relay information policy command in configuration mode. By default, the reforwarding policy is to drop the DHCP relay packet.


Note You cannot set the relay agent information reforwarding policy at the VLAN interface level; you can only globally set this function for all interfaces associated with a context.


The syntax of this command is:

ip dhcp relay information policy {keep | replace}

The keywords are:

keep—Indicates that existing information is left unchanged on the DHCP relay agent.

replace—Indicates that existing information is overwritten on the DHCP relay agent.

For example, to set the relay agent information reforwarding policy to replace existing information for all interfaces associated with a context, enter:

host1/Admin(config)# ip dhcp relay information policy replace

To restore the default relay information policy to drop the DHCP relay packet, enter:

host1/Admin(config)# no ip dhcp relay information policy replace

Viewing DHCP Relay Configuration and Statistics

To view configuration information and statistics collected for the DHCP relay, use the show ip dhcp relay command. There are three show commands for DHCP relay:

show ip dhcp relay conf—Displays the DHCP configuration information.

show ip dhcp relay information policy—Displays the relay agent information reforwarding policy status.

show ip dhcp relay statistics—Displays the DHCP relay statistics.

The output of this command increments until you enter the clear ip dhcp relay statistics command.

For example, to display the configured status of the relay agent information reforwarding policy, enter:

host/Admin# show ip dhcp relay information policy
DHCP Relay reforwarding policy configured = REPLACE

To clear all of the DHCP relay statistics information, use the clear ip dhcp relay statistics command. For example, enter:

host1/Admin# clear ip dhcp relay statistics

Table 5-2 describes the fields in the show ip dhcp relay conf command output.

Table 5-2 Field Descriptions for the show ip dhcp relay conf Command Output 

Field
Description

Context level configuration

Configuration information for the DHCP relay agent at the context level

Status

The operating status of the DHCP server at the context level: Enabled or Disabled

Server

The IP address of the DHCP server at the context level

Interface level configuration

Configuration information for the DHCP relay agent at the VLAN interface level

VLAN

Assigned interface VLAN number

Interface ID

The interface ID for the VLAN

Status

The operating status of the DHCP server at the VLAN interface level: Enabled or Disabled

Server

The IP address of the DHCP server at the VLAN interface level


Table 5-3 describes the fields in the show ip dhcp relay statistics command output.

Table 5-3 Field Descriptions for the show ip dhcp relay statistics Command Output 

Field
Description

Context level configuration

Statistics for the DHCP relay agent at the context level

Number of BOOTREQUEST packets relayed

Incremented number of forwarded BOOTREQUEST packets to a DHCP server

Number of DHCPDISCOVER packets relayed

Incremented number of forwarded DHCPDISCOVER packets to a DHCP server

Number of DHCPREQUEST packets relayed

Incremented number of forwarded DHCPREQUEST packets to a DHCP server

Number of DHCPDECLINE packets relayed

Incremented number of forwarded DHCPDECLINE packets to a DHCP server

Number of DHCPRELEASE packets relayed

Incremented number of forwarded DHCPRELEASE packets to a DHCP server

Number of DHCPINFORM packets relayed

Incremented number of forwarded DHCPINFORM packets to a DHCP server

Number of BOOTREPLY packets relayed

Incremented number of forwarded BOOTREPLY packets to a DHCP server

Number of DHCPOFFER packets relayed

Incremented number of forwarded DHCPOFFER packets to a DHCP server

Number of DHCPACK packets relayed

Incremented number of forwarded DHCPACK packets to a DHCP server

Number of DHCPNAK packets relayed

Incremented number of forwarded DHCPNAK packets to a DHCP server

Number of failures while relaying

Number of failures that occurred while the DHCP relay agent forwarded packets to a DHCP server

Interface level configuration

Statistics for the DHCP relay agent at the VLAN interface level