Mikrotik Routeros Training Inter-Networking
Mikrotik Routeros Training Inter-Networking
Mikrotik Routeros Training Inter-Networking
Overview
MikroTik RouterOS
● BGP
Training ● BGP Basics (iBGP, eBGP)
● Distribution, filtering and BGP attributes
Inter-Networking ● MPLS
● Introduction to MPLS
● LDP
● L2 and L3 VPN's
● Traffic Engineering
©Mikrotik 2012 2
192.168.x4.0/24
©Mikrotik 2012 3 ©Mikrotik 2012 4
Autonomous system
● Set of routers under a single administrative
control
Border Gateway Protocol ● Routing exchange:
(BGP) ● Routers within AS use common IGP
● Routers between ASs use EGP
● Has its own number (ASN)
● Supports 16-bit value and 32-bit value
● Numbers 64 512 – 65 534 reserved for private use
Internetworking 1
8/28/2014
Internetworking 2
8/28/2014
● Configurable from
/routing bgp network
©Mikrotik 2012 15 ©Mikrotik 2012 16
Internetworking 3
8/28/2014
192.168.x4.0/24
©Mikrotik 2012 19 ©Mikrotik 2012 20
Internetworking 4
8/28/2014
192.168.x4.0/24
©Mikrotik 2012 25 ©Mikrotik 2012 26
Setting eBGP to Loopback addresses can protect BGP from DOS attacks
Internetworking 5
8/28/2014
Internetworking 6
8/28/2014
/routing filter add prefix=10.1.0.0/16 prefix-length=16-32 \ /routing filter add chain=bgp-out action=discard \
chain=bgp-out action=discard bgp-as-path=_200_
Internetworking 7
8/28/2014
Dst: 172.16.0.0/24
● Lowest MED (default 0) R1 10.1.1.1 next-hop:10.1.1.1
172.16.0.0/24
● Prefer eBGP over iBGP R3
10.1.1.2 R2
● Prefer the route with lowest router ID or ORIGINATOR_ID 10.30.1.1 10.30.1.2
AS200
● Shortest route reflection cluster (default 0)
● Prefer the path that comes©Mikrotik
from 2012the lowest neighbor address 45 ©Mikrotik 2012 46
Dst: 172.16.0.0/24
AS200
AS100 next-hop:10.1.1.1 AS100
Dst: 172.16.0.0/24
R1 10.1.1.1 next-hop:10.30.1.1 R3
R1
172.16.0.0/24
R3 172.16.0.0/24
10.1.1.2 R2 172.16.0.0/24 Weight=50
R2
Weight=100
10.30.1.1 10.30.1.2
AS200 AS300
Internetworking 8
8/28/2014
R4 Local-pref = 100
Local-pref = 200 R2 R4
R3
AS-path: 300,200,100
Prepend = 2 R2
172.16.0.0/24 AS300
Internetworking 9
8/28/2014
R2 192.168.x3.0/24 R3
● No-export – do not advertise to eBGP peer
● No-advertise – do not advertise to any peer
192.168.x4.0/24
R4 ● Internet – advertise to Internet community
192.168.x2.0/24
AS1x2
● Local-as – do not send outside local AS (in non-
confederation network the same as no-export)
192.168.x4.0/24
Use as-path prepend to set up BGP fail-over and load sharing as illustrated
©Mikrotik 2012 55 ©Mikrotik 2012 56
AS100
● Gives customer more policy control
AS300
R3 AS200
R1 ● Simplifies upstream configuration
R2 ● Can be used by ISPs for:
– AS prepending options
– Geographic restrictions
# config on R1
– Blackholing, etc.
/routing filter add chain=bgp-out action=passthrough \
set-bgp-communities=no-export ● Check Internet Routing Registry (IRR)
©Mikrotik 2012 57 ©Mikrotik 2012 58
Internetworking 10
8/28/2014
# config on R3
/routing bgp aggregate add instance=default summary-only=yes \ R2
prefix=10.0.0.0/8 action=passthrough inherit-attributes=no R2 RR
Internetworking 11
8/28/2014
AS200 AS100
AS-Path: 100,300 R9
R8 AP 192.168.x3.0/24
R1
R3 R4 Confederation
AS xx00 AS1x1
AS20
R1
AS-Path:(20,30) R3
R2
AS10 R5 R6
R2 AS1x2
AS30 R4
AS100
AS400
192.168.x2.0/24
R7
192.168.x4.0/24
©Mikrotik 2012 67 ©Mikrotik 2012 68
BGP Instances
● Each BGP instance runs its own BGP selection
algorithm
Multi-protocol Label Switching
Routes between instances are elected by other
(MPLS)
●
Internetworking 12
8/28/2014
AS100
● Reset router's configuration
AP
10.20.0.1/24
192.168.x3.0/24
● Set up configuration as illustrated
R1 192.168.x.1/30
10.20.0.x1/24 ● Set up loopback addresses and run OSPF on
Lo:10.255.x.1
all links
10.20.0.x2/24 192.168.x.2/30
R3 Lo:10.255.x.3
Lo:10.255.x.2 R2
192.168.x.5/30
● Add loopback addresses to OSPF networks
192.168.x.9/30
192.168.x.10/30
192.168.x.6/30 R4
Lo:10.255.x.4
192.168.x2.0/24
192.168.x4.0/24
©Mikrotik 2012 73 ©Mikrotik 2012 74
Services”:
Label is removed at
● Layer3 VPNs MPLS egress LER
Backbone
● Any Transport over MPLS (AtoM), Layer2 VPNs
● MPLS Traffic Engineering
● Guaranteed bandwidth services
©Mikrotik 2012 75 ©Mikrotik 2012 76
Internetworking 13
8/28/2014
Internetworking 14
8/28/2014
Reserved Labels
● Labels from 0 to 15 are reserved, but only 4 are
used at this point:
● 0 – explicit NULL PHP
Implicit NULL
● 1 – router alert
● 2 – Ipv6 explicit NULL
● 3 – implicit NULL 0
PHP
Explicit NULL
Internetworking 15
8/28/2014
Internetworking 16
8/28/2014
VRF
● Virtual Routing and Forwarding
● Based on policy routing
● Functionality of completely independent routing
Layer3 VPN
tables on one router.
VRF
● Multiple VRFs solves the problem of
overlapping customer IP prefixes
● When nexthop resolving fails it is not resolved
in main table (compared to policy routing)
VPN B
● Multiprotocol BGP is used to distribute routes Site 2
PE PE
between VRFs even in router itself.
CE
● Provider network MUST be MPLS enabled CE
VPN B PE VPN A
Site 1 Site 2
CE
VPN A
BGP
VPN B Site 3
OSPF as CE-PE
Site 3
©Mikrotik 2012 101 ©Mikrotik 2012 102
Internetworking 17
8/28/2014
Import: 100:3
100:2 ● Configure BGP to use VRF and vpnv4 address
Export: 100:1
family
/routing bgp instance vrf
Import: 100:1
Export: 100:3 CE add instance=default routing-mark=vrf1 \
VPN A Import: 100:2 redistribute-connected=yes
Export: 100:4 VPN B /routing bgp peer
Site 2 Site 2
CE add address-families=vpnv4 update-source=lo ...
● Results
©Mikrotik 2012 105 /routing bgp vpn vpnv4-route
©Mikrotik 2012 print 106
Internetworking 18
8/28/2014
Internetworking 19
8/28/2014
RR
● Bridge VPLS interfaces with local interface on AP 192.168.x0.3/24
R1 Site 3
your router. VPN network:
192.168.x0.0/24
Lo:10.255.x.1
● VPN network is 192.168.x0.0/24 where:
R2 R3 Lo:10.255.x.3
Lo:10.255.x.2
● x - group number
● Set up Split horizon to avoid loops Site 2
R4
● Test connectivity between laptops in your group Lo:10.255.x.4
192.168.x0.2/24 Site 4
192.168.x0.4/24
©Mikrotik 2012 117 ©Mikrotik 2012 118
Internetworking 20
8/28/2014
● MPLS MTU is adjustable from L2MTU: 1526 Eth(14) MPLS(4)VPLS(4) CW(4) Eth(14) IP(20) DATA(1480)
“/mpls interface” menu R2
● If MTU is too large and next header is IP L2MTU: 1526 Eth(14) MPLS(4)VPLS(4) CW(4) Eth(14) IP(20) DATA(1480)
IP (L3) MTU
R4
MPLS MTU
L2 MTU L2MTU: 1500 Eth(14) IP(20) DATA(1480)
Full Frame
Internetworking 21
8/28/2014
IP Routing Limitation
● After two IP traffic flows for the same
destination are merged, it is impossible to split
them and reroute over different paths
Traffic Engineering
● Overloaded link from Router C to Router E
E
A C F
D
40Mbps traffic from A to F
B 40Mbps traffic from B to F
D
● Eliminates the need of overplayed L2 mesh.
B TE Tunnel1 50Mbps
TE Tunnel2 50Mbps
Internetworking 22
8/28/2014
TE configuration TE configuration
● OSPF Result (should have opaque LSAs) ● TE tunnel path and reservation state
[admin@R2] /mpls traffic-eng path-state> print
● TE tunnel monitoring Flags: L - locally-originated, E - egress, F - forwarding, P - sending-
path, R - sending-resv
[admin@R2] /interface traffic-eng> monitor 0 # SRC DST BANDWIDTH OUT.. OUT-NEXT-HOP
tunnel-id: 3 0 LFP 10.255.1.2:1 10.255.1.3:3 10.0Mbps R2_R4 10.20.0.11
primary-path-state: established [admin@R2] /mpls traffic-eng resv-state> print
primary-path: rt Flags: E - egress, A - active, N - non-output, S - shared
secondary-path-state: not-necessary # SRC DST BANDWIDTH LABEL INT...
active-path: rt 0 AS 10.255.1.2:1 10.255.1.3:3 10.0Mbps 124 R2_R4
active-lspid: 1
active-label: 124 [admin@R2] /mpls traffic-eng interface> print
recorded-route: 192.168.1.1[124],192.168.1.2[0] Flags: X - disabled, I - invalid
reserved-bandwidth: 10.0Mbps # INTERFACE BANDWIDTH TE-METRIC REMAINING-BW
0 R2_R1 50Mbps 1 50.0Mbps
[admin@R2] /interface vpls> monitor 0 1 R2_R4 50Mbps 1 40.0Mbps
remote-label: 114
local-label: 113
remote-status:
transport: traffic-eng1
transport-nexthop: 10.20.0.11
imposed-labels: 124,114
Internetworking 23
8/28/2014
hops: A C
E
F
● Strict - defines that there must not be any other hops
between previous hop and "strict" hop (fully specified D
path)
B
10.1.2.1
● Loose - there are acceptable other hops between
10.1.0.1
previous hop and defined hop (not fully specified path).
10.1.2.1:loose
/mpls traffic-eng tunnel-path 10.1.1.1:strict,10.1.2.1:strict, 10.1.4.1:loose
add use-cspf=no \
hops=10.1.1.1:strict,10.1.3.1:loose,10.1.4.1:strict 10.1.1.1:strict,10.1.2.1:strict,10.1.3.1:strict,10.1.4.1:strict
Site 2
R4
Lo:10.255.x.4
192.168.x0.2/24 Site 4
192.168.x0.4/24
©Mikrotik 2012 141 ©Mikrotik 2012 142
Internetworking 24
8/28/2014
Lo:10.255.x.4
192.168.x0.2/24 Site 4
192.168.x0.4/24
©Mikrotik 2012 145 ©Mikrotik 2012 146
Overall Summary
● MPLS improves performance
● Very easy to enable over existing core
configuration
● Very easy to migrate from EoIP to VPLS
● New possibilities for ISPs to offer new services
Internetworking 25