How to configure router to work as DHCP server for machines connected with different router?

CCNA

This article is all about How to configure a router to work as DHCP server for machines like a printer and any other device connected to the different router. In the previous article, we will learn that how to configure a router as a DHCP server and another router will be configured as a DHCP client and provide IP address to the DHCP client by the DHCP server. So now to learn in detail about this configuration we take a lab in cisco packet tracer and then configure a router as a DHCP client and provide Ip addresses to the machines which connected to another router.

Now we take a lab in cisco packet tracer on your system. In this lab, we take two routers two switches and four PCs. Now I am configured router R1 as DHCP server for machines like PCs which is connected to router R2. Means I configured router R1 such that it can automatically assign an IP address to PCs which connected to router R2 and also in different networks. So let’s start here configuration.

dhcp configuration

If you don’t know how to make router as a DHCP server then you can also read this

Now use below-given codes to make your router R1 as a DHCP server and also assign an IP address to all its interfaces of router R1
— 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)#interface FastEthernet0/0
R1(config-if)#ip address 10.0.0.1 255.0.0.0
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

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

R1(config-if)#exit
R1(config)#interface FastEthernet0/1
R1(config-if)#ip address 20.0.0.1 255.0.0.0
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

R1(config-if)#exit

R1(config-if)#ip route 30.0.0.0 255.0.0.0 20.0.0.2
R1(config)#ip dhcp pool satish
R1(dhcp-config)#network 10.0.0.0 255.0.0.0
R1(dhcp-config)#default-router 10.0.0.1
R1(dhcp-config)#exit
R1(config)#ip dhcp pool rahul
R1(dhcp-config)#network 30.0.0.0 255.0.0.0
R1(dhcp-config)#default-router 30.0.0.1
R1(dhcp-config)#exit

Now use these codes to assign IP address to all the interfaces and tell path to router R2 so that it knew where it have to IP address to all the Pcs which is connected to router R2

— 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)#interface FastEthernet0/0

R2(config-if)#ip address 20.0.0.2 255.0.0.0

R2(config-if)#no shutdown

%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)#exit

 

R2(config)#interface FastEthernet0/1

R2(config-if)#ip address 30.0.0.1 255.0.0.0

R2(config-if)#no shutdown

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

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

R2(config-if)#exit

R2(config)#ip route 10.0.0.0 255.0.0.0 2.0.0.1

R2(config)#int fa0/1

R2(config-if)#ip helper-address 20.0.0.1

R2(config-if)#exit

Now after that simply go to PC which is directly connected to the router R2 and change IP configuration from static to DHCP and saw that your PC get IP address automatically from the router R1

THAT’S IT

If you have any queries about this then it can be solved through the comment box. Where you can ask your doubt regarding post.

Your thoughts about this?

This site uses Akismet to reduce spam. Learn how your comment data is processed.