Connecting Two LANs Using Static Routing
Experiment: Connecting Two LANs Using Static Routing
1. Aim
To connect two separate LANs using two routers in Cisco Packet Tracer, configure IP addresses on the PCs and router interfaces, configure static routes to reach non-directly-connected networks, and verify end-to-end connectivity using the ping command.
2. Objectives
After completing this experiment, students should be able to:
- Create two separate LANs using switches.
- Connect two routers to form an internetwork.
- Configure IPv4 addresses on PCs and router interfaces.
- Configure default gateways on PCs.
- Understand directly connected and non-directly-connected networks.
-
Configure static routes using the
ip routecommand. - Examine the router routing table.
- Verify connectivity between different LANs.
- Troubleshoot static routing problems.
- Understand how packets travel through multiple routers.
3. Theory
In the previous experiment, two LANs were connected to one router.
In that situation, the router automatically knew about both networks because both networks were directly connected to its interfaces.
In this experiment, we introduce a second router.
The topology will be:
LAN 1 LAN 2 192.168.1.0/24 192.168.2.0/24 PC0 ─── Switch0 ─── R1 ───────── R2 ─── Switch1 ─── PC2 \ / 10.0.0.0/30
The important concept is:
Router R1 does not directly connect to LAN 2, and Router R2 does not directly connect to LAN 1. Therefore, each router needs a static route to the remote LAN.
4. Network Topology
Use the following topology:
However, for simplicity, we will use the following precise addressing scheme.
5. IP Addressing Scheme
We will use three separate networks:
LAN 1
192.168.1.0/24
Router-to-router network
10.0.0.0/30
LAN 2
192.168.2.0/24
The /30 network is useful because a point-to-point router connection requires only two usable IP addresses.
Complete Addressing Table
| Device | Interface | IP Address | Subnet Mask | Default Gateway |
|---|---|---|---|---|
| PC0 | FastEthernet0 | 192.168.1.10 | 255.255.255.0 | 192.168.1.1 |
| PC1 | FastEthernet0 | 192.168.1.11 | 255.255.255.0 | 192.168.1.1 |
| Router0 | G0/0 | 192.168.1.1 | 255.255.255.0 | — |
| Router0 | G0/1 | 10.0.0.1 | 255.255.255.252 | — |
| Router1 | G0/0 | 10.0.0.2 | 255.255.255.252 | — |
| Router1 | G0/1 | 192.168.2.1 | 255.255.255.0 | — |
| PC2 | FastEthernet0 | 192.168.2.10 | 255.255.255.0 | 192.168.2.1 |
| PC3 | FastEthernet0 | 192.168.2.11 | 255.255.255.0 | 192.168.2.1 |
Networks
| Network | Purpose |
|---|---|
192.168.1.0/24 | LAN 1 |
10.0.0.0/30 | Router-to-router link |
192.168.2.0/24 | LAN 2 |
6. Devices Required
| Device | Quantity |
|---|---|
| Cisco Router | 2 |
| Cisco 2960 Switch | 2 |
| PC | 4 |
| Copper Straight-Through Cable | 6 |
Cable connections
- PC0 → Switch0
- PC1 → Switch0
- Switch0 → Router0
- Router0 → Router1
- Router1 → Switch1
- Switch1 → PC2
- Switch1 → PC3
Therefore, 7 cables are actually required.
All Ethernet connections can use Copper Straight-Through cables.
7. Important Concept Before Starting
Students should understand the difference between:
Directly connected network
Router0 directly connects to:
192.168.1.0/24
and:
10.0.0.0/30
Router1 directly connects to:
10.0.0.0/30
and:
192.168.2.0/24
Therefore:
Router0 does NOT know directly about:
192.168.2.0/24
Router1 does NOT know directly about:
192.168.1.0/24
This is exactly why we need static routing.
8. Procedure
Students should perform the following tasks in the given order.
Task 1: Open Cisco Packet Tracer
- Start Cisco Packet Tracer.
- Create a new blank workspace.
Task 2: Place Two Routers
- Select Network Devices → Routers.
- Select a router model with at least two Ethernet interfaces.
- Place two routers.
- Rename them conceptually:
Router0 = R1 Router1 = R2
For this experiment, a Cisco 1941-type router can be used.
Task 3: Place Two Switches
Place two Cisco 2960 switches.
Switch0 → LAN 1 Switch1 → LAN 2
Task 4: Place Four PCs
Place:
PC0 PC1 PC2 PC3
Arrange them:
LAN 1 LAN 2 PC0 PC1 PC2 PC3 | | | | +---- Switch0 ---- R1 ---- R2 ---- Switch1 ----+
Task 5: Connect LAN 1
Using Copper Straight-Through cables:
PC0 FastEthernet0 → Switch0 Fa0/1 PC1 FastEthernet0 → Switch0 Fa0/2 Switch0 Fa0/24 → Router0 G0/0
LAN 1 becomes:
PC0 | | Switch0 | | R1 G0/0
Task 6: Connect the Two Routers
Use a Copper Cross-Over cable for the router-to-router Ethernet connection if your Packet Tracer router/interface setup requires the traditional cable type.
Connect:
Router0 G0/1 | | Cross-Over | Router1 G0/0
If the selected router/interface supports Auto-MDIX in your Packet Tracer version, the connection may also work with a straight-through cable. For teaching purposes, use the cross-over connection here to reinforce the traditional router-to-router Ethernet connection.
Task 7: Connect LAN 2
Using Copper Straight-Through cables:
Router1 G0/1 → Switch1 Fa0/24 Switch1 Fa0/1 → PC2 FastEthernet0 Switch1 Fa0/2 → PC3 FastEthernet0
The complete topology is:
ROUTER-TO-ROUTER LINK 10.0.0.1 10.0.0.2 192.168.1.0/24 192.168.2.0/24 PC0 PC1 PC2 PC3 | | | | | | | | +----+----+ +----+----+ | | Switch0 Switch1 | | | | G0/0 G0/1 Router0 Router1 G0/1 G0/0 +-------------------- 10.0.0.0/30 -----------------------+
Task 8: Configure PC0
Go to:
PC0 → Desktop → IP Configuration
Enter:
IP Address: 192.168.1.10 Subnet Mask: 255.255.255.0 Default Gateway: 192.168.1.1
Task 9: Configure PC1
Enter:
IP Address: 192.168.1.11 Subnet Mask: 255.255.255.0 Default Gateway: 192.168.1.1
Task 10: Configure PC2
Enter:
IP Address: 192.168.2.10 Subnet Mask: 255.255.255.0 Default Gateway: 192.168.2.1
Task 11: Configure PC3
Enter:
IP Address: 192.168.2.11 Subnet Mask: 255.255.255.0 Default Gateway: 192.168.2.1
Task 12: Configure Router0 G0/0
Click Router0 → CLI.
Enter:
Router> enable Router# configure terminal Router(config)# interface gigabitEthernet 0/0 Router(config-if)# ip address 192.168.1.1 255.255.255.0 Router(config-if)# no shutdown Router(config-if)# exit
This interface connects Router0 to LAN 1.
Task 13: Configure Router0 G0/1
Enter:
Router(config)# interface gigabitEthernet 0/1 Router(config-if)# ip address 10.0.0.1 255.255.255.252 Router(config-if)# no shutdown Router(config-if)# exit
This interface connects Router0 to Router1.
Task 14: Configure Router1 G0/0
Click Router1 → CLI.
Enter:
Router> enable Router# configure terminal Router(config)# interface gigabitEthernet 0/0 Router(config-if)# ip address 10.0.0.2 255.255.255.252 Router(config-if)# no shutdown Router(config-if)# exit
Task 15: Configure Router1 G0/1
Enter:
Router(config)# interface gigabitEthernet 0/1 Router(config-if)# ip address 192.168.2.1 255.255.255.0 Router(config-if)# no shutdown Router(config-if)# exit
Then:
Router(config)# end
Task 16: Verify Router0 Interfaces
On Router0:
show ip interface brief
Expected:
| Interface | IP Address | Status | Protocol |
|---|---|---|---|
| G0/0 | 192.168.1.1 | up | up |
| G0/1 | 10.0.0.1 | up | up |
Both should ideally show:
up/up
Task 17: Verify Router1 Interfaces
On Router1:
show ip interface brief
Expected:
| Interface | IP Address | Status | Protocol |
|---|---|---|---|
| G0/0 | 10.0.0.2 | up | up |
| G0/1 | 192.168.2.1 | up | up |
Task 18: Test the Router-to-Router Link
This is an important intermediate test.
From Router0:
ping 10.0.0.2
It should succeed.
From Router1:
ping 10.0.0.1
It should also succeed.
Why perform this test?
Before configuring static routes, we must verify that the two routers can communicate directly.
Task 19: Examine Router0's Routing Table
On Router0:
show ip route
Router0 should know about:
192.168.1.0/24
and:
10.0.0.0/30
But it should not yet know about:
192.168.2.0/24
This is the important observation.
Task 20: Examine Router1's Routing Table
On Router1:
show ip route
Router1 should know about:
10.0.0.0/30
and:
192.168.2.0/24
But it should not yet know about:
192.168.1.0/24
Task 21: Test LAN 1 Connectivity
From PC0:
ping 192.168.1.11
This should succeed because PC0 and PC1 are on the same LAN.
Task 22: Test LAN 2 Connectivity
From PC2:
ping 192.168.2.11
This should succeed because PC2 and PC3 are on the same LAN.
Task 23: Test Communication Between the Two LANs
Now perform:
From PC0:
ping 192.168.2.10
This is an important test.
Expected result at this stage:
The ping should fail.
Why?
Because Router0 does not yet have a route to:
192.168.2.0/24
Similarly, Router1 does not have a route to:
192.168.1.0/24
This is the point where students should understand why routing information is necessary.
9. Configure Static Routes
Now we configure the missing routes manually.
Task 24: Configure a Static Route on Router0
Router0 needs to know:
"To reach the 192.168.2.0 network, send the packet to Router1 at 10.0.0.2."
On Router0:
Router0# configure terminal
Enter:
Router0(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.2
Then:
Router0(config)# end
Meaning of the command
ip route 192.168.2.0 255.255.255.0 10.0.0.2
means:
Destination network = 192.168.2.0 Subnet mask = 255.255.255.0 Next-hop router = 10.0.0.2
In simple words:
To reach LAN 2, send the packet to Router1.
Task 25: Configure a Static Route on Router1
Router1 needs to know:
"To reach the 192.168.1.0 network, send the packet to Router0 at 10.0.0.1."
On Router1:
Router1# configure terminal
Enter:
Router1(config)# ip route 192.168.1.0 255.255.255.0 10.0.0.1
Then:
Router1(config)# end
10. Verify the Static Routes
Task 26: Check Router0
Enter:
Router0# show ip route
You should now see an entry similar to:
S 192.168.2.0/24 [1/0] via 10.0.0.2
The letter:
S
means:
Static route
Task 27: Check Router1
Enter:
Router1# show ip route
You should see:
S 192.168.1.0/24 [1/0] via 10.0.0.1
Again:
S = Static
11. Task 28: Test Inter-LAN Connectivity Again
Now return to PC0.
Execute:
ping 192.168.2.10
This time the ping should succeed.
The packet travels:
PC0 | | 192.168.1.10 ↓ Switch0 | ↓ Router0 | | 10.0.0.1 → 10.0.0.2 ↓ Router1 | ↓ Switch1 | ↓ PC2 192.168.2.10
12. Task 29: Test the Reverse Direction
From PC2:
ping 192.168.1.10
This should also succeed.
The reverse path is:
PC2 ↓ Switch1 ↓ Router1 ↓ Router0 ↓ Switch0 ↓ PC0
This demonstrates that both routers require appropriate routing information.
13. Connectivity Verification Table
Students should complete the following table.
| Source | Destination | Command | Before Static Route | After Static Route |
|---|---|---|---|---|
| PC0 | PC1 | ping 192.168.1.11 | Success | Success |
| PC2 | PC3 | ping 192.168.2.11 | Success | Success |
| PC0 | PC2 | ping 192.168.2.10 | Failure | Success |
| PC2 | PC0 | ping 192.168.1.10 | Failure | Success |
| PC1 | PC3 | ping 192.168.2.11 | Failure | Success |
| PC3 | PC1 | ping 192.168.1.11 | Failure | Success |
This table is particularly useful because it demonstrates the effect of static routing rather than merely asking students to type commands.
14. Task 30: Use tracert to Observe the Path
On PC0, open Command Prompt.
Enter:
tracert 192.168.2.10
The command shows the path taken by packets toward PC2.
Conceptually, the path will contain:
PC0 ↓ Router0 ↓ Router1 ↓ PC2
This is a very useful way of demonstrating the role of routers.
15. Task 31: Examine the Routing Table Again
On Router0:
show ip route
Students should identify:
C 192.168.1.0/24 C 10.0.0.0/30 S 192.168.2.0/24
On Router1:
show ip route
Students should identify:
C 10.0.0.0/30 C 192.168.2.0/24 S 192.168.1.0/24
16. Task 32: Observe the Routing Process in Simulation Mode
This is an excellent exercise for students.
- Change Packet Tracer from Realtime to Simulation mode.
- From PC0, execute:
ping 192.168.2.10
- Click Capture/Forward.
-
Observe the packet as it travels through:
- PC0
- Switch0
- Router0
- Router1
- Switch1
- PC2
Ask students to identify the point at which routing occurs.
17. Task 33: Introduce a Static Route Error
This is an important troubleshooting activity.
On Router0, temporarily change the static route to an incorrect next-hop address:
Router0(config)# no ip route 192.168.2.0 255.255.255.0 10.0.0.2
Then configure:
Router0(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.5
Now test from PC0:
ping 192.168.2.10
The ping should fail.
Ask students:
Why does the ping fail?
Because 10.0.0.5 is not the correct next-hop router on the 10.0.0.0/30 network.
18. Task 34: Correct the Static Route
Remove the incorrect route:
Router0(config)# no ip route 192.168.2.0 255.255.255.0 10.0.0.5
Add the correct route:
Router0(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.2
Test:
ping 192.168.2.10
The ping should succeed.
19. Task 35: Save the Configuration
Once everything works, save the configurations.
On Router0:
Router0# copy running-config startup-config
Press Enter when prompted for the destination filename.
Repeat on Router1:
Router1# copy running-config startup-config
20. Important Commands Used
| Purpose | Command |
|---|---|
| Enter privileged mode | enable |
| Enter configuration mode | configure terminal |
| Configure interface | interface gigabitEthernet 0/0 |
| Assign IP address | ip address IP MASK |
| Enable interface | no shutdown |
| Display interface status | show ip interface brief |
| Display routing table | show ip route |
| Add static route | ip route NETWORK MASK NEXT-HOP |
| Remove static route | no ip route NETWORK MASK NEXT-HOP |
| Test connectivity | ping IP-address |
| Trace packet path | tracert IP-address |
| Display configuration | show running-config |
| Save configuration | copy running-config startup-config |
21. Static Route Commands — Most Important Part
Students should specifically record these two commands.
Router0
Router0(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.2
Meaning:
To reach LAN 2, forward packets to Router1.
Router1
Router1(config)# ip route 192.168.1.0 255.255.255.0 10.0.0.1
Meaning:
To reach LAN 1, forward packets to Router0.
22. Routing Table Observation
Students should complete this table.
Router0
| Destination Network | Route Type | Next Hop | Interface |
|---|---|---|---|
| 192.168.1.0/24 | Connected | — | G0/0 |
| 10.0.0.0/30 | Connected | — | G0/1 |
| 192.168.2.0/24 | Static | 10.0.0.2 | G0/1 |
Router1
| Destination Network | Route Type | Next Hop | Interface |
|---|---|---|---|
| 10.0.0.0/30 | Connected | — | G0/0 |
| 192.168.2.0/24 | Connected | — | G0/1 |
| 192.168.1.0/24 | Static | 10.0.0.1 | G0/0 |
23. Key Concept: How Static Routing Works
Consider this packet:
PC0: 192.168.1.10 | | Destination = 192.168.2.10 ↓ Router0
Router0 looks at its routing table:
Destination Route 192.168.1.0/24 Connected 10.0.0.0/30 Connected 192.168.2.0/24 Static → 10.0.0.2
It finds:
192.168.2.0/24 ↓ next hop = 10.0.0.2
Therefore, it forwards the packet to Router1.
Router1 then recognizes:
192.168.2.0/24 ↓ Directly connected through G0/1
and delivers the packet to PC2.
24. Observation
PC Configuration
| PC | IP Address | Subnet Mask | Default Gateway |
|---|---|---|---|
| PC0 | 192.168.1.10 | 255.255.255.0 | 192.168.1.1 |
| PC1 | 192.168.1.11 | 255.255.255.0 | 192.168.1.1 |
| PC2 | 192.168.2.10 | 255.255.255.0 | 192.168.2.1 |
| PC3 | 192.168.2.11 | 255.255.255.0 | 192.168.2.1 |
Router Configuration
| Router | Interface | IP Address |
|---|---|---|
| Router0 | G0/0 | 192.168.1.1 |
| Router0 | G0/1 | 10.0.0.1 |
| Router1 | G0/0 | 10.0.0.2 |
| Router1 | G0/1 | 192.168.2.1 |
25. Result
Two separate LANs were successfully connected using two routers in Cisco Packet Tracer. The router interfaces, PCs, subnet masks, and default gateways were configured. Static routes were configured on both routers to provide paths to the non-directly-connected LANs. Connectivity between the two LANs was successfully verified using ping and the packet path was examined using tracert.
Comments
Post a Comment