Configure DHCP Relay on a Port or VLAN

You can view and configure the DHCP parameters on a specific port or VLAN.

Before you begin

  • You must configure an IP interface on the interface.

Procedure

  1. Enter Interface Configuration mode:

    enable

    configure terminal

    interface GigabitEthernet {slot/port[/sub-port][-slot/port[/sub-port]][,...]} or interface vlan <1–4059>

    Note

    Note

    If the platform supports channelization and the port is channelized, you must also specify the sub-port in the format slot/port/sub-port.

  2. Enable DHCP parameters on a specified port or VLAN:

    ip dhcp-relay

  3. Optional: Enable DHCP Smart Relay on a VLAN:

    ip dhcp-relay include-secondary <parallel | sequential>

  4. Optional: Configure all other optional parameters as required.

    For more information see, Variable Definitions.

Variable Definitions

Use the data in the following table to use the ip dhcp-relay command.

Note

Note

The no ip dhcp-relay command disables DHCP Relay, it does not delete the DHCP entry.

Variable

Value

broadcast

Enables the device to send the server reply as a broadcast to the end station. After you disable this variable, the device sends the server reply as a unicast to the end station.

circuitId

Enables Option 82 circuit ID on the interface.

clear-counters

Clears DHCP Relay counters for the interface.

fwd-path <A.B.C.D> [vrid <1-255>]

Creates a forward path server with a virtual router ID (or VRRP ID), a mode, and a state.

A.B.C.D is the IP address.

vrid <1-255> is the ID of the virtual router and is an integer from 1 to 255.

fwd-path <A.B.C.D> disable [vrid <1-255>]

Disables a forward path server with a specific value and virtual router ID.

A.B.C.D is the IP address.

vrid <1-255> is the ID of the virtual router (or VRRP ID).

fwd-path <A.B.C.D> enable [vrid <1-255>]

Enables a forward path server with a specific value and virtual router ID (or VRRP ID).

A.B.C.D is the IP address.

vrid <1-255> is the ID of the virtual router (or VRRP ID).

fwd-path <A.B.C.D> mode <bootp|bootp_dhcp|dhcp> [vrid <1-255>]

Configures the forward path mode for a VLAN. This command string is available only in VLAN Interface Configuration mode.

A.B.C.D is the IP address.

vrid <1-255> is the ID of the virtual router (or VRRP ID).

max-hop <1-16>

Configures the maximum number of hops before a BootP/DHCP packet is discarded. The default is 4.

min-sec <0-65535>

Configures the minimum seconds count for DHCP. If the secs field in the BootP/DHCP packet header is greater than this value, the device relays or forwards the packet; otherwise, the packet is dropped. The default is 0 seconds.

mode <bootp|bootp_dhcp|dhcp>

Configures DHCP mode to forward BootP messages only, DHCP messages only, or both. The default is both.

remoteId

Enables Option82 remote ID on the interface.

trusted

Configures the DHCP circuit as trusted.

include-secondary <parallel | sequential>

Enables DHCP Smart Relay in one of the following modes:

  • parallel— the relay agent makes multiple copies of DHCP requests and inserts each IP address of the client- facing interface (VLAN or VRRP) as the gateway address in each copy of the request. The switch simultaneously relays multiple packets to the DHCP server, assigning each packet the correct IP address in the correct subnet.

  • sequential—the relay agent forwards received DHCP packets from all IP addresses on the VLAN or VRRP interface one at a time, starting with the primary address and continuing with each secondary address.

By default, Smart Relay is disabled.

Note:

This parameter is optional and applies only to a VLAN interface.