Skip to main content
Introduction to Routing
a. What Is a Router?
b. What are Functions of a Router
c. How router works
d. Various Ports in a Router
e. Memory Types in a Router
a. What Is a Router
-A networking device that operates at the network layer of OSI model to connect multiple or different networks.
- It uses IP addresses to send and receive data.
-Performs packet directing functions in the network.
b. What are functions of a Router
- Joins Multiple networks.
- Assigns IP addresses to end devices.
- Selects best path when there is multiple links to destination.
c. How Router Works
- When a packet arrives at a router, it examines destination IP address of a received packet and make routing decisions accordingly.
- Routers use routing tables to determine out which interface the packet will be sent.
- A routing table lists all networks for which routes are known. Each router’s routing table is unique and stored in the RAM of the
device.
Routing Table:
- A routing table is a set of rules, often viewed in table format, that is used to determine where data packets traveling over
an internet protocol (IP) network will be directed.
- All IP-enabled devices, including routers and switches, use routing tables.
d. Various Ports in a Router
- Ethernet ports- connect other devices like switches, PC, server etc.
- Console port- connect to PC for local configurations.
- Auxiliary Port- connect to modem for remote configurations.
- Serial Ports- Connect different networks.
e. Memory Types in a Router
Volatile
Non-Volatile
Non-Volatile
Non-Volatile
THE END!!!
How to Connect Router to PC Using Console
Cable | Basic IOS Commands
 Connecting PC to Router using console cable.
Requirements
Hardware (PC, Router and console cable)
Software (putty or tera term or secure CRT)
Basic IOS Commands-- User EXEC, Privileged EXEC and Configuration Modes
Basic Configurations of a Router
Configure the basic configuration to the devices.
 Hostnames
 Line Console (password, exec timeout, logging synchronous)
 Line VTY (password, exec timeout, logging synchronous)
 Enable Password
 Banner messages
 Encrypting the Password
 Disable IP domain lookup
 Saving Configurations
 Displaying saved and running configs
How to Configure Telnet and SSH
Ways to Configure Networking Devices
 Locally Using Line Console (through console port and console cable)
 Remotely Using Line VTY (through Telnet or SSH protocols)
Remote Access and Configuration
To use telnet/SSH, you must have a software (Telnet/SSH client) installed e.g. Putty. On a remote device, a Telnet/SSH server must be
installed and running.
TELNET SSH
1 TCP port 23 TCP port 22
2 All data, including usernames and
passwords, is sent in clear text/
plaintext- insecure
Uses encryption, hence all data transmitted
over a network is secure
3 Rarely Used Today Most Used
1. Configuring Telnet
a. Switch (config)# line vty 0 15
b. Switch (config)# password Cisco@123
c. Switch (config)# login
d. Switch (config)# do write
e. Switch (config)# exit
1. Configuring SSH
a) Set up a hostname e.g. hostname R1
b) Set up a domain name e.g. ip domain-name gtech
c) Configure local username and password e.g. username gtech password Cisco@123
d) Generate RSA public and private keys. e.g. crypto key generate rsa
e) Allow only SSH access
Network Addresses- IP + MAC
What to Cover.
a. IP Address
b. IPv4 Classes + Subnet mask, Network ID, and Host ID
c. IPv4 and IPv6
d. MAC Address
e. Difference between IP and MAC address
1. Internet Protocol (IP) Address
• This is a logical address that works at the network layer of OSI model to enable devices to communicate.
• There are IPV4 and IPV6 addresses.
a. IPv4 Address
-Consist of numbers and is divided into four sections (octets) separated by dots.
-Each octet contains 8 bits.
-Size is 32 bits.
-IPv4 can be a private or public address
b. IPv4 Address Classes
b. IPv4 and IPv6
2. Media Access Control (MAC) Address
• Also called a physical or hardware address.
• Used to enable to communication in the network at layer-2 or data link layer.
• Every device has a unique mac-address.
• It’s permanent and cannot be changed.
• Made up of 6 octets separated by colon, dash, or dots.
• Comprised two parts for vendor and host assignment.
3. Comparisons between IP and MAC Addresses
Subnetting (Classful $ Classless)
What to Cover.
Meaning of subnetting
Examples questions of Classless and classful subnetting
1. Subnetting
- This is the practice of dividing a network into two or more smaller networks. It increases routing efficiency,
enhances the security of the network, and reduces the size of the broadcast domain.
- Advantages; good security and performance, easy management, less broadcast domains.
- We have classful or classless subnetting.
2. Classful and Classless Subnetting
- method of splitting a classful or classless network number into two or more smaller subnets.
- The subnets will all be the same size, determined by the maximum number of hosts per
subnet. A subnet mask is used to configure the subnets
- We use IP address and subnet mask to do subnetting.
- Each subnet has its own block size for subnetting as shown below;
3. Examples Classful Subnetting
a. Given network 192.168.10.0 and subnet mask of 255.255.255.0.
- Find network ID, first and last valid host ID, broadcast ID.
 Network= 192.168.10.0
 subnet mask of 255.255.255.0
 Considering this is a class C address hence subnetting occurs on the fourth octet
 The fourth octet value is 0 (255.255.255.0).
 Therefore on looking at the subnet mask and block size table, 0 falls within 128 block
 The block size of subnet mask 128 is 128.
 Therefore we will have two subnets that is (0-127 and 128-255)
