CHAPTER 2:
ROUTING
MTCNA TRAINING PROGRAM
Hendevane Training Partner | [Link] 1
Agenda
▪ Routing Overview
▪ Static Routing
▪ Dynamic Routing
Hendevane Training Partner | [Link] 2
CLICK TO EDIT MASTER TITLE
STYLE
Routing Overview
Hendevane Training Partner | [Link] 3
What Is Routing?
▪ To route, a router needs to do
the following:
▪ Know the destination address
▪ Identify the sources it can
learn from
▪ Discover possible routes
▪ Select the best route
▪ Maintain and verify routing
information
Hendevane Training Partner | [Link] 4
Routing Table
▪ Routers must learn destinations that are not directly
connected.
Hendevane Training Partner | [Link] 5
IP Routing Process
▪ Destination is local, send directly:
▪ Find the destination host’s MAC
address. Use the already-known
Address Resolution Protocol (ARP)
table entry, or use ARP messages to
learn the information
▪ Encapsulate the IP packet in a data link
frame, with the destination data link
address of the destination host
▪ Destination is not local, send to the
default gateway:
▪ Find the default gateway’s MAC
address. Use the already-known ARP
table entry, or use ARP messages to
learn the information.
▪ Encapsulate the IP packet in a data link
frame, with the destination data link
address of the default gateway.
Hendevane Training Partner | [Link] 6
IP Routing Process
Hendevane Training Partner | [Link] 7
Static vs Dynamic Routes
Static Route Dynamic Route
Uses a route that a Uses a route that a
network administrator network routing protocol
enters into the router adjusts automatically for
manually topology or traffic changes
Hendevane Training Partner | [Link] 8
CLICK TO EDIT MASTER TITLE
STYLE
Static Routing
Hendevane Training Partner | [Link] 9
Static Routing
▪ Static routing benefits
▪ There is no overhead on the router CPU
▪ There is no bandwidth usage between routers
▪ It adds security because the administrator can choose to allow routing
access to certain networks only
▪ Static routing disadvantages
▪ The administrator must really understand the internetwork and how
each router is connected in order to configure routes correctly
▪ If a network is added to the internetwork, the administrator has to add
a route to it on all routers—by hand
▪ It’s not feasible in large networks because maintaining it would be a
full-time job in itself
Hendevane Training Partner | [Link] 10
Dynamic Routing Protocols
▪ Dynamic routing is when
protocols are used to find
networks and update routing
tables on routers
▪ This is easier than using static
or default routing, but it’ll cost
you in terms of router CPU
processes and bandwidth on
the network links
Hendevane Training Partner | [Link] 11
Dynamic Routing Protocols
▪ Autonomous Systems: Interior or Exterior Routing Protocols
▪ An autonomous system is a collection of networks under a
common administrative domain
▪ IGPs operate within an autonomous system
▪ EGPs connect different autonomous systems
Hendevane Training Partner | [Link] 12
Best Route Concept
▪ Router will choose route base Routing Protocol Default Distance
on connected routes 0
▪ Distance
static routes 1
▪ Router will choose smaller
distance eBGP 20
▪ More specific destination OSPF 110
address
RIP 120
▪ Example: Destination
[Link]/24 is more specific MME 130
than [Link]/16
iBGP 200
Source: [Link] Hendevane Training Partner | [Link] 13
Route flags
▪ View route flags IP > Routes > Routes
▪ Destination: Network which can be reached
▪ Gateway: IP of the next router to reach the destination
1 3
Source: [Link] Hendevane Training Partner | [Link] 14
Route flags
▪ Route flag property
Property(Flag) Description
disabled (X) Configuration item is disabled
active (A) Route is used for packet forwarding
dynamic (D) Configuration item created by software, not by management interface.
connect (C) connected route.
static (S) static route.
rip (r) RIP route
bgp (b) BGP route
ospf (o) OSPF route
mme (m) MME route
blackhole (B) Silently discard packet forwarded by this route
unreachable (U) Discard packet forwarded by this route
prohibit (P) Discard packet forwarded by this route
Source: [Link] Hendevane Training Partner | [Link] 15
Default Gateway
▪ Default Gateway: next hop router where all ([Link]) traffic is
sent
1 33 5
6
4
[admin@ST-1] > ip route print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
2 0 ADS [Link]/0 [Link] 0
1 ADC [Link]/24 [Link] wlan1 0
2 ADC [Link]/24 [Link] ether1 0
Hendevane Training Partner | [Link] 16
Static Route Example
Verify Routing Table (example ST-1) Verify Routing Table (example ST-2)
[admin@ST-1] > ip route print [admin@ST-2] > ip route print
Flags: X - disabled, A - active, D - dynamic, Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE # DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADS [Link]/0 [Link] 0 0 ADS [Link]/0 [Link] 0
1 ADC [Link]/24 [Link] wlan1 0 1 ADC [Link]/24 [Link] wlan1 0
2 ADC [Link]/24 [Link] ether1 0 2 ADC [Link]/24 [Link] ether1 0
Source: [Link] Hendevane Training Partner | [Link] 17
Static Route Example
▪ Add static route in Router ST-1 to reach LAN ST-2
1 3 4
5
/ip route
add distance=1 dst-address=[Link]/24
2 gateway=[Link]
Source: [Link] Hendevane Training Partner | [Link] 18
Static Route Example
▪ Add static route in Router ST-2 to reach LAN ST-1
1 3 4
5
/ip route
2 add distance=1 dst-address=[Link]/24
gateway=[Link]
Source: [Link] Hendevane Training Partner | [Link] 19
Static Route Example
▪ Verify Static Route using ▪ Verify Static Route using
(example ST-1) (example ST-2)
[admin@ST-1] > ip route print [admin@ST-2] > ip route print
Flags: X - disabled, A - active, D - dynamic, Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE # DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADS [Link]/0 [Link] 0 0 ADS [Link]/0 [Link] 0
1 ADC [Link]/24 [Link] wlan1 0 1 ADC [Link]/24 [Link] wlan1 0
2 ADC [Link]/24 [Link] ether1 0 2 A S [Link]/24 [Link] 1
3 A S [Link]/24 [Link] 1 3 ADC [Link]/24 [Link] ether1 0
Hendevane Training Partner | [Link] 20
Static Route Example
▪ Verify Connectivity from ST-1 to ST-2 LAN
[admin@ST-1] > ping [Link] count=5
SEQ HOST SIZE TTL TIME STATUS
0 [Link] 56 64 30ms
1 [Link] 56 64 44ms
2 [Link] 56 64 8ms
3 [Link] 56 64 1ms
4 [Link] 56 64 5ms
sent=5 received=5 packet-loss=0% min-rtt=1ms avg-rtt=17ms max-rtt=44ms
▪ Verify Connectivity from ST-2 to ST-1 LAN
[admin@ST-2] > ping [Link] count=5
SEQ HOST SIZE TTL TIME STATUS
0 [Link] 56 64 9ms
1 [Link] 56 64 5ms
2 [Link] 56 64 3ms
3 [Link] 56 64 24ms
4 [Link] 56 64 1ms
sent=5 received=5 packet-loss=0% min-rtt=1ms avg-rtt=8ms max-rtt=24ms
Hendevane Training Partner | [Link] 21
Saving Configuration
▪ Saving static route configuration on every router
1 2
3
4
Hendevane Training Partner | [Link] 22
CLICK TO EDIT MASTER TITLE
STYLE
Dynamic Routing
Hendevane Training Partner | [Link] 23
OSPF
▪ MikroTik RouterOS implements OSPF version 2 (RFC 2328)
▪ The OSPF protocol is the link-state in the dynamic network
structure
▪ It always chooses shortest path to the destination
▪ OSPF allows collections of routers to be grouped together
called an area
▪ Each area runs a separate copy of the basic link-state routing
algorithm
▪ Minimize routing update
Source: [Link] Hendevane Training Partner | [Link] 24
OSPF Header
Hendevane Training Partner | [Link] 25
OSPF Concepts
▪ OSPF Hierarchical Routing
▪ Consists of areas and
autonomous systems
▪ Minimizes routing update
traffic
▪ Supports VLSM
▪ Unlimited hop count
Hendevane Training Partner | [Link] 26
OSPF Backbone Area Example
▪ Delete current static route on every router
[admin@ST-1] > ip route print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADS [Link]/0 [Link] 0
1 ADC [Link]/24 [Link] wlan1 0
2 ADC [Link]/24 [Link] ether1 0
3 A S [Link]/24 [Link] 1
[admin@ST-1] > ip route remove 3
Hendevane Training Partner | [Link] 27
OSPF Backbone Area Example
▪ Decide network 3
and area 4/7
1
5 6
8 9
2
“Wait unit your partner finished”
[admin@ST-1] > routing ospf network add network=[Link]/24 area=backbone
[admin@ST-1] > routing ospf network add network=[Link]/24 area=backbone
Hendevane Training Partner | [Link] 28
OSPF Backbone Area Example
▪ Automatically select network interface
3
“Wait unit your partner finished”
2
[admin@ST-1] > routing ospf interface print
Flags: X - disabled, I - inactive, D - dynamic, P - passive
# INTERFACE COST PRIORITY NETWORK-TYPE AUTHENTICATION AUTHENTICATION-KEY
0 D wlan1 10 1 broadcast none
1 D ether5 10 1 broadcast none
Hendevane Training Partner | [Link] 29
OSPF Backbone Area Example
▪ Verify Routing Table
1
[admin@ST-1] > ip route print
Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
2 # DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADS [Link]/0 [Link] 0
1 ADC [Link]/24 [Link] wlan1 0
2 ADC [Link]/24 [Link] ether5 0
3 ADo [Link]/24 [Link] 110
Hendevane Training Partner | [Link] 30
Saving Configuration
▪ Saving OSPF configuration on every router
1 2
3
4
Hendevane Training Partner | [Link] 31
THANK YOU
Hendevane Training Partner | [Link] 32