CLI Reference Guide-R07

Table Of Contents
Chapter 26
| DHCP Commands (IPv4 and IPv6)
DHCP Relay (IPv4 and IPv6)
– 636 –
address - IP address of DHCP server. (Range: 1-5 addresses)
Default Setting
None
Command Mode
Global Configuration, Interface Configuration (VLAN)
Usage Guidelines
DHCP relay service at the VLAN interface configuration level applies to DHCP
client requests received on the specified VLAN.
This command is used to configure DHCP relay for host devices attached to the
switch. If DHCP relay service is enabled, and this switch sees a DHCP client
request, it inserts its own IP address into the request so that the DHCP server
will know the subnet where the client is located. Then, the switch forwards the
packet to a DHCP server on another network. When the server receives the
DHCP request, it allocates a free IP address for the DHCP client from its defined
scope for the DHCP client’s subnet, and sends a DHCP response back to the
DHCP relay agent (i.e., this switch). This switch then passes the DHCP response
received from the server to the client.
You must specify the IP address for at least one active DHCP server. Otherwise,
the switchs DHCP relay agent will not be able to forward client requests to a
DHCP server. Up to five DHCP servers can be specified in order of preference.
If any of the specified DHCP server addresses are not located in the same
network segment with this switch, use the ip default-gateway or ipv6 default-
gateway command to specify the default router through which this switch can
reach other IP subnetworks.
To start DHCP relay service, enter the ip dhcp restart relay command.
Example
This example configures the switch to enable DHCP relay service for VLAN 1.
Console(config)#interface vlan 1
Console(config-if)#ip dhcp relay server 192.168.10.19
Console(config-if)#
Related Commands
ip dhcp restart relay (638)
ip dhcp l2 relay This command will enable the switch to operate as a Layer 2 Relay Agent.
SSyntax
ip dhcp l2 relay