There is a point in every networking journey when reading about subnets stops being enough. You know the formulas, you can do the math on paper — but until you wire up a real (or virtual) topology and watch packets actually cross subnet boundaries, it doesn't fully click.
This post walks through exactly that. I took a single Class C address block (192.168.43.0/24), carved it into /30 and /28 subnets, built a three-router topology in GNS3 with six PCs across four switches, configured OSPF on every router, and verified end-to-end connectivity with ping tests. Everything is documented here — the subnet math, the router commands, the PC configs, and the verification steps.
The Problem: One Address Space, Multiple Isolated Networks
The starting point is a single IP block: 192.168.43.0/24. The goal is to divide it into smaller subnets that serve different parts of the topology.
From the topology diagram:
- Two router-to-router links need
/30subnets (point-to-point, only 2 usable hosts needed) - Four LAN segments — each hosting a switch and PCs — need
/28subnets (up to 14 usable hosts)
Borrowing bits from the /24:
-
/30= borrow 6 bits from the host portion (30 − 24 = 6) -
/28= borrow 4 bits from the host portion (28 − 24 = 4)
Step 1: Subnet Calculation
Before touching GNS3, the math needs to be right. Here is the full breakdown.
/30 Subnets — Router-to-Router Links
| Subnet # | Network Address | Subnet Mask | Usable Hosts | Host Range |
|---|---|---|---|---|
| /30 Subnet 1 | 192.168.43.0 | 255.255.255.252 | 2 | .1 – .2 |
| /30 Subnet 2 | 192.168.43.4 | 255.255.255.252 | 2 | .5 – .6 |
A /30 gives you 4 addresses total: network address, 2 usable hosts, broadcast. Perfect for a point-to-point router link.
/28 Subnets — LAN Segments
| Subnet # | Network Address | Subnet Mask | Usable Hosts | Host Range |
|---|---|---|---|---|
| /28 Subnet 1 | 192.168.43.16 | 255.255.255.240 | 14 | .17 – .30 |
| /28 Subnet 2 | 192.168.43.32 | 255.255.255.240 | 14 | .33 – .46 |
| /28 Subnet 3 | 192.168.43.48 | 255.255.255.240 | 14 | .49 – .62 |
| /28 Subnet 4 | 192.168.43.64 | 255.255.255.240 | 14 | .65 – .78 |
A /28 gives you 16 addresses total: 14 usable. Each LAN segment (Switch + 2 PCs) connects to one of these.
Step 2: IP Address Assignment Plan
With the subnets defined, addresses get assigned to every interface and PC before building anything in GNS3.
| Device | Interface | IP Address | Subnet Mask | CIDR |
|---|---|---|---|---|
| R1 | f0/0 (to R2) | 192.168.43.1 | 255.255.255.252 | /30 |
| R1 | f2/0 (to R3) | 192.168.43.5 | 255.255.255.252 | /30 |
| R2 | f0/0 (to R1) | 192.168.43.2 | 255.255.255.252 | /30 |
| R2 | f2/0 (LAN 1) | 192.168.43.17 | 255.255.255.240 | /28 |
| R2 | f3/0 (LAN 2) | 192.168.43.33 | 255.255.255.240 | /28 |
| R3 | f0/0 (to R1) | 192.168.43.6 | 255.255.255.252 | /30 |
| R3 | f2/0 (LAN 3) | 192.168.43.49 | 255.255.255.240 | /28 |
| R3 | f3/0 (LAN 4) | 192.168.43.65 | 255.255.255.240 | /28 |
| PC1 | e0 | 192.168.43.18 | 255.255.255.240 | /28 |
| PC2 | e0 | 192.168.43.19 | 255.255.255.240 | /28 |
| PC3 | e0 | 192.168.43.34 | 255.255.255.240 | /28 |
| PC4 | e0 | 192.168.43.35 | 255.255.255.240 | /28 |
| PC5 | e0 | 192.168.43.50 | 255.255.255.240 | /28 |
| PC6 | e0 | 192.168.43.66 | 255.255.255.240 | /28 |
Step 3: Build the Topology in GNS3
The topology looks like this:
Step 4: Configure the Routers
Router R1
R1# configure terminal
! Interface toward R2 (/30)
R1(config)# interface fastEthernet 0/0
R1(config-if)# ip address 192.168.43.1 255.255.255.252
R1(config-if)# no shutdown
! Interface toward R3 (/30)
R1(config)# interface fastEthernet 2/0
R1(config-if)# ip address 192.168.43.5 255.255.255.252
R1(config-if)# no shutdown
R1(config)# end
R1# write memory
Static routing is skipped entirely here. OSPF is used so routers discover all subnets dynamically — no manual route entries needed, and the network adapts if something changes.
All routers use OSPF process ID 1 and area 0 (the backbone area).
OSPF on R1
R1# configure terminal
R1(config)# router ospf 1
R1(config-router)# network 192.168.43.0 0.0.0.3 area 0
R1(config-router)# network 192.168.43.4 0.0.0.3 area 0
R1(config-router)# end
R1# write memory
Router R2
R2# configure terminal
! Interface toward R1 (/30)
R2(config)# interface fastEthernet 0/0
R2(config-if)# ip address 192.168.43.2 255.255.255.252
R2(config-if)# no shutdown
! Interface toward Switch1 / LAN1 (/28)
R2(config)# interface fastEthernet 2/0
R2(config-if)# ip address 192.168.43.17 255.255.255.240
R2(config-if)# no shutdown
! Interface toward Switch2 / LAN2 (/28)
R2(config)# interface fastEthernet 3/0
R2(config-if)# ip address 192.168.43.33 255.255.255.240
R2(config-if)# no shutdown
R2(config)# end
R2# write memory
OSPF on R2
R2# configure terminal
R2(config)# router ospf 1
R2(config-router)# network 192.168.43.0 0.0.0.3 area 0
R2(config-router)# network 192.168.43.16 0.0.0.15 area 0
R2(config-router)# network 192.168.43.32 0.0.0.15 area 0
R2(config-router)# end
R2# write memory
Router R3
R3# configure terminal
! Interface toward R1 (/30)
R3(config)# interface fastEthernet 0/0
R3(config-if)# ip address 192.168.43.6 255.255.255.252
R3(config-if)# no shutdown
! Interface toward Switch3 / LAN3 (/28)
R3(config)# interface fastEthernet 2/0
R3(config-if)# ip address 192.168.43.49 255.255.255.240
R3(config-if)# no shutdown
! Interface toward Switch4 / LAN4 (/28)
R3(config)# interface fastEthernet 3/0
R3(config-if)# ip address 192.168.43.65 255.255.255.240
R3(config-if)# no shutdown
R3(config)# end
R3# write memory
OSPF on R3
R3# configure terminal
R3(config)# router ospf 1
R3(config-router)# network 192.168.43.4 0.0.0.3 area 0
R3(config-router)# network 192.168.43.48 0.0.0.15 area 0
R3(config-router)# network 192.168.43.64 0.0.0.15 area 0
R3(config-router)# end
R3# write memory
Why wildcard masks? The wildcard mask is the inverse of the subnet mask. For a /30 (mask 255.255.255.252), the wildcard is 0.0.0.3. For a /28 (mask 255.255.255.240), the wildcard is 0.0.0.15. OSPF uses these to match which interfaces to include in the routing process.
Step 5: Configure the PCs (VPCS)
VPCS uses a simple one-liner per PC. The gateway in each case is the router interface on the same /28 subnet.
# PC1 — LAN1, Switch1
PC1> ip 192.168.43.18 255.255.255.240 192.168.43.17
# PC2 — LAN1, Switch1
PC2> ip 192.168.43.19 255.255.255.240 192.168.43.17
# PC3 — LAN2, Switch2
PC3> ip 192.168.43.34 255.255.255.240 192.168.43.33
# PC4 — LAN2, Switch2
PC4> ip 192.168.43.35 255.255.255.240 192.168.43.33
# PC5 — LAN3, Switch3
PC5> ip 192.168.43.50 255.255.255.240 192.168.43.49
# PC6 — LAN4, Switch4
PC6> ip 192.168.43.66 255.255.255.240 192.168.43.65
Step 6: Verify Routing Tables
After OSPF converges (usually within 30–60 seconds), check that each router has learned all subnets.
R1# show ip route
Expected output will include O (OSPF-learned) entries for all /28 subnets that R1 doesn't directly own, alongside C (Connected) entries for its own /30 links.
R2# show ip route
R3# show ip route
How to Verify: Ping Tests
The real confirmation is cross-subnet pings.
Ping PC6 from PC1
PC1 is on 192.168.43.16/28 (LAN1, connected to R2).
PC6 is on 192.168.43.64/28 (LAN4, connected to R3).
Traffic must travel: PC1 → R2 → R1 → R3 → PC6.
PC1> ping 192.168.43.66
Expected: 5 successful replies from 192.168.43.66.
Ping PC5 from PC3
PC3 is on 192.168.43.32/28 (LAN2, connected to R2).
PC5 is on 192.168.43.48/28 (LAN3, connected to R3).
Traffic must travel: PC3 → R2 → R1 → R3 → PC5.
PC3> ping 192.168.43.50
Expected: 5 successful replies from 192.168.43.50.
What I Learned
Working through this end-to-end, a few things stood out that are easy to get wrong or gloss over in theory:
Wildcard masks trip people up. When you first encounter OSPF's network command, the wildcard syntax feels backwards. The key insight is: it's not a subnet mask. It's a "don't care" mask. Bits set to 1 mean "I don't care about this bit." So 0.0.0.15 means the last 4 bits are flexible — matching any address in that /28 block.
OSPF needs all networks advertised. Forgetting to include even one network statement under router ospf means that subnet won't be shared with neighbors. The ping will fail and it's not immediately obvious why — show ip route on the remote router will simply be missing that subnet.
Subnet size selection is deliberate. Using a /30 for a router-to-router link instead of a /28 isn't just aesthetics — it conserves address space. A /28 wastes 12 addresses on a link that only ever needs 2. When you're working with limited address space, that discipline matters.
Label everything before you configure. Trying to assign IPs while building the topology in GNS3 leads to mistakes. Doing the full address plan first on paper (or in a table) and then just applying it makes configuration mechanical and fast.
Common Mistakes
| Mistake | Why It Happens | How to Fix |
|---|---|---|
| Wrong wildcard mask in OSPF | Confusing it with subnet mask | Wildcard = bitwise inverse of subnet mask |
| PC default gateway not set | Assuming it's automatic in VPCS | Always include the gateway in the ip command |
Interface left in shutdown state |
Cisco routers default to shutdown | Always add no shutdown after configuring an interface |
| Subnet overlap | Miscalculating block boundaries | Use a subnet calculator to verify ranges before assigning |
| OSPF not converging | Not enough time after configuration | Wait 30–60 seconds; use show ip ospf neighbor to check adjacency |
Missing network statement |
Only configuring some interfaces in OSPF | Run show ip ospf interface brief to see which interfaces are in OSPF |
| Wrong subnet mask on PC | Copying the router's mask without checking | Each PC mask must match the /28 subnet it sits in (255.255.255.240) |
Conclusion
Subnetting is one of those topics where the gap between understanding it and actually doing it is wider than expected. Building this topology — calculating the blocks, assigning addresses, configuring interfaces, running OSPF, and watching the pings succeed — closes that gap in a way that no amount of reading does.
The key workflow that made it clean: plan first, configure second, verify last. Get the entire address table done before opening GNS3. Then configuration becomes mechanical, and any failures point clearly to a mistake in either math or typing.
If you're working through something similar, the routing table output from show ip route is your best debugging tool. If a subnet is missing there, OSPF hasn't learned it — and the ping will fail before it even tries.












Top comments (0)