CCNA LAB

How to Configure Router as DHCP in Cisco Packet Tracer. Learn use of IP dhcp Command.

In this article, I will explain about How we can configure the router as DHCP Server. As you all know DHCP Server provides Ip addresses to all devices of the system in Network. So here will learn how a router can work as a DHCP server. So to perform this task we have assigned IP address to all devices. After this we have to create a DHCP POOL .A DHCP Pool is a virtual controller used to assigned IP to connected networks. It acts as a built-in Server. So to assign create a POOL for the network which we want to provide an IP address.

Look the below lab very carefully

Router as DHCP Server

Router as DHCP Server

In this lab R1 Router will act  as DHCP  and also other router will act as DHCP client. It means all devices will get automatic IP addresses from router R1. I’m performing this lab with two routers along with one switch and 2 PCs each router. If you want to provide IP to the networks connected to Router (DHCP) then you have to create a Pool. For all networks which you want to provide IP through  DHCP router, we have to create a Pool. For example, In the above lab, I want to give to 2 networks that are 2.0.0.0 and 1.0.0.0, then I have created 2 pool here. In the same way, it will have 4 networks to give Ip then I will have to create 4 pools. Hopefully, you will understand this lab in a very easy way. Now Let’s start this lab –

 

Assign Appropriate IP to Router 1 Interfaces

Router(config)#interface FastEthernet0/0

Router(config-if)#ip add 2.0.0.1 255.0.0.0

Router(config-if)#exit

Router(config)#interface FastEthernet0/1

Router(config-if)#3.0.0.2 255.0.0.0

Router(config-if)#exit

Do Routing on Router

Router(config)#router rip

Router(config-router)#version 2

Router(config-router)#net 2.0.0.0

Router(config-router)#net 3.0.0.0

Router(config-router)#exit

Router(config)#exit

Create DHCP POOL for Networks

Router(config)#ip dhcp pool net1 ( net1 is the name of pool, you can also give it other names )

Router(dhcp-config)#net 2.0.0.0  255.0.0.0

Router(dhcp-config)#default-router 2.0.0.1 

(default-gateway of the same network)

Router(dhcp-config)#dns-server .................

( IF you have DNS Server then Put IP of DNS Server)

Router(dhcp-config)#ip dhcp excluded address 2.0.0.1  2.0.0.10 

 (If you want to reserve some IP addresses for future then use this command)

Router(dhcp-config)#exit

Router(config)#

Do same for 2nd Network but Pool name must be different

Router(config)#ip dhcp pool net2 

Router(dhcp-config)#net 1.0.0.0  255.0.0.0

Router(dhcp-config)#default-router 1.0.0.1 

Router(dhcp-config)#dns-server .................

Router(dhcp-config)#ip dhcp excluded address 1.0.0.1  2.0.0.10 

Router(dhcp-config)#exit

Router(config)#

Assign IP to Router 0 Interfaces

Router(config)#interface FastEthernet0/0

Router(config-if)#ip add 1.0.0.1 255.0.0.0

Router(config-if)#exit

Router(config)#interface FastEthernet0/1

Router(config-if)#3.0.0.1 255.0.0.0

Router(config-if)#exit

Do Routing on Router

Router(config)#router rip

Router(config-router)#version 2

Router(config-router)#net 1.0.0.0

Router(config-router)#net 3.0.0.0

Router(config-router)#exit

Router(config)#exit

How to use IP Helper-address Command

On Router 0

Router(config)#interface FastEthernet0/0 

Router(config-if)#ip helper-address 3.0.0.1

Now check in PC IP configuration –

Router as DHCP Server

IP Configuration on PC

On Router 1

Router(config)#interface FastEthernet0/0

Router(config-if)#ip helper-address 1.0.0.1

Now check in PC IP configuration –

Router as DHCP Server

PC IP Configuration

 

This article is all about how a router can work as DHCP. All Beginners can learn this lab in a very easy method. Each step is clearly explained. If still, you have any problem or query in performing this lab please contact me. I will get back to you as soon as possible.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s