[go: up one dir, main page]

0% found this document useful (0 votes)
5 views44 pages

EXP2 Router Configuration and Static Routing

Uploaded by

ellatiehab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views44 pages

EXP2 Router Configuration and Static Routing

Uploaded by

ellatiehab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

ENCS4130

Computer Networks Laboratory

EXP#2 Router Configuration and


Static Routing

Slides By: Eng. Tariq Odeh


ENCS4130 - Computer Networks Laboratory

Objectives
• Learn how to configure a Cisco IOS router using the IOS command line interface (CLI).
• Learn how to use router simulator.
• Learn how to use the sniffer to capture packets in Packet Tracer.

2
ENCS4130 - Computer Networks Laboratory

Introduction
• Connecting Multiple Networks:
- A router connects different networks (subnets) and directs data to the correct destination.
• Layer-3 Device:
- Uses IP addresses (Layer-3) to route packets to their destination.
• Why Subnets?
- To control traffic, dividing the network into segments.
• Routing Types:
- Static Routing: Manually updated by the network admin.
- Dynamic Routing: Automatically updates routing information.

3
ENCS4130 - Computer Networks Laboratory

Router
• Router is a networking device that forwards data packets between computer networks.
- Connects one or more packet-switched networks.
- Manages traffic between networks.
- Uses IP addresses (Layer-3) to route packets to their destination.
- Permits several devices to share an internet connection.
- Provides security (such as ACL).
- Provides scalability.

4
ENCS4130 - Computer Networks Laboratory

What is Routing?
• Routing:
- The process of choosing a path to send a packet from one device to another on a different network.
• Routers' Role:
- Focus on networks, not individual hosts.
- Use the host's MAC address (hardware address) only after the packet has reached the correct network.
• Key Things a Router Needs to Know:
- Destination address.
- Next hop.
- Neighbouring routers.
- Routes to remote networks.
- Best route to each network.
- How to maintain routing information. 5
ENCS4130 - Computer Networks Laboratory

Routing Table Example

6
ENCS4130 - Computer Networks Laboratory

Static Routing
• What is Static Routing?
- Manually adding routes to each router's routing table.
• Benefits:
- No CPU overhead on the router (cheaper routers can be used).
- No bandwidth usage between routers (saves money on WAN links).
- Adds security by controlling which networks can be routed.
• Disadvantages:
- Requires a deep understanding of the network for correct configuration.
- Manually updating routes when changes occur.
- Not suitable for large networks due to maintenance difficulty.
7
ENCS4130 - Computer Networks Laboratory

Configuring Static Routing Formula

• Router(config)# ip route <destination_network> <mask> <next-hop_address>

Component Description Example


Router(config)# Indicates the router is in global configuration mode. Router(config)#
ip route Command to create a static route. ip route
<destination_network> The target network to be reached. 192.168.2.0
<mask> The subnet mask of the destination network. 255.255.255.0
<next-hop_address> The IP address of the next router to forward the packet to. 192.168.1.1

8
ENCS4130 - Computer Networks Laboratory

Static Routing Example

9
ENCS4130 - Computer Networks Laboratory

Dynamic Routing
• What is Dynamic Routing?
- Routers automatically communicate and update routing tables using protocols.
• Advantages:
- Automatically adjusts to network changes.
- Reduces the need for manual updates.
• Disadvantages:
- Uses more CPU and bandwidth than static routing.
- Can be more complex to configure.

10
ENCS4130 - Computer Networks Laboratory

Static vs Dynamic Routing


Category Static Routing Dynamic Routing
Path Selection One pre-configured route to destination Multiple available routes to destination

Route Updates Engineers must manually update routes Algorithms update routes automatically

Routing Tables Smaller table with only one entry per destination Routers exchange entire routing tables.
Uses Distance Vector (RIP, IGRP) and Link-State
Protocols & Algorithms No protocols or algorithms needed for routing
(OSPF, IS-IS) algorithms
Computation &
Requires less computation and bandwidth Requires more computation and bandwidth
Bandwidth
Security More secure Less secure

Use Cases Best for small, stable networks with fewer routers Best for large, dynamic networks that frequently change

11
ENCS4130 - Computer Networks Laboratory

