DEV Community

Khalif AL Mahmud
Khalif AL Mahmud

Posted on

Lab Task 2 - How I Built a Multi-Router Static Routing Network from Scratch Using GNS-3

I'd been reading about routing protocols for a while — how packets find their way across networks, how routers decide where to forward traffic. At some point, reading stops being enough. You have to actually build something and watch it break (and then fix it) before any of it really sticks.

So I set up a three-router network in GNS-3, configured everything manually with static routes, and got three PCs on completely different subnets talking to each other. This post walks through exactly how I did it — the commands, the mistakes, and what each step actually means.


The Problem

Dynamic routing protocols like OSPF or EIGRP handle route discovery automatically. But before any of that makes sense, you need to understand what they're actually automating. Static routing forces you to think manually: "If a packet is headed for this network, which next-hop should it go through?"

The goal here was simple: build a network where PC1, PC2, and PC3 — each sitting on a different subnet — can reach each other. No dynamic protocols. Every route added by hand.


Network Topology

Here's how the network is laid out:

Device Interface IP Address Network
R1 Fa3/0 (→ PC1) 192.168.1.1 192.168.1.0/24
R1 Fa2/0 (→ R2) 192.168.0.1 192.168.0.0/24
R1 Fa0/0 (→ R3) 192.168.3.1 192.168.3.0/24
R2 Fa2/0 (→ PC2) 192.168.2.1 192.168.2.0/24
R2 Fa0/0 (→ R1) 192.168.0.2 192.168.0.0/24
R3 Fa2/0 (→ PC3) 192.168.4.1 192.168.4.0/24
R3 Fa0/0 (→ R1) 192.168.3.2 192.168.3.0/24
PC1 eth0 192.168.1.2 GW: 192.168.1.1
PC2 eth0 192.168.2.2 GW: 192.168.2.1
PC3 eth0 192.168.4.2 GW: 192.168.4.1

The backbone between routers uses the 192.168.0.0/24 and 192.168.3.0/24 networks. Each PC sits on its own /24 subnet.


Step-by-Step Configuration

Step 1 — Configure R3's LAN Interface (Fa2/0 → PC3)


R3#enable
R3#configure terminal
R3(config)#interface fastEthernet2/0
R3(config-if)#ip address 192.168.4.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#end
R3#write memory
Enter fullscreen mode Exit fullscreen mode

After this, show ip interface brief should show FastEthernet2/0 as up/up with IP 192.168.4.1. If it still shows administratively down, the no shutdown didn't take — go back into interface config and run it again.


Step 2 — Configure PC3

In GNS-3's VPCS (Virtual PC Simulator):

PC3> ip 192.168.4.2 255.255.255.0 192.168.4.1
PC3> save
Enter fullscreen mode Exit fullscreen mode

The format is: ip [address] [subnet mask] [default gateway]


Step 3 — Verify Local Connectivity (PC3 ↔ R3)


PC3> ping 192.168.4.1
Enter fullscreen mode Exit fullscreen mode

Before touching static routes across routers, always verify the local link works first. If this ping fails, there's no point moving forward — fix the local connection first.


Step 4 — Configure R1's Interfaces

R1 needs three interfaces configured — one facing PC1, one toward R2, and one toward R3:

R1#enable
R1#configure terminal

R1(config)#interface fastEthernet3/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit

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

R1(config)#interface fastEthernet0/0
R1(config-if)#ip address 192.168.3.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#exit

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

Step 5 — Configure PC1 & Ping to R1


PC1> ip 192.168.1.2 255.255.255.0 192.168.1.1
PC1> save
PC1> ping 192.168.1.1
Enter fullscreen mode Exit fullscreen mode

Step 6 — Configure R2's Interfaces


R2#enable
R2#configure terminal

R2(config)#interface fastEthernet2/0
R2(config-if)#ip address 192.168.2.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit

R2(config)#interface fastEthernet0/0
R2(config-if)#ip address 192.168.0.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit

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

Step 7 — Configure PC2 & Ping R2


PC2> ip 192.168.2.2 255.255.255.0 192.168.2.1
PC2> save
PC2> ping 192.168.2.1
Enter fullscreen mode Exit fullscreen mode

