DEV Community

Khalif AL Mahmud
Khalif AL Mahmud

Posted on

Lab Task 6 - How I Built a Multi-Router DHCP Network in GNS3 with RIP Routing

There's something satisfying about watching a PC automatically grab an IP address from a DHCP server you configured yourself. No typing. No guessing. The router just hands it over.

In this post, I'll walk through how I set up a two-router GNS3 topology where four virtual PCs get their IP addresses via DHCP — across two different subnets, connected through RIP routing. Everything was done inside GNS3 using Cisco IOS routers and VPCS nodes.

By the end, PC1 (on the 192.168.0.0/24 network) was successfully pinging PC4 (on the 192.168.1.0/24 network). That cross-subnet ping only works when routing, DHCP, and IP addressing are all wired together correctly.


The Problem

Running DHCP across a single subnet is straightforward. But what happens when you have two separate LANs connected by routers — and you want DHCP to work on both sides?

You need:

  • Each router to serve as a DHCP server for its own local subnet
  • Routing configured between routers so packets can actually travel between subnets
  • Router interfaces manually assigned static IPs (DHCP is for end devices only)

That's exactly what this topology covers.


Topology Overview

  • R1 serves DHCP for the 192.168.0.0/24 subnet (PC1 and PC2)
  • R2 serves DHCP for the 192.168.1.0/24 subnet (PC3 and PC4)
  • RIP is used to share routing information between R1 and R2
  • All router interfaces are manually configured (No DHCP on router ports)

Step 1 — Configure R1 Interfaces

Open R1's console and assign static IPs to both interfaces.

R1> enable
R1# configure terminal

R1(config)# interface fa0/0
R1(config-if)# ip address 192.168.0.1 255.255.255.0
R1(config-if)# no shutdown

R1(config)# interface fa2/0
R1(config-if)# ip address 192.168.2.1 255.255.255.0
R1(config-if)# no shutdown

R1(config)# end
Enter fullscreen mode Exit fullscreen mode


Step 2 — Configure R2 Interfaces

Same process on R2, but with its own IP addresses.

R2> enable
R2# configure terminal

R2(config)# interface fa0/0
R2(config-if)# ip address 192.168.2.2 255.255.255.0
R2(config-if)# no shutdown

R2(config)# interface fa2/0
R2(config-if)# ip address 192.168.1.1 255.255.255.0
R2(config-if)# no shutdown

R2(config)# end
Enter fullscreen mode Exit fullscreen mode


Step 3 — Configure RIP on R1

RIP version 2 tells R1 to advertise its connected networks so R2 knows how to reach 192.168.0.0/24.

R1(config)# router rip
R1(config-router)# version 2
R1(config-router)# network 192.168.0.0
R1(config-router)# network 192.168.2.0
R1(config-router)# no auto-summary
R1(config-router)# exit
Enter fullscreen mode Exit fullscreen mode


Step 4 — Configure RIP on R2

R2(config)# router rip
R2(config-router)# version 2
R2(config-router)# network 192.168.1.0
R2(config-router)# network 192.168.2.0
R2(config-router)# no auto-summary
R2(config-router)# exit
Enter fullscreen mode Exit fullscreen mode


Step 5 — Verify Routing Tables

After RIP converges (usually within 30–60 seconds), check the routing tables. You should see RIP-learned routes marked with R.

On R1:

R1# show ip route
Enter fullscreen mode Exit fullscreen mode

Expected output includes:

R    192.168.1.0/24 [120/1] via 192.168.2.2, FastEthernet2/0
C    192.168.0.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet2/0
Enter fullscreen mode Exit fullscreen mode

On R2:

R2# show ip route
Enter fullscreen mode Exit fullscreen mode

Expected output includes:

R    192.168.0.0/24 [120/1] via 192.168.2.1, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet2/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
Enter fullscreen mode Exit fullscreen mode


Step 6 — Configure DHCP on R1

R1 will hand out IPs in the 192.168.0.0/24 range to PC1 and PC2.

R1(config)# ip dhcp pool SUBNET1
R1(dhcp-config)# network 192.168.0.0 255.255.255.0
R1(dhcp-config)# default-router 192.168.0.1
R1(dhcp-config)# dns-server 8.8.8.8
R1(dhcp-config)# exit

R1(config)# ip dhcp excluded-address 192.168.0.1
Enter fullscreen mode Exit fullscreen mode


Step 7 — Configure DHCP on R2

R2 handles DHCP for PC3 and PC4 on the 192.168.1.0/24 subnet.

R2(config)# ip dhcp pool SUBNET2
R2(dhcp-config)# network 192.168.1.0 255.255.255.0
R2(dhcp-config)# default-router 192.168.1.1
R2(dhcp-config)# dns-server 8.8.8.8
R2(dhcp-config)# exit

R2(config)# ip dhcp excluded-address 192.168.1.1
Enter fullscreen mode Exit fullscreen mode


