CLI Reference Guide-R07

Table Of Contents
Chapter 26
| DHCP Commands (IPv4 and IPv6)
DHCP Relay (IPv4 and IPv6)
– 637 –
Default Setting
Enabled
Command Mode
Global Configuration
Command Usage
When the DHCP client and the DHCP server are located on the same subnets,
an intermediate DHCP relay agent must be enabled to function in layer 2 mode.
You must specify the IP address for at least one active DHCP server. Otherwise,
the switch's DHCP relay agent will not be able to forward client requests to a
DHCP server.
Use the command “ip dhcp relay information option” to specify to send Option
82 information or not.
Example
In the following example, the switch’s DHCP Relay Agent is configured to operate as
a Layer 2 Relay Agent.
Console(config)#ip dhcp l2 relay
Console(config)#
ip dhcp l3 relay This command will enable the switch to operate as a Layer 3 Relay Agent.
Syntax
ip dhcp l3 relay
Default Setting
Disabled
Command Mode
Privileged Exec
Command Usage
When the DHCP client and the DHCP server are located on different subnets, an
intermediate DHCP relay agent must be enabled to function in layer 3 mode. In
layer 3 mode the switch is able to route traffic towards the server’s subnet from
the DHCP client subnet.
If DHCP relay is enabled, and this switch receives a DHCP request broadcast, it
inserts its own IP address into the request so that the DHCP server will know
the subnet where the client is located. Subsequently, the switch forwards the
packet to the DHCP server. When the server receives the DHCP request, it
allocates a free IP address for the DHCP client from its defined scope for the