Step 8 — Add Static Routes on R1

This is where the actual routing happens. R1 needs to know how to reach PC2's subnet (via R2) and PC3's subnet (via R3):

R1#enable
R1#configure terminal
R1(config)#ip route 192.168.2.0 255.255.255.0 192.168.0.2
R1(config)#ip route 192.168.4.0 255.255.255.0 192.168.3.2
R1(config)#end
R1#write memory
Enter fullscreen mode Exit fullscreen mode

Breaking this down:

  • ip route 192.168.2.0 255.255.255.0 192.168.0.2 — "To reach the 192.168.2.0/24 network (where PC2 lives), send traffic to 192.168.0.2 (R2's interface)"
  • ip route 192.168.4.0 255.255.255.0 192.168.3.2 — "To reach the 192.168.4.0/24 network (where PC3 lives), send traffic to 192.168.3.2 (R3's interface)"

Step 9 — Add Static Routes on R2

R2 needs routes back to PC1's subnet and PC3's subnet — both via R1:

R2#enable
R2#configure terminal
R2(config)#ip route 192.168.1.0 255.255.255.0 192.168.0.1
R2(config)#ip route 192.168.4.0 255.255.255.0 192.168.0.1
R2(config)#end
R2#write memory
Enter fullscreen mode Exit fullscreen mode

Step 10 — Add Static Routes on R3

R3 needs routes to PC1's subnet and PC2's subnet — both going back through R1:

R3#enable
R3#configure terminal
R3(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1
R3(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.1
R3(config)#end
R3#write memory
Enter fullscreen mode Exit fullscreen mode

Step 11 — Verify End-to-End Connectivity


PC3> ping 192.168.1.2
PC3> ping 192.168.2.2
Enter fullscreen mode Exit fullscreen mode


PC2> ping 192.168.4.2
Enter fullscreen mode Exit fullscreen mode

When these succeed, the static routing is working correctly. Packets are traversing multiple routers across completely different subnets.


How to Verify Your Routing Table

At any point, check what routes a router knows about:

R1#show ip route
Enter fullscreen mode Exit fullscreen mode

You'll see entries marked with S (static) for the routes you added manually, and C (connected) for directly connected networks. If a destination network doesn't appear here, the router will drop packets destined for it.

R1#show ip interface brief
Enter fullscreen mode Exit fullscreen mode

This gives a quick overview of which interfaces are up/up vs administratively down.


What I Learned

Routing is about perspective. Each router only cares about its own routing table. R2 doesn't care what routes R3 has — it only needs to know how to forward packets it receives. When debugging, check each router's table independently.

The return path matters as much as the forward path. A ping failing doesn't always mean the outgoing packet didn't arrive. The reply might be getting dropped because the remote router has no route back. When something doesn't work, trace both directions.

Local connectivity first, always. Before testing cross-router pings, verify that each PC can reach its own gateway. It saves a lot of confusion when troubleshooting.

write memory saves your sanity. GNS-3 doesn't always persist configs between sessions. Running write memory after each router's configuration means you don't have to redo everything if something crashes.


Common Mistakes

Mistake What happens Fix
Forgetting no shutdown Interface stays administratively down Go back into interface fastEthernetX/X and run no shutdown
Wrong next-hop IP Route exists but traffic goes nowhere Check show ip route and verify the next-hop is reachable
Missing return route Ping sends but never replies Add static routes on the destination router pointing back
VPCS .0 address "Invalid host address" error Network addresses can't be assigned to hosts — use .1, .2, etc.
Not saving config Config lost on restart Always run write memory after configuring

Conclusion

Static routing is one of those things that seems straightforward on paper but teaches you a lot when you actually build it. You start thinking about packets differently — not as abstract data, but as something that has to travel hop by hop, and every router along the way needs to know where to send it next.

Once this clicked, dynamic routing protocols made much more sense. OSPF isn't magic — it's just automating what we did here by hand.

If you're working through networking fundamentals, I'd strongly recommend building this topology yourself before moving on. The hands-on time is worth more than any amount of reading.

Top comments (0)