In the first subnet(0-127) In the second subnet(128-255)
 network ID= 192.168.10.0 - network ID= 192.168.10.128
 first valid host ID= 192.168.10.1 - first valid host ID= 192.168.10.129
 last valid host ID= 192.168.10.126 - last valid host ID= 192.168.10.254
 broadcast ID= 192.168.10.127 - broadcast ID= 192.168.10.255
5. Alternative method of Subnetting
c. Given network 192.168.10.0 and subnet mask of 255.255.255.192.
- Find total number of subnetworks and hosts per subnet
 Network= 192.168.10.0
 subnet mask of 255.255.255.192
Using the above binary-decimal conversion,
Convers subnet mask into binary
11111111.11111111.11111111.11000000
Network bits represented by ones.
Host bits represented by zeros.
 Considering the binary values above, the borrowed network bits are two.
 11111111.11111111.11111111.11000000
 The host bits are six 11111111.11111111.11111111.11000000
Total Number of subnets= 2n -(22)= 4
Total Number of hosts per subnet= 2n-2(26-2)= 62
Advanced IP Address Subnetting
Topic Covered
1. Basics of Classful and Classless subnetting recap.
2. Binary representation of an IP address.
3. Method of calculating the number of subnets and hosts during subnetting.
4. Subnetting based on the number of subnets specified.
5. Subnetting based on the number of hosts specified.
Static, Default and Dynamic Routing
- Routing is a process which is performed by layer 3 (or network layer) devices in order to deliver the packet by choosing an optimal path
from one network to another.
- By default, the router knows only about the direct connected networks
TYPES OF ROUTING PROTOCOLS
a. Static Routing
- Static routing is a process in which we have to manually add routes in routing table.
- No CPU overhead, conserves bandwidth, adds security as only admin is allow to add routing of a network.
- Very tiresome in large topology.
a. Default Routing
- This is the method where the router is configured to send all packets towards a single router (next hop).
- It doesn’t matter to which network the packet belongs, it is forwarded out to router which is configured for default routing.
- It is generally used with stub routers. A stub router is a router which has only one route to reach all other networks.
a. Dynamic Routing
- Dynamic routing makes automatic adjustment of the routes according to the current state of the route in the routing table.
- Dynamic routing uses protocols to discover network destinations and the routes to reach it. RIP and OSPF are the best examples of dynamic routing protocol.
Automatic adjustment will be made to reach the network destination if one route goes down.
- Easy to configure and more effective in selecting best path.
- Consumes a lot of bandwidth, not secure as static routing.
A dynamic protocol have following features:
• The routers should have the same dynamic protocol running in order to exchange routes.
• When a router finds a change in the topology then router advertises it to all other routers.
Differences between Static and Dynamic Routing
Static Routing
• Basics of Routing Protocols
• Static Routing
• Default Static Routing
• Floating Static Routing
Static Routing
• Assign IP address to the router interface and hosts.
• Identify interfaces connecting between the routers
• Implement static Routing.
HOW TO IMPLEMENT STATIC ROUTING
Issue a ccomand: ip route x.x.x.x x.x.x.x outgoingInterface/nextHopIP
1. Static Route;
a. ip route 192.168.1.0 255.255.255.0 gig0/1
b. ip route 192.168.1.0 255.255.255.0 10.10.10.1
2. Default Static Route;
a. ip route 0.0.0.0 0.0.0.0 gig0/1
b. ip route 0.0.0.0 0.0.0.0 10.10.10.1
3. Floating Static Route; Backup Route
a. ip route 192.168.1.0 255.255.255.0 gig0/2 50
b. ip route 192.168.1.0 255.255.255.0 10.10.11.1 60
c. ip route 0.0.0.0 0.0.0.0 gig0/2 30
d. ip route 0.0.0.0 0.0.0.0 10.10.11.1 20
Routing Information Protocol (RIP)
- RIP is a dynamic routing protocol which uses hop count as a routing metric to find the best
path between the source and the destination network.
- It is a distance vector routing protocol with administrative distance value of 120.
- Rip uses port number 520 and works on the application layer of OSI model.
- Three versions RIPv1, RIPv2 and RIPng
Features of RIP
• Updates of the network are exchanged periodically.
• Updates (routing information) are always broadcast.
• Full routing tables are sent in updates.
• Routers always trust on routing information received from neighbor routers. This is also
known as routing on rumors.
Enhanced Interior Gateway Routing Protocol (EIGRP)
- Is an advanced distance vector routing protocol and supports classless routing and VLSM, route summarization, incremental updates,
load balancing and many other useful features.
- It is a cisco proprietary protocol, so all routers in a network that is running EIGRP must be cisco routers.
- Routers running EIGRP must become neighbors before exchanging routing information and they use multicast address of 224.0.0.10 to
discover neighbors.
- Administrative distance of EIGRP is 90 and it uses reliable transport protocol (RTP) for sending messages.
- EIGRP calculates its metric by using bandwidth, delay, reliability and load. By default, only bandwidth and delay are used when
calculating metric, while reliability and load are set to zero.
- EIGRP uses the concept of autonomous systems. Each router inside an autonomous system must have the same autonomous system
number configured, otherwise routers will not become neighbors.
- EIGRP tables
•Neighbor table – stores information about EIGRP neighbors
•Topology table – stores routing information learned from neighboring routers
•Routing table – stores the best routes
• Feasible and Reported distance
•Feasible distance (FD) – the metric of the best route to reach a network. That route will be listed in the routing table.
•Reported distance (RD) or Advertised distance (AD) – the metric advertised by a neighboring router for a specific route. It other words, it is the metric
of the route used by the neighboring router to reach the network.
• Successor and feasible successor
• A successor is the route with the best metric to reach a destination. That route is stored in the routing table.
• A feasible successor is a backup path to reach that same destination that can be used immediately if the successor route fails. These backup routes are stored
in the topology table.
•Condition for feasible successor: The neighbor’s advertised distance (AD) for the route must be less than the successor’s feasible distance (FD).
- R1 has two paths to reach the subnet 10.0.0.0/24. The path through R2 has the best metric (20) and it is stored in the r1’s routing table. The other route,
through R3, is a feasible successor route, because the feasibility condition has been met (r3’s advertised distance of 15 is less than r1’s feasible distance of
20). R1 stores that route in the topology table. This route can be immediately used if the primary route fails.
EIGRP Packets
i. Hello packets are used to establish and maintain EIGRP neighborship. Sent to multicast address of 224.0.0.10
ii. Update packets are used to send routing updates. With these update messages, topology tables and routing tables are built. Multicast
address of 224.0.0.10
iii. Query packets are used to ask for any routing update, requests an update. Multicast address of 224.0.0.10
iv. Reply packets are used as a response to the query packets. Unicast message
v. Ack packets are used as a feedback to the update, query or reply packets as a feedback mechanism. Unicast message
EIGRP States (Active And Passive)
• A destination in the topology table can be marked either as passive or active.
• A passive state is a state when the router has identified the successor(s) for the destination. The destination changes to active state when
the current successor no longer satisfies the feasibility condition and there are no feasible successors identified for that destination (i.e.
No backup routes are available).
• The destination changes back from active to passive when the router received replies to all queries it has sent to its neighbors. Notice that
if a successor stops satisfying the feasibility condition but there is at least one feasible successor available, the router will promote a
feasible successor with the lowest total distance (the distance as reported by the feasible successor plus the cost of the link to this
neighbor) to a new successor and the destination will remains in the passive state.
EIGRP Configuration
1. First Way
EIGRP configuration just like RIP configuration. Only two steps are required:
•Enabling EIGRP by using the router EIGRP ASN_NUMBER command
•Telling EIGRP which networks to advertise by using one or more network statements
2. Second Way
By default, the network command uses a classful network as the parameter. All interfaces inside that classful network will participate in the EIGRP
process. To enable EIGRP only on specific interfaces, a wildcard mask can be used
Open Shortest Path First (OSPF)
- This is a link state routing protocol.
- It is an open standard.
- Routers running OSPF have to establish neighbor relationships before exchanging routes.
- Because OSPF is a link state routing protocol, neighbors don’t exchange routing tables. Instead, they exchange information
about network topology.
- Each OSFP router then runs SFP algorithm to calculate the best routes and adds those to the routing table.
- Because each router knows the entire topology of a network, the chance for a routing loop to occur is minimal.
Features of OSPF:
i. A classless routing protocol
ii. Supports VLSM, CIDR, manual route summarization, equal cost load balancing.
iii. Incremental updates are supported
iv. Uses only one parameter as the metric – the interface cost.
v. The administrative distance of OSPF routes is, by default, 110.
vi. Uses multicast addresses 224.0.0.5 and 224.0.0.6 for routing updates
OSPF tables
•Neighbor table – stores information about OSPF neighbors
•Topology table – stores the topology structure of the network.
•Routing table – stores the best routes
OSPF Neighbors
 OSPF routers need to establish a neighbor relationship before exchanging routing updates.
 OSPF neighbors are dynamically discovered by sending hello packets out each OSPF-enabled interface on a router.
 Hello packets are sent to the multicast IP address of 224.0.0.5.
