How to configure static routing with each router acting as DHCP server

This article is all about how to configure static routing on routers with each router acting as DHCP server. In the previous article, we will learn about how to configure ssh on a cisco switch. Now in this article, we will learn about tricky static routing with each router acting as DHCP server.

In the previous posts, we will learn about static routing configuration on cisco routers but in that, the configuration we give the IP address to all the PCs by the static method. Now in this post, we will make all the routers as DHCP server and give IPs to all the PCs through the dynamic method. So let’s start here how to configure static routing with each router acting as DHCP server.

Now to understand this configuration we take a lab in cisco packet tracer. In this lab, we take three routers and six PCs and three switches.

static routing with each router act as DHCP router

First of all, we provide IP address to all the interfaces of the routers and up all the ports using no shut command. After that, we create DHCP pool on all the routers to provide IP address to all the PC. Now use given below steps to configure routers.

Now to provide IP address to all the interfaces of the routers use given  below commands

For 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/1

R1(config-if)#ip address 1.0.0.1 255.0.0.0

R1(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

R1(config-if)#exit

R1(config)#interface FastEthernet0/0

R1(config-if)#ip address 2.0.0.1 255.0.0.0

R1(config-if)#no shutdown

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

R1(config-if)#exit

 

Now for 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 2.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 4.0.0.1 255.0.0.0

R2(config-if)#no shutdown

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

R2(config-if)#exit

R2(config)#interface Ethernet0/0/0

R2(config-if)#ip address 3.0.0.1 255.0.0.0

R2(config-if)#no shutdown

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

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

R2(config-if)#exit

 

Now for router R3

— 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 R3

R3(config)#interface FastEthernet0/0

R3(config-if)#ip address 4.0.0.2 255.0.0.0

R3(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

R3(config-if)#exit

R3(config)#interface FastEthernet0/1

R3(config-if)#ip address 5.0.0.1 255.0.0.0

R3(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

R3(config-if)#exit

 

Now to create DHCP pool on the router use given below command

For router R1

R1>enable

R1#configure terminal

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

 

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

 

For router R2

R2>enable

R2#configure terminal

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

R2(config)#ip dhcp pool hemendra

 

R2(dhcp-config)#network 3.0.0.0 255.0.0.0

R2(dhcp-config)#default-router 3.0.0.1

R2(dhcp-config)#exit

 

For router R3

R3>enable

R3#configure terminal

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

R3(config)#ip dhcp pool deepit

R3(dhcp-config)#network 5.0.0.0 255.0.0.0

R3(dhcp-config)#default-router 5.0.0.1

R3(dhcp-config)#exit

 

Now to configure static routing on routers use given below commands

For router R1

R1(config)#ip route 3.0.0.0 255.0.0.0 2.0.0.2

R1(config)#ip route 4.0.0.0 255.0.0.0 2.0.0.2

R1(config)#ip route 5.0.0.0 255.0.0.0 4.0.0.2

 

For router R2

R2(config)#ip route 1.0.0.0 255.0.0.0 2.0.0.1

R2(config)#ip route 5.0.0.0 255.0.0.0 4.0.0.2

 

For router R3

R3(config)#ip route 3.0.0.0 255.0.0.0 4.0.0.1

R3(config)#ip route 2.0.0.0 255.0.0.0 4.0.0.1

R3(config)#ip route 1.0.0.0 255.0.0.0 2.0.0.1

Now all the configuration takes place now given the IP address to all the PCs using the dynamic method and ping them to test whether they are communicating with each other or not. If you have queries regarding this feel free to ask using the comment section and also provide feedback to us because your feedback is valuable for us.

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