MTCRE Old - 1
MTCRE Old - 1
(MTCRE)
Yangon, Myanmar
Jun 2 - Jun 4, 2017
MikroTik Certified Courses
Introduction
MTCNA
Course
MTCINE
• Emergency exits
• Bathroom location
Sithu Aung 3
Class Setup
12.0.0.0/24 56.0.0.0/24
R1 e2 e1 R2 R5 e2 e1 R6
e3 e3 e3 e3
13.0.0.0/24 24.0.0.0/24 57.0.0.0/24 68.0.0.0/24
e1 e2 e1 e2
e3 e3 e3 e3
R3 R4 R7 R8
34.0.0.0/24 78.0.0.0/24
90.0.0.0/24
R9 e2 e1 R10
e3 e3
135
91.0.0.0/24 102.0.0.0/24
e1 e2
e3 e3
R11 R12
112.0.0.0/24
Sithu Aung 4
Class Setup
13.0.0.0/24 24.0.0.0/24
e1 e2
e3 e3
R3 R4
34.0.0.0/24
192.168.X.1/24
192.168.X.2/24
Sithu Aung 5
Simple Routing
Distance, Policy Routing, ECMP, Scope, Recursive Next-
Hop Resolving
Sithu Aung 6
Routing Components
Sithu Aung 7
Routing Information Base (RIB)
Sithu Aung 8
Routing Information Base (RIB)
Sithu Aung 9
Routing Information Base (RIB)
Sithu Aung 10
Forwarding Information Base
(FIB)
• FIB contains information of prefixes related to the network interfaces
that could be used to forward packets.
• Routing tables are generally not used directly for packet forwarding in
modern router architectures
• RIB are used to generate the information for a smaller forwarding table.
• A forwarding table contains only the routes which are chosen by the
routing algorithm as preferred routes for packet forwarding.
Sithu Aung 11
Routing Table & Routing Cache
Routing Table:
Destination Next Hop Interface
192.168.0.0/24 1.1.1.1 eth1
Routing Cache:
Destination Next Hop Interface
192.168.0.10 1.1.1.1 eth1
192.168.0.20 1.1.1.1 eth1
Sithu Aung
FIB and Routing Cache
13
Lookups at the routing table
Drop
Packet Packet
Miss
Hit
Hit Hit
Route/deliver
Packet
Sithu Aung 14
Connected Routes
Sithu Aung 15
Static Routes
16
Simple Static Route
Sithu Aung 17
Default Route
• A default route is a route with destination 0.0.0.0/0, that means all IPv4
address space (0.0.0.1–255.255.255.255). If a routing table contains at least
one default route active, then route lookup will never fail.
Sithu Aung 18
Dynamic Routes
• RIP
• OSPF
• BGP
• MME
Sithu Aung 19
Multiple Matches in a Routing
Table
In a routing table, if there is only one route toward each destination
address, routing lookups would be trivial. As soon a router finds a route
whose destination subnet includes the destination address, packet will
be forwarded.
Sithu Aung 20
Longest Prefix Match
When a packet has multiple matches, longest prefix match (more specific
networks) will be preferred.
DST-ADDRESS GATEWAY
192.168.0.0/24 1.1.1.1
192.168.0.0/25 2.2.2.2
192.168.0.0/26 3.3.3.3
0.0.0./0 4.4.4.4
35
Sithu Aung 21
Routes Processing
Sithu Aung 22
Distance
• Distance refers to the reliability of the route. If
there is more than one destination to the same
network prefix, the less distance will be chosen.
• Connected routes: 0
• Static routes: 1
• eBGP: 20
• OSPF: 110
• RIP: 120
• MME:130
• iBGP:200
23
“Distance” Option
• To prioritize one route over another, if they both point to the same
network, using “distance” option.
• When forwarding a packet, the router will use the route with the
lowest distance and reachable gateway
Sithu Aung 24
Route Distance Lab
Sithu Aung 25
Configuration Examples
Sithu Aung 26
Configuration Example
Sithu Aung 27
Questions
Sithu Aung 28
ECMP Routes
Sithu Aung 29
“Check-gateway” Option
• You can set router to check gateway reachability using ICMP (ping)
or ARP protocols
• If gateway is unreachable in a simple route – the route will become
inactive
• If one gateway is unreachable in an ECMP route, only the reachable
gateways will be used in the Round Robin algorithm
• If Check-gateway option is enabled on one route it will affect all
routes with that gateway.
Sithu Aung 30
Observed Behaviour
Sithu Aung 31
Routing Mark
Sithu Aung 32
Routing Policy Lab
Sithu Aung 33
Mark Routing Rule Example
Sithu Aung 34
Configuration Example
Sithu Aung 35
Time To Live (TTL)
Sithu Aung 36
Changing TTL
Sithu Aung 37
Scope and Target-Scope
Sithu Aung 38
Scope/Target-Scope
• Route's scope contains all routes that “scope” value is less or equal
to its “target-scope” value
• Example:
• 0 ADC dst-address=1.1.1.0/24 pref-src=1.1.1.1 interface=ether1
scope=10 target-scope=0
• 1 A S dst-address=2.2.2.0/24 gateway=1.1.1.254 interface=ether1
scope=30 target-scope=10
• 2 A S dst-address=3.3.3.0/24 gateway=2.2.2.254 interface=ether1
scope=30 target-scope=30
Sithu Aung 39
Scope/Target-Scope
Sithu Aung 40
Scope and Target-Scope
Example
R1 R1 R2
A router has an IP address 1.1.1.1/24 configured in one of its interface and thus, it
has a connected route 1.1.1.0/24 pointing to that interface.
One route to network 2.2.2.0/24 pointing to, e.g. 1.1.1.2 will be installed normally but
another to 3.3.3.0/24 pointing to 2.2.2.2 will become inactive
Sithu Aung 41
Scope and Target-Scope
Example
R1 R1 R2
Changing Target scope to a value >= 30 will turn the route active (will be installed on
FIB). The route will appear as recursive.
62
Sithu Aung 42
Recursive Next-hop Resolving
Sithu Aung 43
Other Options
• Prohibit: Discard packet forwarded by this route. Notify sender with ICMP
communication administratively prohibited (type 3 code 13) message.
• Unreachable: Discard packet forwarded by this route. Notify sender with ICMP
host unreachable (type 3 code 1) message.
• “Preferred Source” option points preferred router source address for locally
originated packets
Sithu Aung 44
Distance
Sithu Aung 45
Open Shortest Path First
(OSPF)
• Areas, Costs,Virtual links,
Route Redistribution and Aggregation
Sithu Aung 46
Introduction
OSPF Protocol
Sithu Aung 48
Autonomous System (AS)
Sithu Aung 49
How OSPF Works
How OSPF Works
Flood LSAmessages
Sithu Aung 50
How OSPF Works
Sithu Aung 51
OSPF Area
OSPF Area
Sithu Aung 53
OSPF Area
Sithu Aung 54
OSPF Areas
Sithu Aung 55
OSPF Area
Area 2 Area 3
Area 0
Backbone Area
Area 1
Area 4
Sithu Aung 56
Backbone Area
Sithu Aung 57
OSPF Areas
Sithu Aung 58
Router Types
Router Classification
Area Area
ABR/
Area
ASB
To another
Sithu Aung 60
OSPF Route Types
ABR
Intra-Area Route
ASBR – All routes within an area
To Another AS Inter-Area Route
– Routes announced from area to
another by an ABR
External Route
– Routes imported into OSPF
from another protocol or Static
routes
61
Inter-Area Route
Summarization
• Prefix or all subnets
• Prefix or all networks
• ‘Area range’ command
R2
FDDI Backbone
Dual Ring Area 0
Sithu Aung 62
External Routes
RIP
IGRP
EIGRP
OSPF BGP
etc.
Redistribute
Sithu Aung 63
Router Types
Sithu Aung 64
Network Adjacencies
Establishing Network
Adjacencies
Sithu Aung 66
Neighbourhood Adjacencies
Sithu Aung 67
Establishing Network
Adjacencies
• On point-to-point links, neighbors become fully adjacent.
Sithu Aung 68
Finding the Best Paths
Sithu Aung 69
Finding the Best Paths
Sithu Aung 70
OSPF Packets
Protocol ID 89 (OSPF)
Sithu Aung 71
OSPF Packet Types and Format
Sithu Aung 72
OSPF Packet Types and Format
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
Version(1byte) Type(1byte) PacketLength(2bytes)
RouterID(4bytes)
AreaID(4bytes)
Checksum(2bytes) AuthenticationType(2bytes)
Authentication(4bytes)
Authentication(4bytes)
Sithu Aung 73
Establishing Adjacencies Hello
Protocol
On Broadcast networks each interface
engaged in OSPF uses IP multicast
address 224.0.0.5 to send hello packets
periodically.
74
Establishing Communication and
Exchanging LSDB’s
Down State
192.168.1.1/24 192.168.1.2/24 R2
R1
eth2 eth3
Init State
I am router 192.168.1.1 and I see no one Hello
to 224.0.0.5
2-way state
Hello to I am router 192.168.1.2 and I see 192.168.1.1
192.168.1.1
Exchange State
DBD to Here is a summary of my LSDB R2
192. 168.1.1
Loading State
I request information about network 192.168.1.0/24 LSR to
192.168.1.2
92
Sithu Aung 78
Link State Sequence Numbers
Sithu Aung 79
Loopback Interfaces
Sithu Aung 80
OSPF - Router ID
81
Network Type
Network Types in OSPF
• Broadcast Networks
• A multi access broadcast network, like Ethernet
• Non-broadcast Multi Access or NBMA
• Networks supporting many (more than two) routers, but having no
broadcast capability.
• Point-to-Point
• A network that joins a single pair of routers
• Point-to-Multipoint
• Special type of NBMA, consisted of collection of point-to-point links
Sithu Aung 83
Broadcast Multi-access Network
84
Designated Routers
Sithu Aung 85
OSPF Adjacencies for BMA
Networks
• 3 types of routers as show:
• DR
• BDR
• DROther
Sithu Aung 86
BR & BDR Election Process
• The default 1.
• If you don’t want a router to take part in the election process, set
the priority to 0.
Sithu Aung 87
BR & BDR Election Process
• The first router on the network becomes the DR. The next will
become with BDR. Other routers will accept these 2 routes as DR
and BDR, and form adjacencies with them.
Sithu Aung 88
Non Broadcast Multi-Access
(NMBA)
• Neighbors must be manually
configured
• It is necessary to have a DR and
BDR
Frame
• DR and BDR must have full physical Relay
connectivity with all other routers
• Protocol packets are sent to each
neighbors unicast address.
• Requires manual configuration of
neighbors
89
NBMA Neighbors
Sithu Aung 90
Point-to-Point Interfaces
91
Point-to-multipoint (PTMP)
92
Network Types
Sithu Aung 93
LSA Type
Different Types of LSAs
Sithu Aung 95
Router LSA(Type 1)
Area 0 Area 1
Area 2
Sithu Aung 96
Router LSA(Type 1)
• Has information on all router links in the area, including the status
and cost for each link.
• All the router’s links in an area must be described in a single LSA
• Flooded throughout the particular area and not beyond
• Router indicates whether it is an ASBR, ABR, or the end point of a
virtual link
• Does not cross the ABR or ASBR.
• Sent by router to all other routers in an area
Sithu Aung 97
Network LSA(Type 2)
Area 0 Area 1
DR
DR
Area 2
DR
Sithu Aung 98
Network LSA (Type 2)
• Generated for every transit broadcast or NBMA network
• Describes all the routers attached to the network
• Only the DR originates this type of LSA
• Flooded throughout the area and not beyond
• Generated by the DR
• DR uses this to send information about the state of other
routers that are part of the network.
• Only sent to routers in the area containing the specific network.
Sithu Aung 99
Summary LSA(Type 3)
Area 0 Area 1
Type 3
Type 3
Area 2
Type 3
Type 3
Area 0 Area 1
Type 4
ABR
ASBR
Area 2
Type 4
ABR
Area 0 Area 1
Type 5
External AS ABR
Type 5
ASBR
Area 2
Type 5
ABR
Area 0 Area 1
Type 7
Type 5
ABR
ASBR
Area 2
ABR
• Type 7 LSA
• Called NSSA (Not-So-Stubby-Area) external LSA.
• Help overcome limitations of an ASBR not being able to belong
to a stub area.
• Only generated by an ASBR in a NSSA.
• The LSA propagates across the area to the ASBR.
• When it gets to the ABR, the ABR converts the Type 7 LSA to a
Type 5 LSA and propagates it to the backbone.
• Advertises routes external to the OSPF AS.
LSA Type 2
LSA Type 1
LSA Type 3
• Not-So-Stubby-Area (NSSA)
• Don’t propagate Type 5 LSA. So an ASBR can’t be a part of a
stub area.
• Sometimes, though, there is limited need to import external
routes into an area, which is where the NSSA’s that allow an
ASBR to take part in an area, are useful.
• Rather than have the ASBR send out a Type 5 LSA, it will send
out a Type 7 NSSA External LSA.
• Type 7 LSA can’t be advertised into another OSPF area. So, the
ABR in the NSSA gets the Type 7 LSA and translates it into a
Type 5 LSA.
• The Type 5 LSA is then allowed to flood the OSPF AS.
111
Route Cost
àCosts are computed per interface (egress interface)
à Route fromAto B has 2 ways, One with total cost = 30 and
other total cost = 20
112
Routes Redistribution
à Routes that are not part of
OSPF domain can be
redistributed inside OSPF
113
Routes Redistribution
Dynamic, connected and static routes that are
not part of OSPF domain can be redistributed.
114
What to Redistribute?
1
2
3
} 5
4 {
Cost=10
Cost=10
Cost=10
Cost=10
Total Cost=40
Source
Destination
Cost=9
ASBR
Cost
trivial
Cost=10 Cost
Cost trivial
trivial
Total Cost=10
Source
Cost
Total Cost=9 trivial
Cost
trivial
Destination
Cost=9
ASBR
• The cost of the whole path = the sum of the costs of the outgoing
interfaces along that path.
122
Totally Stub Area
123
Stub and Totally Stub Area
• StubArea
• Do not accept external LSA’s
• Accept summary
125
NSSA Areas
126
NSSA Areas
127
NSSA and Stub Areas
• The options
• Inject summary LSA’s can be
checked for Stub and NSSAareas.
• In this case LSAsummaries (LSA’s
3 and 4) will not crossABR’s.
128
1
ABR
ABR 2
4 ASBR 100
ABR
5 ASBR 100
ABR
ASBR
500
Sithu Aung 129
Stub
1,2,3+Default
(4,5)
ABR
Totally Stub
NSSA
1,2,7+Default
(3,4,5) ASBR 100
ABR
ASBR
500
Sithu Aung 130
Security
Authentication
132
Passive interface
133
Virtual Link
Virtual Links
Virtual Link
Area 0 Area 1 Area 2
R1 R2 R3 R4
136
SHAM Links
SHAM Link
• In the above scenario, the path over the backdoor link will always
be selected because OSPF prefers intra-area paths over inter-area
paths
• OSPF cost configured with a SHAM link allows you to decide if
OSPF client site traffic will be routed over a backdoor link or
through the VPN backbone.
137
OSPF Virtual Links
2.2.2.0/24 1.1.1.0/24
Any Ethernet
Network
vlan1: 1.1.1.1/24
vlan2: 2.2.2.1/24
vlan3: 3.3.3.1/24
3.3.3.0/24
P2P_int2: 2.2.2.2/30
P2P_int3: 3.3.3.2/30
Any IP network
(LAN, WAN, Internet)
Tunnel1: 1.1.1.1/30
Tunnel2: 2.2.2.1/30
P2P_int1: 1.1.1.2/30 Tunnel3: 3.3.3.1/30
• Point-to-point addressing utilizes only two IPs per link while /30
utilizes four IPs
• There is no broadcast address, but network address must be set
manually to the opposite IP address. Example:
• Router1: address=1.1.1.1/32, network=2.2.2.2
• Router2: address=2.2.2.2/32, network=1.1.1.1
• There can be identical /32 addresses on the router – each address
will have different connected route
Network: 1.1.1.1
P2P_int1: 2.2.2.2/32
00:00:5E:80:00:00 - 00:00:5E:FF:FF:FF
00:00:5E:80:00:00 - 00:00:5E:FF:FF:FF
Any IP network
(LAN, WAN, Internet)
Bridge Bridge
• Replace all IPIP tunnels (from previous lab) with EOIP tunnels
• Check that you are able to ping remote address before creating a
tunnel to it
• Bridge all EoIP interfaces with local interface
• Check Winbox Loader neighbour discovery feature (“...” button)