Configuring DHCP relay on a port or VLAN

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

Before you begin

  • You must configure IP 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

Example

Switch:1> enable
Switch:1# configure terminal
Switch:1(config)# interface gigabitethernet 1/10 

Enable DHCP parameters on a specified port or VLAN:

Switch:1(config-if)# ip dhcp-relay

Variable definitions

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

Use the no operator to disable DHCP parameters on specified ports: no ip dhcp-relay.

Note

Note

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

To configure this option to the default value, use the default operator with this command.

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. Use the no operator to disable broadcast: no ip dhcp-relay broadcast.

To configure this option to the default value, use the default operator with this command.

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.

Use the no operator to delete a forward path server with a specific value and virtual router ID: no ip dhcp-relay fwd-path <A.B.C.D> [vrid <1-255>]

To configure this option to the default value, use the default operator with this command.

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) and is an integer from 1 to 255.

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 in the form a.b.c.d.

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

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 in the form a.b.c.d.

mode is a choice of bootp, dhcp, or bootp_dhcp.

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

To configure this option to the default value, use the default operator with this command.

max-hop <1-16>

Configures the maximum number of hops before a BootP/DHCP packet is discarded (1 to 16). The default is 4.

To configure this option to the default value, use the default operator with this command.

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 (0 to 65535). The default is 0 seconds.

To configure this option to the default value, use the default operator with this command.

mode <bootp|bootp_dhcp|dhcp>

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

To configure this option to the default value, use the default operator with this command.

remoteId

Enables Option82 remote ID on the interface.

trusted

Configures the DHCP circuit as trusted.