Gateway IP
• Definition:
- A Gateway IP is the IP address of a network device (like a router) that connects your
local network to external networks, including the internet.
• Purpose:
- It acts as an exit point for data leaving your local network and directs traffic to the
correct destination.
• Example:
- If your device is trying to access a website, the Gateway IP helps route the request from
your home network to the internet.
• Common Gateway IP: Usually the first available IP address in the network.
• Note: It’s not the same as the Network IP.
12
ENCS4130 - Computer Networks Laboratory

Gateway IP Example
• What is Gateway IP for PC0?
- Router0 → Interface Fa0/0 → 192.168.0.1
• What is Gateway IP for PC1?
- Router1 → Interface Fa0/0 → 192.168.1.1

13
ENCS4130 - Computer Networks Laboratory

Packet Sniffing
• What is Packet Sniffing?
- Capturing and analysing network packets to monitor traffic.
- Used in troubleshooting, security monitoring, and protocol analysis.
• How It Works:
- Capturing Packets: Sniffers like Wireshark & Packet Tracer collect data.
- Decoding Data: Extracts source, destination, protocol, and payload.
- Analysing Traffic: Filters, detects issues, and monitors communication.
• Packet Sniffing Tools:
- Wireshark.
- Cisco Packet Tracer.
14
Procedure
ENCS4130 - Computer Networks Laboratory

IP Address
• The IP address as follows: 192.X.10.0 → where X is : for example, student ID is 1224530,
X = 30, and so the network will be 192.30.10.0/S.M

The IP address as follows: 192.X.10.0

Student ID is 1224530

The IP address is: 192.30.10.0


16
ENCS4130 - Computer Networks Laboratory

Topology
• The topology contains:
Name Quantity Symbol

Router-PT 2

Switch-PT 2

PC-PT 2

Sniffer 1

• Use Automatically use connection type: 17


ENCS4130 - Computer Networks Laboratory

Topology (Cont.)

18
ENCS4130 - Computer Networks Laboratory

IP Address Distribution Network 0

Network Device/Interface IP address Subnet mask


Network 0 PC0 192.X.0.2/24 255.255.255.0
192.X.0.0/24 Router0 Fa0/0 192.X.0.1/24 255.255.255.0

19
ENCS4130 - Computer Networks Laboratory

IP Address Distribution Network 1

Network Device/Interface IP address Subnet mask


Network 1 PC1 192.X.1.2/24 255.255.255.0
192.X.1.0/24 Router1 Fa0/0 192.X.1.1/24 255.255.255.0

20
ENCS4130 - Computer Networks Laboratory

IP Address Distribution Network 2

Network Device/Interface IP address Subnet mask


Network 2 Router0 Se2/0 192.X.2.1/24 255.255.255.0
192.X.2.0/24 Router1 Se2/0 192.X.2.2/24 255.255.255.0

21
ENCS4130 - Computer Networks Laboratory

IP Address Distribution Networks

Network Device/Interface IP address Subnet mask


Network 0 PC0 192.X.0.2/24 255.255.255.0
192.X.0.0/24 Router0 Fa0/0 192.X.0.1/24 255.255.255.0
Network 1 PC1 192.X.1.2/24 255.255.255.0
192.X.1.0/24 Router1 Fa0/0 192.X.1.1/24 255.255.255.0
Network 2 Router0 Se2/0 192.X.2.1/24 255.255.255.0
192.X.2.0/24 Router1 Se2/0 192.X.2.2/24 255.255.255.0

22
ENCS4130 - Computer Networks Laboratory

Show the port labels


1
2

23
ENCS4130 - Computer Networks Laboratory

Configuring IPs for the PCs

24
ENCS4130 - Computer Networks Laboratory

Router Modes
• User Mode: This is the most basic mode, where you have limited access to view basic information.
- Router>
• Privileged Mode: Provides access to more detailed information and some configuration capabilities.
- Router#
• Global Configuration Mode: This is where you make global changes to the router’s configuration.
- Router(config)#
• Global Configuration Mode On Interface: A sub-mode of Global Configuration Mode used to configure
specific interfaces like Ethernet, Serial, etc.
- Router(config-if)#

25
ENCS4130 - Computer Networks Laboratory

Router Modes (Cont.)


User Mode
Router>

exit Router> enable

Privileged Mode
Router#

exit Router# configuration terminal

Global Configuration Mode


Router (config)#

