You are on page 1of 10

Dynamic Host Configuration Protocol (DHCP) is a network protocol that enables network

administrators to manage and automate IP configuration assignment. Without DHCP,


administrators must manually assign and configure IP addresses, subnet masks, default gateways,
and so on, which can, in larger environments, become an excessive administrative problem,
especially if devices are moved from one internal network to another.

In an enterprise environment, a DHCP server is usually a dedicated device ; whereas in smaller

deployments or some branch offices, it can be configured on a Cisco Catalyst switch 🔄 or a Cisco

router 🌐.

This section covers the following topics:

Explain the idea behind DHCP

Configure a DHCP server

Configure manual DHCP bindings

Configure a DHCP relay

Configure DHCP options

As defined in RFC 2131, DHCP provides configuration parameters to Internet hosts.


DHCP consists of two components: a protocol for delivering host-specific
configuration parameters from a DHCP server to a host, and a mechanism for
allocating network addresses to hosts. DHCP is built on a client/server model in
which designated DHCP server hosts allocate network addresses and deliver
configuration parameters to dynamically configured hosts. Clients in access VLANs
need DHCP services, and not only external servers but also routers can be used for
DHCP services. By default, Cisco multilayer switches running Cisco IOS Software

include DHCP server and relay agent software.


DHCP Implementation in Campus Enviroment

Distribution multilayer switches often act as Layer 3 gateways for clients connecting
to the access switches on various VLANs. Therefore, the DHCP service can be
provided directly by the distribution switches, Alternatively, DHCP services can be
concentrated in an external, dedicated DHCP server In that case, distribution
switches need to redirect the incoming clients’ DHCP requests to the external DHCP

server. 🔄🌐

🔄🌐
Activate to view larger image,

Configuring DHCP in Multilayer Switched Network

This section provides the configuration steps for the DHCP setup using the

topology . In addition, it configures a manual binding for one of the DHCP clients.
Activate to view larger image,
Activate to view larger image,

Step 1. Access DSW1. Configure a DHCP server for VLAN 10 devices. Only after the
switch has a Layer 3 address, which is preconfigured in this example, can you
configure a DHCP server on the switch. The switch acting as a DHCP server will
intercept broadcast packets from client machines within a VLAN:
Activate to view larger image,

On DSW1, verify the configured DHCP pool using the show ip dhcp pool command:
Activate to view larger image,
🔍🔧 Step 3. Enable DHCP packet debugging on DSW1:
Activate to view larger image,

Step 4. Configure PC1 interface Ethernet 0/0 to acquire an IP address via DHCP and
observe command-line interface (CLI) output on DSW1. The port on SW1 to which
PC1 is connected to is already assigned to VLAN 10, so PC1 will get an IP from VLAN
10 subnet:

As soon as you enable the interface on PC1, it will send a broadcast, requesting an IP.

📡🔄
Activate to view larger image,

The preceding debug shows you the whole DHCP negotiation process.
Activate to view larger image,
🔄📡 In the DHCP process:

Client's Request:

The client sends a DHCPDISCOVER broadcast message to locate a Cisco IOS DHCP server. 📡📢

Server's Offer:

A DHCP server responds with a DHCPOFFER unicast message, offering configuration parameters

like an IP address, a domain name, and a lease for the IP address.

👥 Client's Acceptance:

The DHCP client may receive offers from multiple DHCP servers and can accept any one of the
offers, usually accepting the first offer it receives. The offer is not a guarantee, but the server

reserves the address until the client formally requests it. 🔄📬

🔗 Formal Request and Confirmation:

The client returns a DHCPREQUEST broadcast message as a formal request for the offered IP

address. The DHCP server confirms the allocation with a DHCPACK unicast message. 🔄🤝

🌐 Additional DHCP Messages displayed with debug output:


DHCPDECLINE:

Message sent from the client to the server indicating that the address is already in use. 🚫📢

DHCPNAK:

The server sends a refusal to the client for a request for configuration. 🚫🤝

DHCPRELEASE:

Client informs the server that it is giving up a lease. 🔄🤲

DHCPINFORM:

A client with an existing IP address requests additional configuration parameters, such as DNS

address, from the DHCP server. 🔄📊

🔄🔧 Step 5. Configure PC2 and PC3 to obtain IP addresses through DHCP:


Activate to view larger image,

🔍📊 Step 6. On DSW1, investigate the DHCP binding table:


Activate to view larger image,
👀🔍 Notice that the DHCP server leased three IP addresses.

👉📊 You could also verify that the three clients acquired IP addresses by issuing the
show ip interface brief command on each client.

📝 Note:
Sometimes a manually assigned IP address is preferred. For example, it is beneficial
for the servers to have an IP address that does not change.

🔄🔢 Because you are using DHCP and assigning all IP addresses from a central point, it
would be nice if you could also assign a specific address to a specific device. And you
can do that with DHCP as well.

🔄🔍 Step 7. Find out PC3’s client identifier.


When a Cisco router sends a DHCP Discover message, it will include a client identifier
to uniquely identify the device. You can use this value to configure a static binding:
🚫👍 If you do not like this long client identifier, you can also assign PC3 to use the MAC
address as the client identifier. You can do so by using the ip address dhcp client-id
ethernet 0/0 command.

🔄🔒 Step 8. On DSW1, clear the IP DHCP binding table.


If you already have a binding for a client and you want to manually set its IP address,
you have to clear the DHCP binding table:
…see more
Activate to view larger image,

Configuring a DHCP Relay

As you know, DHCP is a client/server application, in which the DHCP client, usually a desktop
computer, contacts a DHCP server for configuration parameters using a broadcast request.
Today’s enterprise multilayer switched networks use centralized DHCP server services with other
centralized services like Network Time Protocol (NTP) and monitoring tools. Because broadcast is
not forwarded across the VLAN boundaries, to forward the DHCP broadcast, the router needs to
use the DHCP relay agent feature where a switch is configured with the DHCP relay agent using
the IP helper-address command to forward the broadcast traffic in the directed unicast to the

server. 🔄🌐

Configuring a DHCP RelayAs you know, DHCP is a client/server application, in which


the DHCP client, usually a desktop computer, contacts a DHCP server for
configuration parameters using a broadcast request. Today’s enterprise multilayer
switched networks use centralized DHCP server services with other centralized
services like Network Time Protocol (NTP) and monitoring tools. Because broadcast is
not forwarded across the VLAN boundaries, to forward the DHCP broadcast, the
router needs to use the DHCP relay agent feature where a switch is configured with
the DHCP relay agent using the IP helper-address command to forward the

broadcast traffic in the directed unicast to the server. 🔄🌐


Activate to view larger image,

You might also like