Lab 05 (In English)
Lab 05 (In English)
1.Aim
The three main objectives of this lab are:
Configuration of interconnection between different networks using routers (IP addressing,
subnetting, gateways, etc.).
Configuration of static routing.
Configuration of dynamic routing using the RIP protocol.
All tasks are performed using the Packet Tracer simulator.
2. Basic Commands to Configure a Cisco Switch/Router
The following table lists the main commands necessary for configuring the interconnection of networks:
Command Purpose
enable Enters privileged executive mode.
configure terminal Enters global configuration mode, which lets you
start making changes to the router's configuration.
exit Exits configuration mode for the Fast Ethernet
interface and returns to global configuration mode.
interface type number Enters the configuration mode for a Fast Ethernet
Example: interface on the router.
Router(config)# Interface FastEthernet 0/0
ip address ip-address mask Sets the IP address and subnet mask for the specified
Example: Fast Ethernet interface.
Router(config-if)# ip address 192.168.12.2
255.255.255.0
no shutdown Enables the Ethernet interface, changing its state
from administratively down to administratively up.
copy running-config startup-config Copies the current live configuration into the startup
configuration file, so that your changes are saved
and persist after a reboot.
show ip interface brief Displays the usability status of interfaces configured
for various IP addresses.
ip route prefix mask { ip-address | interface- Specifies the static route for the IP packets.
type interface-number [ ip-address ]}
Example:
Router(config)# ip route 192.168.1.0 255.255.0.0
10.10.10.2
show ip route Displays the current state of the routing table.
no ip route prefix mask ip-address Removes a static route from the router's routing
Example : table.
Router(config)# no ip route 192.168.2.0
255.255.255.0 10.0.0.2
router rip Enters router configuration mode, and enables RIP
on the router.
network ip-address Specifies a list of networks on which RIP is to be
Example: applied, using the address of the network of each
Router(config-router)# network 192.168.1.1 directly connected network.
1/8
Module : Computer Networks 2nd year Computer Science Abdelhafid Boussouf University Center, Mila Year : 2024/2025
3. Network Interconnection
Consider configuring the network shown in the figure:
This network consists of two local networks: LAN1 with IP 172.16.0.0 and LAN2 with IP 192.168.1.0.
Both networks are connected via a router. LAN1 is connected through the FastEthernet 0/0 interface
(denoted as Fa 0/0) and LAN2 through the FastEthernet 0/1 interface (denoted as Fa 0/1).
The gateway for this network is the Fa 0/0 interface of the router, with the address 172.16.0.254
Do the same for the other PCs in this network.
2/8
Module : Computer Networks 2nd year Computer Science Abdelhafid Boussouf University Center, Mila Year : 2024/2025
The gateway for this network is the Fa 0/1 interface of the router, with the address 192.168.1.254
Do the same for the other PCs in this network.
Router> enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 172.16.0.254 255.255.0.0
Router(config-if)#no shutdown
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
3/8
Module : Computer Networks 2nd year Computer Science Abdelhafid Boussouf University Center, Mila Year : 2024/2025
Note: It is possible to visualize the ping in "Simulation" mode to see the path taken by the packets.
The router interfaces are configured, taking into account this time the addition of a third LAN network.
4/8
Module : Computer Networks 2nd year Computer Science Abdelhafid Boussouf University Center, Mila Year : 2024/2025
Router#
L’interface à changer
3.2.2. Configuring Router 2
We assign the address 10.0.0.2 to the Fa 0/0 interface and the address 192.168.1.254 to the Fa 0/1 interface,
and we follow the same procedure as that used for Router 1 (see section 3.1.2. Configuring router interfaces).
The 172.16.0.0 network cannot communicate with the 192.168.1.0 network because the communication does
not occur directly (as in the previous case where only the LAN1 and LAN2 networks were connected); it
now goes through the 10.0.0.0/8 network, and the router is not configured to recognize this.
Therefore, we need to configure the routes that will allow communication between the 172.16.0.0/16
network and the 192.168.1.0/24 network.
We start by configuring the routes on Router 1. To do this, we add a route to 192.168.1.0/24 through the
next-hop with the address 10.0.0.2:
5/8
Module : Computer Networks 2nd year Computer Science Abdelhafid Boussouf University Center, Mila Year : 2024/2025
Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D-EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1-OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1-OSPF external type 1, E2 - OSPF external type 2, E - EGP
i-IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
Now we configure the routes on Router 2. To do this, we add a route to 172.16.0.0/16 through the next-hop
with the address 10.0.0.1:
6/8
Module : Computer Networks 2nd year Computer Science Abdelhafid Boussouf University Center, Mila Year : 2024/2025
The connection between the two networks can be tested with a ping from PC0 on the 172.16.0.0/16 network
to PC2 on the 192.168.1.0/24 network. You will notice that the connection is established and the network is
properly configured.
7/8
Module : Computer Networks 2nd year Computer Science Abdelhafid Boussouf University Center, Mila Year : 2024/2025
For Router 2:
Router#show ip route
.
.
.
Gateway of last resort is not set
8/8