Step 8 — Configure PCs to Use DHCP

In GNS3, each VPCS node just needs a single command to request an IP via DHCP.

PC1:

PC1> ip dhcp
Enter fullscreen mode Exit fullscreen mode

PC2:

PC2> ip dhcp
Enter fullscreen mode Exit fullscreen mode

PC3:

PC3> ip dhcp
Enter fullscreen mode Exit fullscreen mode

PC4:

PC4> ip dhcp
Enter fullscreen mode Exit fullscreen mode

Each PC should respond with something like:

DDORA IP 192.168.0.2/24 GW 192.168.0.1
Enter fullscreen mode Exit fullscreen mode

The DDORA output means the full DHCP handshake completed: Discover → Discover (server) → Offer → Request → Acknowledge.


Step 9 — Verify DHCP Bindings

Run this on both routers to confirm which MAC addresses received which IPs.

R1# show ip dhcp binding
R2# show ip dhcp binding
Enter fullscreen mode Exit fullscreen mode

You should see entries for the PCs that requested IPs, with their assigned addresses and lease times.


Step 10 — Check Interface Summary

R1# show ip int br
R2# show ip int br
Enter fullscreen mode Exit fullscreen mode

All interfaces used in the topology should show up/up.


Step 11 — Ping Tests

Ping PC4 from PC1 (cross-subnet ping — this is the real test):

PC1> ping 192.168.1.3
Enter fullscreen mode Exit fullscreen mode

Expected result:

84 bytes from 192.168.1.3 icmp_seq=3 ttl=62 time=60.528 ms
84 bytes from 192.168.1.3 icmp_seq=4 ttl=62 time=61.646 ms
84 bytes from 192.168.1.3 icmp_seq=5 ttl=62 time=61.215 ms
Enter fullscreen mode Exit fullscreen mode


Ping PC2 from PC3 (reverse direction):

PC3> ping 192.168.0.3
Enter fullscreen mode Exit fullscreen mode

Expected result:

84 bytes from 192.168.0.3 icmp_seq=3 ttl=62 time=61.733 ms
84 bytes from 192.168.0.3 icmp_seq=4 ttl=62 time=47.556 ms
84 bytes from 192.168.0.3 icmp_seq=5 ttl=62 time=62.207 ms
Enter fullscreen mode Exit fullscreen mode


How to Verify Everything is Working

Check Command What to Look For
Interface IPs assigned show ip int br All interfaces up/up
RIP routes learned show ip route R entries for remote subnets
DHCP leases issued show ip dhcp binding MAC-to-IP entries for all PCs
PCs got IPs ip dhcp on each VPCS DDORA IP x.x.x.x/24 response
Cross-subnet ping works ping <remote PC IP> Replies with TTL=62

What I Learned

Working through this lab made a few things click that I hadn't fully internalized before:

DHCP scope matters — The excluded-address command is easy to forget but important. Without it, the router could assign its own interface IP to a PC, causing an IP conflict.

RIP convergence takes time — If you configure DHCP and run ip dhcp on a PC before RIP finishes converging, pings will fail even though DHCP worked. Waiting 30–60 seconds after configuring RIP saves a lot of confusion.

TTL=62 tells a story — When pinging across two routers, the TTL drops by 1 per hop. Seeing TTL=62 (from a starting TTL of 64) confirms the packet traveled through exactly two routers.

DDORA is your confirmation — That output from VPCS after ip dhcp is the clearest sign that the entire DHCP process completed. If you only see D and it stops, your router's DHCP pool isn't reachable.

no auto-summary matters in RIP v2 — Without it, RIP summarizes subnets at classful boundaries. In a topology like this where all subnets share the 192.168.x.x space, it can cause routing issues.


Common Mistakes

Mistake What Happens Fix
Forgetting no shutdown on interfaces Interface stays down, no traffic passes Always follow IP assignment with no shutdown
Missing no auto-summary in RIP Remote subnets may not be reachable Add no auto-summary under router rip
Not excluding the gateway IP from DHCP pool Router's own IP could be assigned to a PC Use ip dhcp excluded-address for gateway IPs
Running ip dhcp on PCs before RIP converges Ping fails even though DHCP works Wait 30–60 seconds after RIP config
Wrong interface selected for DHCP pool PCs get wrong gateway or no IP Match default-router to the interface facing the PCs
Pinging by IP instead of using the actual assigned address Misleading results Always verify the assigned IP via ip dhcp response first

Conclusion

This topology covers a lot of ground for what looks like a simple setup. You're dealing with static interface addressing, DHCP pools on two separate subnets, dynamic routing with RIP, and cross-subnet connectivity — all in one lab.

The ping from PC1 to PC4 working end-to-end is a real confidence check. It means your routing table has the right entries, DHCP handed out the correct gateway, and packets are actually traveling the full path through both routers.

If you're building out GNS3 labs and want to go further, try replacing RIP with OSPF, or add a third router and see how the routing table changes.

Top comments (0)