Configure DHCP Parameters Globally

Before you begin

  • Configure an IP address on the interface to be used as the DHCP relay interface.

  • If the agent IP address (the first <A.B.C.D> variable) is a VLAN or port IP address, you must enable DHCP Relay on that VLAN or port by running ip dhcp-relay within the VLAN context. However, if the first <A.B.C.D> variable is a VRRP address, you do not need to enable DHCP Relay on the VLAN or port in which the VRRP address resides.

About this task

Configure DHCP relay parameters for the port or the VLAN.

Procedure

  1. Enter Global Configuration mode:

    enable

    configure terminal

  2. Create the forwarding path from the client to the server:

    ip dhcp-relay fwd-path <A.B.C.D> <A.B.C.D>

  3. Enable the forwarding path from the client to the server:

    ip dhcp-relay fwd-path <A.B.C.D> <A.B.C.D> enable

    Note

    Note

  4. Optional: Modify DHCP mode to forward BOOTP messages only, DHCP messages only, or both:

    ip dhcp-relay fwd-path <A.B.C.D> <A.B.C.D> mode <bootp|bootp_dhcp|dhcp>

  5. Optional: Configure the forwarding path with source port 67 from client to the server.

    ip dhcp-relay fwd-path {A.B.C.D} {A.B.C.D} src-port-67

Example

Create the forwarding path from the client to the server. Enable the forwarding path from the client the server. Modify DHCP mode to forward both BOOTP and DHCP messages. Configure the forwarding path with source port 67 for BOOTP request.

Switch:1>enable
Switch:1#configure terminal
Switch:1(config)#ip dhcp-relay fwd-path 192.0.2.120 192.0.2.50
Switch:1(config)#ip dhcp-relay fwd-path 192.0.2.128 192.0.2.50 enable
Switch:1(config)#ip dhcp-relay fwd-path 192.0.2.128 192.0.2.50 mode bootp_dhcp
Switch:1(config)#ip dhcp-relay fwd-path 192.0.2.128 192.0.2.50 src-port-67

Variable Definitions

The following table defines parameters for the ip dhcp-relay fwd-path command.

Variable

Value

{A.B.C.D}

Configures the forwarding path from the client to the server.

The first{A.B.C.D} variable is the agent IP address configured on an interface (a locally configured IP address). You cannot specify a Secondary IP Interface address as the agent IP address in the forwarding path. To make DHCP aware of Secondary IP Interfaces, you must enable DHCP Smart Relay.

The second {A.B.C.D} variable is the IP address of the DHCP server in the network.

disable

Disables DHCP Relay globally.

enable

Enables DHCP Relay globally.

mode {bootp|bootp_dhcp|dhcp>

Modifies DHCP mode to forward BOOTP messages only, DHCP messages only, or both. The default is both.

src-port-67

Configures the UDP source port to 67 for BOOTP request. The default is 68.