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 662 Lessons. More Lessons Added Every Week!
  • Content created by Rene Molenaar (CCIE #41726)

525 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. 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 ?

  2. 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

  3. Hello Laz,

    I will have to add my 2 cents on this. I work with different Cisco devices everyday and sometime I will be supporting a supervisor linecard which doesn’t have ip add dhcp command feature on it regardless of their version. Also some cisco ASA don’t have this command

  4. Hi Lazaros,
    Does client act as a host computer or as a router?

  5. try the CCENT tomorrow morning and I made the test that you propose.

    at question 45, I had the choice between
    ip dhcp MYPOOL pool
    network 192.168.1.1 255.255.255.0

    and
    ip dhcp MYPOOL pool
    network 192.168.1.0 / 24

    as all IOS accept “network subnet subnet-mask” and only some recent bones accept “network subnet prefix-length”, I chose “network 192.168.1.1 255.255.255.0”
    but the answer of your test indicates as good answer “network 192.168.1.0 / 24”, alas!

    however, in packet tracer, “network 192.168.1.1 255.255.255.0” neither “network 192.168.1.10 255.255.255.0” no

    ... Continue reading in our forum

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