0 ratings0% found this document useful (0 votes) 100 views22 pagesMtcine 2012
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as DOCX, PDF or read online on Scribd
- MikroTik RouterOS Training Overview
- Lab Setup Guide
- Border Gateway Protocol (BGP)
MikroTik RouterOS
Training
Inter-Networking
Overview
+ BGP
+ BGP Basics (iBGP, eBGP)
* Distribution, filtering and BGP attributes
+ MPLS
* Introduction to MPLS
+ LDP
+ L2 and L3 VPN's
* Traffic EngineeringLab Setup
+ Divide in groups by four
+ Make network setup as illustrated in next slide
+ R1 and R2 routes connect to AP with SSID
AS100 in 2.4Ghz band
+ Each router has local network [Link].0/24
where:
+ X-group number
+ Y-Routers number
X- group number Lab Setup
AP SSID“A100 band=2.4Ghz
ast00Border Gateway Protocol
(BGP)
Autonomous system
+ Set of routers under a single administrative
control
+ Routing exchange:
+ 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 useBGP Basics
+ Stands for Border Gateway Protocol
+ Designed as Inter-AS routing protocol
+ Network topology is not exchanged, only
reachability information.
Only protocol that can handle Internet's size
networks
Uses path vector algorithm
Path Vector Implementation
+ Treats whole AS as a single point in the path
* Prefix is advertised with the list of ASs along the
path called AS path
+ Hides network topology within an AS
+ Cannot provide loopfree routing within an ASPath Vector Implementation
‘Add ASI00
[Link]'24 otepeh
asi
a 8200
Reject. AS 100 f
areadyin 4
thepath
} nda.asz0o
J tothe path
tothe path
BGP Capabilities
BGP Speaker advertises supported capability codes
If received capability is not supported, remote peer
sends back notification
BGP speaker attempts to peer without unsupported
capability
Some of RouterOS advertised capabilities:
+ Route refresh
+ Multi-protocol extension
+ 4-byte AS supportBGP Transport
Operates by exchanging NLRI (network layer
reachability information).
NLRI includes a set of BGP attributes and one
or more prefixes with which those attributes are
associated
Uses TCP as the transport protocol (port 179)
Initial full routing table exchange between peers
Incremental updates after initial exchange
(maintains routing table version)
Packet format
Packet contains four main fields:
+ Marker (128bits) — used for authentication
+ Length (16bits)
+ Type (8bits) - BGP message type
+ Message bodyBGP message types
+ Four message types:
+ Open — First message sent after TCP connection
establishment, contains capability list. Confirmed by
keepalive.
+ Keepalive - does not contain data, sent to keep
hold timer from expiring
+ Update — actual route updates. Contains:
~ NLRI
~ Path attributes
* Notification — sent when error condition occurs,
contains error code and sub-code
BGP session and updates
Open with ASN4 capability
‘AS100 “Notification unsupported cap.
Koopalive
Route Refresh message
UpdateNetworks
Indicates what networks BGP should originate from
the router.
By default network is advertised only if corresponding
route is present in routing table
Synchronization can be turned off if:
+ Your AS does not provide transit service
+ Allthe transit routers run BGP
Disabling sync allows BGP to converge faster.
Sync can be dangerous if routes are flapping a lot.
Configurable from
/routing bgp network
Enable BGP
Jeoating bgp instance
/routing bap peer
If router is not specified, its automatically set to least IP address on
the router.
Verity BGP connectivity. Any state other than established indicates that
routers can not become neighbors (use print status for more details)Stub network Scenarios
+ Single homed
Private ASN is used (764511)
~ ISP originates only default route
Actually no need for BGP
~ Upstream ISP advertises networks
~ Stub network has the same policy as ISP
1s
‘stub net
ee |
ss00
Private AS Removal
Global net g
7ASGS500
wn anise
* Private AS cannot be \ ~~
leaked to public Ke Bases
* Available for eBGP ‘zoo UN massa
neighbors p.
+ Announce only aggregate route —_,., 86?
* Use following command
oa Boe oeBGP Lab |
* Create BGP network setup as illustrated in next
slide:
+ BGP peer from R1 and R2 to AP.
+ BGP peer from R2 to R4
* BGP peer from R1 to R3
+ Advertise your local network
+ Private ASN should be removed
* Originate default route to private AS routers
BGP Lab |
X~ group number
[AP SSID“AS100 band=2.4Ghz
==" BGP peor taaenxto2Stub network Scenarios
+ Multihomed
Private ASN is used
~ Can be used:
+ As mainfbackup link
+ Load sharing
Upstream ISP advertises networks
Stub network has the same policy as ISP
1p
2
sane Basen
tone me
Non-stub Scenarios
Need to obtain AS number from ISP or RIR
Address range from Regional Internet Registry
Routing policy independent from ISPs
Can be used:
As main/backup link
~ Load sharing a “e
~ More advanced AS100 AS200
routing policies ‘ p
‘88300
Global netBGP and connection tracking
+ Connection tracking is unable to keep valid
track of connections with multi-homed BGP.
+ Packets related to one connection can travel
through different paths
~ Do not drop invalid connections in firewall
* Con-track should be turned off for better
performance
BGP Lab II
+ Add R3 to the same AS as R1
+ Add R4 to the same AS as R2
+ Make BGP peer between R4 and R3
+ Set up OSPF between routers in the same AS
* Set OSPF to distribute connected routes
* Announce both local networks from ASBGP Lab II
[AP SSID“AS100 band=2.4Ghz
==" BGP peor aaenxt.02
As100
BGP Lab II
[adninéRt] /ip route> print
Flage: X - disabled, A'~ active, D - dynamic,
C- connect, §- static, r- rip, b- bgp, 0 - opf, = - ane,
1B - blackhole, U - unreachable, P ~ prohibit
[Link]/0 [Link] 20
[Link]/24 [Link] RAP
[Link]/30 192.1682. RIS
i92/168.1.6/30 392 .168.1.2
192/168.11.0/24 [Link] local
i92/168.11.0/24 [Link]
i92/168 12/0/24 92/168. 10
1921168,12.0/24 [Link]
i92-168.13.0/24 [Link]
92/168 113.0/24 392 .368.1.2
1921168 ,14.0/24 392/168 .1.10
192/168,14.0/24 [Link]
pbebebyRPRREBGP Lab II
/4p route? print
Flage: X - disabled, A ~ active, D - dynamic,
c= connect, § - static, r- rip, b- byp, o- ospf, m- me,
B - blackhole, U = unreachable, P ~ prohibit
[Link]/0 392.168 200
[Link]/24 92.168 no
[Link]/30 192,168.22 -R3 AL °
i92'68.1.6/30 © [Link] RIE °
1921168.11.0/24 192,168 no
i92/168.11.0/24 392.168 200
192/168 .12/0/24 92 168 20
1921168.13.0/24 [Link] local °
492/168 .13.0/24 92-268 200
i92/168 1410/24 92/168 20
BeRbePRERE
‘ouder Rt does nt redsriue 12004 and 404 back to RO
Interior and Exterior BGP
+ BGP — peering between routers inside an AS
+ eBGP — peering between routers from different ASseBGP
+ Almost always formed between directly
connected peers (AS edge routers).
+ Multi-hop configuration is required if peers are
not directly connected
+ Adds AS to advertised prefix's path
+ By default Next-hop is changed to self
eBGP Multihop example
ewsaf
e-as-x multihopayes
Configuration requires static routes or enabled IGP so that the neighbors
ccan reach each other.
Selting @BGP to Loopback addresses can protect BGP from DOS attacksiBGP
Next-hop is not changed by default:
+ Uses IGP (RIP,OSPF;static) to ensure network
reachability within an AS
Attributes learned from iBGP are not changed to
impact the path selection to reach outside network
AS path is not manipulated
Provides ways to control exit point from an AS.
Received external route from iBGP peer is not
propagated to other iBGP peers:
+ Requires full mesh between iBGP peers.
8 Db 192.168 [Link] 200
9 an 192/160 114.0/24 20.20.0112 20
8 Db dst-addross=192.168,14.0/24 gateway=[Link]
gatoway-stat
target-scape
bbgp-as-path="100,112" bop-oign=igp
received{rom=pear!Loopback
+ Eliminates dependency from physical interface to
make TCP connection.
+ Mostly used between iBGP peers
+ In RouterOS empty bridge can be used as loopback
‘gore
a -
[interface bridge
(sp address a3 3
‘freuting bgp peer
BGP Lab III
+ Improve your setup by using loopback
addresses between iBGP peers
10.255.x.y/32, where
Xx — group number
y — router's number
+ Add loopback address to OSPF networks
* Set loopback address as ospf and bgp router-idRoute Distribution
+ IGP (Static, OSPF, RIP, connected) routes can
be redistributed
{routing bap instance
* Prefix origin is “incomplete”
+ Risk of advertising all IGP routes
+ Always use routing filters to avoid unwanted
route advertisements
Distribution Example
[sp route sad dst
‘/routing bgp instance
+ Packets will be ceased unless more specific
route is present
* Good way to advertise supernetRouting Filters
* Main tool to control and modify routing
information
Organized in chains similar to firewall
Specify in BGP peer’s configuration which
chains to use or BGP instance out filter
Prefix passes instance chain, then moves to
peer's chain
/rosting bop peor bap-in ou out
[routing f£lter osc ee
‘/routing bap peer set
Jrouting £
target-scope
Dbgp-commurPrefix filtering
ies
p
f contig on R3
/routing bap peer se
/routing filter
AS Path filtering
Can be configured to allow updates only to/from
certain AS
Supports regular expressions
+“ sany single character
start of the as-path
end of the as-path
matches comma, space, start and end of as-path
1 contig on 12
/routing filer ads nailBGP Soft Reconfiguration
+ When action=discard is used, routes are not updated
after filter change.
* Solution
+ Use action=reject to keep routes in the memory
+ Dynamic (Peer must support refresh capability)
~ Peer refreshes the routes afer the changes are
done.
~ No additional memory is used
~ Itis not done automatically - need to run
“refresh” command
BGP Lab IV
* Set up routing filters in the way that:
+ R1 does not receive 192. 168.x2.0/24 prefix via AP
+ R2 does not receive 192.168.x1.0/24 prefix via AP
+ R3 does not receive 192.168.x4.0/24 prefix from R4
+ R4 does not receive 192.168.x3.0/24 prefix from R3BGP Lab IV
Lets look at R3. If set up properly traceroutes to
network x2 should go over R4 and traceroutes to x4
should go over AP
BGP decision algorithm
+ BGP uses single best path to reach the
destination
+ BGP always propagates the best path to the
neighbors
+ Different prefix attributes are used to determine
best path, like weight, next-hop, as-path, local-
pref etc.
* Setting peer to loopback address can force
BGP to install ECMP route (for load balancing)









