Configure DHCP Parameters Globally

Before you begin

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

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

    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.

  4. 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}

The {A.B.C.D} variable is the agent IP address configured on an interface (a locally configured IP address).

{A.B.C.D}

The {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.