OSPF Packets
 Hello packet - sent on all interfaces for the purpose of establishing and maintaining neighbor relationships.
 Database Description Packet (DBD)- These packets describe topological database contents.
 Link State Request Packet (LSR)- For requesting the pieces of the neighbor’s database which are more up to date.
 Link State Update Packets (LSU)- Contains a list of the LSAs that are to be updated.
 Link State Acknowledge Packets (LSACK)- Acknowledges the packets sent out during flooding to ensure efficient use of floods.
OSPF Neighbor States
OSPF routers need to go through several state changes before establishing a neighbor relationship.
1. Init state – a router has received a hello message from the other OSFP router.
2. 2-way state – the neighbor has received the hello message and replied with a hello message of his own.
3. Exstart state –Routers start to exchange link state information.
4. Exchange state – DBD (database descriptor) packets are exchanged.
5. Loading state – one neighbor sends LSRs (link state requests) for every network it doesn’t know about. The other neighbor replies with the LSUs
6. Full state – both routers have the synchronized database and are fully adjacent with each other.
OSPF Areas
• OSPF uses the concept of areas. An area is a logical grouping of contiguous networks and routers.
• All routers in the same area have the same topology table, but they don’t know about routers in the other areas.
• The main benefits of creating areas is that the size of the topology and the routing table on a router is reduced, less time is required to run the SFP algorithm
and routing updates are also reduced.
ABR and ASBR
Area Border Router(ABR)- A router that has interfaces in more than one area (area 0 and area 1, for example)
Autonomous System Border Router (ASBR)- A router that connects an OSPF network to other routing domains (EIGRP network, for example)
OSPF Configuration
1. First Way 2. Second Way
Inter-VLAN Routing
• By default, devices in different VLANs cannot communicate.
• Therefore, to enable them to communicate, we should implement inter-VLAN routing.
• Thus, Inter-VLAN routing refers to a process in which we make different virtual LANs communicate with each other irrespective of
where the VLANs are present (on same switch or different switch).
• Inter VLAN Routing can be achieved through a layer-3 device i.e. Router or layer-3 Switch.
• When the Inter VLAN Routing is done through Router it is known as Route-on-a-stick (ROAS) while on a L3 switch it’s called Switch
Virtual Interface (SVI).
1. Route-on-a-stick (ROAS) 2. Switch Virtual Interface (SVI).
• The Router’s interface is divided into sub-interfaces, which acts as a default gateway to their respective VLANs
• A single SVI can be created for a VLAN. The SVI created for the respective VLAN acts as a default gateway for that VLAN.
DHCP Server Configuration
• To provide dynamic IP allocation
• DHCP Server Configuration on the Router
• DHCP Server Configuration on the L3-Switch
• DHCP Server Configuration on the dedicated DHCP server device.
• DHCP Server Configuration on the Firewall
• DHCP Server + Inter-VLAN Routing Configuration
• DHCP Server Configuration on the Router + inter-VLAN Routing
• DHCP Server Configuration on the L3-Switch + inter-VLAN Routing
• DHCP Server Configuration on the dedicated DHCP server device + inter-VLAN Routing
Network Address Translation (NAT)
• This is a concept to convert private IP addresses into public IP addresses and vice versa.
• To access the Internet, one public IP address is needed, but we can use a private IP address in our private network. The idea of NAT is to
allow multiple devices to access the Internet through a single public address.
• In other terms, NAT is a process in which one or more local IP address is translated into one or more Global IP address and vice versa in
order to provide Internet access to the local hosts
• Also, it does the translation of port numbers, i.e. masks the host’s port number with another port number, in the packet that will be routed
to the destination. It then makes the corresponding IP address and port number entries in the NAT table.
• This process is usually done by routers or firewalls.
• Host A request a web page from an Internet server. Because Host A uses private IP addressing, the source address of the request has to be
changed by the router because private IP addresses are not routable on the Internet. Router R1 receives the request, changes the source IP
address to its public IP address and sends the packet to server S1. Server S1 receives the packet and replies to router R1. Router R1
receives the packet, changes the destination IP addresses to the private IP address of Host A and sends the packet to Host A.
Types of NAT
1) Static NAT
- In this, a single unregistered (Private) IP address is mapped with a legally registered (Public) IP address i.e. one-to-one mapping between local and
global addresses. This is generally used for Web hosting.
- Suppose, if there are 1000 devices that need access to the Internet, the organization has to buy 1000 public addresses that will be very costly.
2) Dynamic NAT
- In this type of NAT, an unregistered IP address is translated into a registered (Public) IP address from a pool of public IP addresses. If the IP
address of the pool is not free, then the packet will be dropped as only a fixed number of private IP addresses can be translated to public addresses.
- Suppose, if there is a pool of 2 public IP addresses then only 2 private IP addresses can be translated at a given time. If 3rd private IP address wants
to access the Internet then the packet will be dropped therefore many private IP addresses are mapped to a pool of public IP addresses.
- NAT is used when the number of users who want to access the Internet is fixed. This is also very costly as the organization has to buy many global
IP addresses to make a pool.
3) Port Address Translation (PAT)
- This is also known as NAT overload. In this, many local (private) IP addresses can be translated to a single registered IP address.
- Port numbers are used to distinguish the traffic i.e., which traffic belongs to which IP address.
- This is most frequently used as it is cost-effective as thousands of users can be connected to the Internet by using only one real global (public) IP
address.
NAT Inside and Outside Addresses
• Inside refers to the addresses which must be translated. Outside refers to the addresses which are not in control of an organization.
• These are the network addresses in which the translation of the addresses will be done.
a) Inside local address – An IP address that is assigned to a host on the Inside (local) network. The address is probably not an IP address assigned by
the service provider i.e., these are private IP addresses. This is the inside host seen from the inside network.
b) Inside global address – IP address that represents one or more inside local IP addresses to the outside world. This is the inside host as seen from the
outside network.
c) Outside local address – This is the actual IP address of the destination host in the local network after translation.
d) Outside global address – This is the outside host as seen from the outside network. It is the IP address of the outside destination host before
translation.
NAT Advantages and Disadvantages
Advantages of NAT –
NAT conserves legally registered IP addresses.
It provides privacy as the device’s IP address, sending and receiving the traffic, will be hidden.
Eliminates address renumbering when a network evolves.
Disadvantage of NAT
Translation results in switching path delays.
Certain applications will not function while NAT is enabled.
Complicates tunneling protocols such as IPsec.
Also, the router being a network layer device, should not tamper with port numbers(transport layer) but it has to do so because of NAT.
HSRP (Hot Standby Routing Protocol)
• This is a layer 3 redundancy protocol that allows host devices in a network to access the internet trough
multiple paths.
• It’s a Cisco proprietary protocol that uses a multicast IP address of 224.0.0.2 and it is implemented either on a
router or layer 3 switch.
• HSRP routers includes the Active (the main router) and the Standby (the backup router).
• The Active router is the router with highest priority or highest IP address, and must only be one router.
• The Standby router is the router with lowest priority or lowest IP address, and can be more than one router.
• How it works;
• == all the traffic goes through the active/main router and in case the active router fails, the traffic
goes through the backup/standby router.
• Finally, the concept of virtual IP address
- This will be used as the default gateway of the source network
- It is also used as the standby IP address of the routers.