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>

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.

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

Variable Definitions

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

Table 1. Variable definitions

Variable

Value

fwd-path <A.B.C.D> <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).

The second <A.B.C.D> variable is the IP address of the DHCP server in the network. If this IP address corresponds to the locally configured IP network, the DHCP packet is broadcast out from the interface.

fwd-path <A.B.C.D> <A.B.C.D> disable

Disables DHCP relaying on the path from the IP address to the server. This feature is disabled by default.

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

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

fwd-path <A.B.C.D> <A.B.C.D> enable

Enables DHCP relaying on the path from the IP address to the server.

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

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.

The second <A.B.C.D> variable is the IP address of the DHCP server in the network. If this IP address corresponds to the locally configured IP network, the DHCP packet is broadcast out from the interface.

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

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

The mode is {bootp | bootp_dhcp | dhcp}.