exit Router (config)# interface <TYPE> <SLOT>/<PORT>

Global Configuration Mode On Interface


Router(config-if)#
26
ENCS4130 - Computer Networks Laboratory

Configuring IPs for the Routers (Cont.)

27
ENCS4130 - Computer Networks Laboratory

Configuring IPs for the Routers (Cont.)


1- Enter User Mode

28
ENCS4130 - Computer Networks Laboratory

Configuring IPs for the Routers (Cont.)


2- Go to Privileged Mode

29
ENCS4130 - Computer Networks Laboratory

Configuring IPs for the Routers (Cont.)


3- Go to Global Configuration Mode

30
ENCS4130 - Computer Networks Laboratory

Configuring IPs for the Routers (Cont.)


4- Go to Global Configuration Mode On Interface

31
ENCS4130 - Computer Networks Laboratory

Configuring IPs for the Routers (Cont.)


5- Bringing Up an Interface

32
ENCS4130 - Computer Networks Laboratory

Configuring IPs for the Routers (Cont.)


6- Configuring the first IP Address on an interface

7- Assign the rest of the IP addresses to the interfaces.

33
ENCS4130 - Computer Networks Laboratory

Configuring Static Routing


• Configuring Static Routing formula
Router(config)# ip route <destination_network> <mask> <next-hop_address>

• Configuring Static Routing for Router0


Router0(config)# ip route 192.X.1.0 255.255.255.0 192.X.2.2

• Configuring Static Routing for Router1


Router1(config)# ip route 192.X.0.0 255.255.255.0 192.X.2.1

34
ENCS4130 - Computer Networks Laboratory

Configuring Static Routing (Cont.)

35
ENCS4130 - Computer Networks Laboratory

Verifying Your Configuration


1
2

36
ENCS4130 - Computer Networks Laboratory

Other Important Configurations


1. Showing all router configuration 5. Set the time and date
• Router# show running-config • Router# clock set 10:30:10 28 January 2020

2. Showing the routing table 6. Set the clock rate


• Router# show ip route • Router(config-if)# clock rate 64000

3. Editing and Help Features 7. Set the bandwidth


• Router# c? • Router(config-if)# bandwidth 64

4. Set the hostnames


• Router(config)# hostname RouterA
• RouterA(config)#

37
ENCS4130 - Computer Networks Laboratory

Passwords
1. Console
• Router(config)# line con 0
• Router(config-line)# password 111
• Router(config-line)# login

2. Privileged
• Router(config)# enable password 222
• or
• Router(config)# enable secret 222

3. Telnet
• Router(config)# line vty 0 4
• Router(config-line)# password 333
• Router(config-line)# login

38
ENCS4130 - Computer Networks Laboratory

Packet Sniffing
1
2
Step 1+2 Go to Sniffer → GUI → Service, and
toggle Check On or Off to enable or disable packet
capturing. Then, select Port 0 or 1

Step 3 Clearing all incoming packets by clicking


on ‘Clear’

39
ENCS4130 - Computer Networks Laboratory

Packet Sniffing (Cont.)

5
Step 4 Clicking on ‘Edit Filters’ to focus on
specific types of network traffic for more
precise analysis.

Step 5 We need to check ICMP because it is used


for ping to test connections between devices.

4
40
ENCS4130 - Computer Networks Laboratory

Packet Sniffing (Cont.)


Step 6 Send packet from PC0 to PC1,
then click on it in the sniffer tool to view
details.

41
ENCS4130 - Computer Networks Laboratory

Saving Configurations
• What Happens:
- When you configure a router, changes are stored in RAM (running-config).
- RAM is temporary – data is lost if the router restarts.
• Why It Matters:
- Without write → config is lost on reboot. With
- write → config is saved permanently in NVRAM (non-volatile).

• Don't forget to save the configurations on your router.


- Router# write

42
ENCS4130 - Computer Networks Laboratory

Video explaining the experiment

https://www.youtube.com/watch?v=A8hdPdOdUtM&ab_channel=TariqOdeh

43
ENCS4130 - Computer Networks Laboratory

Contact Me
Office: Aggad340

Ritaj ID: 8611

Email: tnodeh@birzeit.edu

Facebook: tariq0odeh

YouTube: tariq0odeh

LinkedIn: tariqodeh
44

You might also like