DHCP Client on Cisco IOS

DHCP server is often used on Cisco IOS routers so you supply hosts with an IP address. We can also use DHCP client on our routers which is useful if your ISP uses dynamic IP addresses for customers.

In this lesson, we’ll take a look how to configure your router as DHCP client.

Configuration

This is the topology we will use:

Cisco IOS DHCP Client

Let’s start with the DHCP server.

DHCP Server

Let’s create a pool for our local subnet and include a default route:

Server(config)#ip dhcp pool MY_POOL
Server(dhcp-config)#network 192.168.1.0 /24
Server(dhcp-config)#default-router 192.168.1.254

That’s all we need, let’s look at the DHCP client now.

DHCP Client

You only need one command on the interface to use DHCP:

Client(config)#interface FastEthernet 0/0
Client(config-if)#ip address dhcp
Client(config-if)#no shutdown

After a few seconds you will see this:

Client#
%DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address 192.168.1.1, mask 255.255.255.0, hostname Client

Great so we got an IP address:

Client#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.1.1     YES DHCP   up                    up

The router also installs a default route:

We're Sorry, Full Content Access is for Members Only...

If you like to keep on reading, Become a Member Now! Here is why:

  • Learn any CCNA, CCNP and CCIE R&S Topic. Explained As Simple As Possible.
  • Try for Just $1. The Best Dollar You’ve Ever Spent on Your Cisco Career!
  • Full Access to our 799 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

584 Sign Ups in the last 30 days

satisfaction-guaranteed
100% Satisfaction Guaranteed!
You may cancel your monthly membership at any time.
No Questions Asked!

Tags: ,


Forum Replies

  1. Hi Rene,

    Not clear about the default static route when configuring Router as DHCP client. It will autometically installed in Routing table & why the AD value will be 254 ??Thanks for your so nice cooperation as always.

    br//
    zaman

  2. Mohammad,
    The Administrative Distance is so high because it is deemed to be the least reliable method of routing. With an AD of 254, a default route introduced by any routing protocol, or any default route manually entered, will take precedence. Think of the DHCP supplied default route as a “default route of last resort.”

  3. Awesome.
    It was my first configuration.
    i m very thankful to you.
    your explanation is amazing.

  4. The IOS I’m using in GNS3 does have the ip dhcp pool command. It unfortunately does not have the ip address dhcp command.

    It is probably a too old IOS ?

  5. Hello Maodo

    Hmmm that’s interesting. According to Cisco, the ip address dhcp command was added to the 12.1(2)T version of IOS. What IOS version are you using?

    Laz

9 more replies! Ask a question or join the discussion by visiting our Community Forum