How to configure a Cisco router as a DHCP client and also assign IP address to it.


This article is all about how to configure a cisco router as a DHCP client and assign an IP address to it. In the previous articles, we learn that how to configure a single router as a DHCP server and we also learn that how to configure 4 and more than 4 DHCP server on a single router. Now in this tutorial, we learn that how to configure a cisco router as aDHCP client and also assign IP address to it. To explain this process in detail we take a lab in Cisco packet tracer in which we take two cisco routers and joined them together with ethernet cable and then we configure a router as a DHCP server and we configure remaining router as a DHCP client and then provide IP address to it by router which is configured as a DHCP server. So let’s start here

Now here we take a Cisco packet tracer lab to perform this configuration successfully.

router as a dhcp client

In above lab, we clearly saw that two routers were present there R1 and R2.

Now in this lab, I configure the R1 router as a DHCP server and remaining router R2 as aDHCP client and then provide IP address to them by router R1 which act as a DHCP server. So let’s start to configure router R1

For router R1 use given blow commands to configure router as a DHCP server

— System Configuration Dialog —

Continue with configuration dialog? [yes/no]: no

Press RETURN to get started!

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R1

R1(config)#int fa0/0

R1(config-if)#ip address 1.0.0.1 255.0.0.0

R1(config-if)#no shut

R1(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

R1(config-if)#exit

R1(config)#ip dhcp pool rahul

R1(dhcp-config)#network 1.0.0.0 255.0.0.0

 

R1(dhcp-config)#default-router 1.0.0.1

R1(dhcp-config)#exit

Now our router R1 will be configured as a DHCP server and now we go to router R2 and configure R2 as a DHCP client.

 

For router R2 as a DHCP client use given below commands

— System Configuration Dialog —

Continue with configuration dialog? [yes/no]: no

Press RETURN to get started!

Router>enable

Router#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#hostname R2

R2(config)#int fa0/0

R2(config-if)#no shut

R2(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

R2(config-if)#ip address dhcp

%DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address 1.0.0.2, mask 255.0.0.0, hostname Router1

R2(config-if)#exit

Here we use ip address dhcp command for automatically assign an IP address on router R2 on interface fa0/0

NOTE: – Ip address dhcp command will assign IP on the interface on which you will run this command and it will ask for an IP from DHCP server. Here in our this lab DHCP server is router R1. But if you do not want to make a DHCP server on your router then you can also use a dedicated machine as a DHCP server instead of a router as a DHCP server. This command is work in both the cases.

 

Now test router R2 interface whether it is got an IP address on not by given below command

R2>enable

R2#show interface fa0/0

FastEthernet0/0 is up, line protocol is up (connected)

Hardware is Lance, address is 0006.2a2c.b501 (bia 0006.2a2c.b501)

Internet address is 1.0.0.2/8

MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,

reliability 255/255, txload 1/255, rxload 1/255

Encapsulation ARPA, loopback not set

ARP type: ARPA, ARP Timeout 04:00:00,

Last input 00:00:08, output 00:00:05, output hang never

Last clearing of “show interface” counters never

Input queue: 0/75/0 (size/max/drops); Total output drops: 0

Queueing strategy: fifo

Output queue :0/40 (size/max)

5 minute input rate 0 bits/sec, 0 packets/sec

5 minute output rate 0 bits/sec, 0 packets/sec

2 packets input, 186 bytes, 0 no buffer

Received 2 broadcasts, 0 runts, 0 giants, 0 throttles

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

0 input packets with dribble condition detected

2 packets output, 178 bytes, 0 underruns

0 output errors, 0 collisions, 1 interface resets

0 babbles, 0 late collision, 0 deferred

0 lost carrier, 0 no carrier

0 output buffer failures, 0 output buffers swapped out

THAT’S IT

If you have any queries related to this feel free to ask through the comment section. If you have any new ideas regarding this topic share through the comment section.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s