SlideShare ist ein Scribd-Unternehmen logo
1 von 111
Downloaden Sie, um offline zu lesen
BGP Filtering with RouterOS
European MUM – 2013 - Zagreb / Croatia
Wardner Maia
External Connectivity Strategies for Multi- Homed
ISP’s, connected to an IXP Environment and
providing transit services
Copyright Notice
(Aviso sobre direitos autorais)
English:
This material is an effort intended to improve the level of knowledge of professionals
that work with Mikrotik RouterOS and should be used solely for self-study purposes.
Digital copies and/or any printed material contained in this presentation or derived
from it are property of MD Brasil TI & Telecom and cannot be used for any kind of
training, presentation or workshop, even non-commercial ones.
Reproduction of any part or picture requires previous written authorization of MD
Brasil. For information about how to obtain such authorization, please contact
mdbrasil@mdbrasil.com.br.
©Copyright md brasil - direitos reservados 2
Portuguese:
Este material é um esforço que visa aprimorar o grau de conhecimento de
profissionais que trabalham com Mikrotik RouterOS e deve ser usado apenas com
objetivos de auto estudo.
Cópias digitais e/ou materiais impressos com conteúdo desta apresentação ou dela
derivados são de propriedade a MD Brasil TI & Telecom a não podem ser usados para
qualquer tipo de treinamento, apresentação ou seminário, mesmo os de finalidades
não comerciais.
A reprodução de qualquer parte ou figura requer prévia autorização por escrito da
MD Brasil. Para informações em como obter esta autorização, por favor contate
mdbrasil@mdbrasil.com.br.
Introduction
Wardner Maia
Electronic and Telecommunications Engineer;
Internet Service Provider since 1995;
Radio Frequency Trainings since 2002;
Certified Mikrotik Trainer since 2007;
MD Brasil IT & Telecom CTO
Member of the board of directors of LACNIC
3©Copyright md brasil - direitos reservados
Introduction
MD Brasil IT & Telecom
Internet Access Provider in São Paulo state - Brazil;
Telecom equipment manufacturer and integrator;
Mikrotik Training Partner since 2007;
Mikrotik distributor;
Consulting services worldwide;
http://www.mdbrasil.com.br http://mikrotikbrasil.com.br
4©Copyright md brasil - direitos reservados
Objectives and Target
Audience
Objectives:
To understand BGP filtering techniques to be applied to a
multi connected network and intended to implement
external routing policies, providing traffic balance,
security and reliability.
Target Audience:
ISP’s and Telecom operators running or intending to run
BGP with Mikrotik RouterOS.
5©Copyright md brasil - direitos reservados
Agenda
1) BGP essentials and basics of BGP
filtering;
2) Case Studies:
2.1) Overview
2.2) Single-Homed Provider
2.3) Single-Homed + IXP
2.4) Multi-Homed + IXP
2.5) Multi-Homed + IXP +
Providing transit services
6©Copyright md brasil - direitos reservados
Agenda
1) BGP essentials and basics of BGP
filtering;
2) Case Studies:
2.1) Overview
2.2) Single-Homed Provider
2.3) Single-Homed + IXP
2.4) Multi-Homed + IXP
2.5) Multi-Homed + IXP +
Providing transit services
7©Copyright md brasil - direitos reservados
The Internet is composed of lots of interconnected networks,
each one under an independent technical administration.
Such networks are called an “Autonomous System”.
Your AS
Autonomous Systems and the
Internet
©md1302192041
AS-1
AS-2
AS-3
8©Copyright md brasil - direitos reservados
Autonomous System
One definition for an AS can be:
In practice you could become
an AS with a administrative
process, requesting numeration
resources from a RIR (Regional
Internet Registry)
For Europe: RIPE NCC
Autonomous System
©md1302192042
“An Autonomous System (AS) is a group of IP networks run by
one or more network operators with a single, clearly defined
routing policy.”
9©Copyright md brasil - direitos reservados
Internet Numbering Resources
IANA
AFRINIC APNIC ARIN LACNIC RIPE
MX BRID
KR
JP
CH
TW
VT
©md1303102108
RIR’s
LIR’s
10©Copyright md brasil - direitos reservados
AS-1
BGP protocol is the “language” that AS’s talk each other,
exchanging routing information and making all
destinations reachable.
AS-2 Your AS
AS-3
BGP
BGP BGP
BGP
BGP
Autonomous Systems, Internet
and BGP Protocol
©md1302192041
11©Copyright md brasil - direitos reservados
To deal with all Internet traffic, BGP
should:
BGP Protocol
 be a scalable protocol capable to handle with a huge
amount of network prefixes always growing;
 have robustness and reliability;
 provide tools to in some way to influence on external
traffic not under the direct control of the administrator.
12©Copyright md brasil - direitos reservados
BGP Characteristics:
BGP protocol
 Can be considered a “vector distance” protocol, where
each AS represents a single routing hop;
 No matter how big is the network BGP doesn’t care
about internal topology but only how can reach the
networks.
 Current BGP version is BGPv4 according to RFC-1771
13©Copyright md brasil - direitos reservados
Basic principles:
BGP Protocol
BGP works exchanging routing information about
reachability of networks with NLRI (Network Layer
Reachability Information) messages;
NLRI messages have one or more network prefixes and
attributes associated with them;
To ensure data integrity, information are transported over a
TCP connection (port 179).
14©Copyright md brasil - direitos reservados
 Both administrators configure the BGP peering;
 A TCP session to port 179 is established and over it the BGP
session;
 Both sides exchange routing information until total
convergence;
 After this only information about new and withdrawn routes
are excehanged.
Running BGP
AS-2AS-1
©md1302200234
15©Copyright md brasil - direitos reservados
BGP Messages
OPEN
First message sent after TCP connection establishment and
confirmed with a KEEPALIVE;
KEEPALIVE
Messages exchanged in intervals of 60 seconds to check peer
state;
UPDATE
Information about network prefixes;
NOTIFICATION
Sent when an error occurs;
Optional message:
ROUTE REFRESH
Ask the neighbor to send the routes again.
AS-2AS-1
©md1302200234
16©Copyright md brasil - direitos reservados
BGP states
3 - Active 2 - Connect
4-OpenSent 1-Idle
5-OpenConfirm
6-EstablishedKEEPALIVE
KEEPALIVE
OPEN
Waiting for TCP
connection
Waiting for
start event
Trying to get a
peer
Neighbor
negotiation
complete
KEEPALIVE
UPDATE
©md1302200235
17©Copyright md brasil - direitos reservados
BGP states
3 - Active 2 - Connect
4-OpenSent 1-Idle
6-EstablishedKEEPALIVE
NOTIFICATION
NOTIFICATION
KEEPALIVE
Waiting for keepalive
or notification from a
peer
OPEN
OPEN
NOTIFICATION
Waiting for TCP
connection
Waiting for
start event
Trying to get a
peer
Neighbor
negotiation
complete
KEEPALIVE
UPDATE
©md1302200235
5-OpenConfirm
18©Copyright md brasil - direitos reservados
UPDATE message
Unfeasible Routes Length (16 Bits)
Withdrawn Routes (Variable)
Total Path Attributes Length (16 Bits)
Path Attributes (Variable)
Prefix (1/2/3/4 bytes)Length (1 byte)
Prefix (1/2/3/4 bytes)Length (1 byte)
Unreachable Routes
Path Attributes
NLRI
19©Copyright md brasil - direitos reservados
Attributes Types
Attributes
Well Known
Mandatory
Discretionary
Optional
Transitive
Intransitive
Recognized by all BGP
implementations
Optionally
recognized
Presents in all BGP
messages
May be present or not in
BGP messages
Propagated to other routers,
even if not supported
Not propagated to
other routers©md1302201203
20©Copyright md brasil - direitos reservados
AS-Path, Next-Hop, Communities
and Local Preference
AS-Path:
AS sequence through which a network is reachable;
Next-Hop:
IP address of the next hop router
Community:
Numeric value that can be attached to a prefix with some
specific purpose;
Local Preference:
Attribute used to choose a preferred outbound path inside an
AS;
21©Copyright md brasil - direitos reservados
Understanding the AS-Path
©md1302200202
AS-100
AS-400
AS-200
AS-300
Rede
1.1.0.0/20
AS-Path
200, 100
AS-Path
300, 200, 100
NETWORK
1.1.0.0/20
AS-path
300,200,100
AS-Path
100
22©Copyright md brasil - direitos reservados
Looping Prevention
©md1302200202
AS-100
AS-400
AS-200
AS-300
Rede
1.1.0.0/20
AS-Path
200,
100
AS-Path
300, 200,
100
AS-Path
100
AS-Path
400, 300, 200, 100
When an AS sees his
own AS number inside
an AS-Path, the
announcement will be
discarded.
23©Copyright md brasil - direitos reservados
Understanding Next-Hop
©md1302201736
AS-100
AS-400
AS-200
AS-300
Next-Hop
10.1.1.5
NETWORK
1.1.0.0/20
AS-Path
300,200,100
10.1.1.1
10.1.1.5
Next-Hop
10.1.1.1
Next-Hop
10.1.1.9
10.1.1.9
Next-Hop
10.1.1.9
24©Copyright md brasil - direitos reservados
Next-Hop on an shared network
(e.g. IXP)
©md1302201755
AS-10
AS-30
Network
1.1.0.0/20
AS-20
10.1.1.1
10.1.1.2
10.1.1.3
Network
1.1.0.0/20
AS-Path
10
Next-Hop
10.1.1.1
To optimize packet forwarding, in a shared subnet, next
hop will be kept.
Network
1.1.0.0/20
AS-Path
10, 20
Next-Hop
10.1.1.1
25©Copyright md brasil - direitos reservados
How BGP decides about
the best route?
26©Copyright md brasil - direitos reservados
Routing Essentials
Routing
Information Base
(RIB)
Routing Information
base is the data
base where all
information about IP
routes are stored.
Each protocol has its
RIB
27©Copyright md brasil - direitos reservados
Routing Essentials
Routes Processing
This process will
choose among the
RIB routes, the ones
that will be installed
in the FIB
28©Copyright md brasil - direitos reservados
Routing Essentials
Forwarding
Information
Base (FIB)
FIB contains
information of
prefixes related to
the network
interfaces that
could be used to
forward packets.
29©Copyright md brasil - direitos reservados
How BGP decides about the
best routes
When receiving a BGP update message:
Does AS-Path have my
own AS?
Discard Information
UpdateMessage
Yes
No
Install Route in the
RIB
Is the route discarded
by routing filters?
Is Next-Hop
reachable?
Yes No
Yes
No
Copyright ©
MD1303091345
30©Copyright md brasil - direitos reservados
How BGP decides about the
best routes
If the route is the first one in the RIB, it will be chosen.
Otherwise, BGP decision criteria will be considered for
selection
Consider BGP Criteria to
choose the best route
Copyright ©
MD1303091345
Install this prefix
in the FIB
Route is in the RIB
Is there an identical
prefix?
Yes
No
31©Copyright md brasil - direitos reservados
BGP criteria for decision
1) Prefers the path with highest WEIGHT (default = 0);
2) Prefers path with highest LOCAL-PREFERENCE (default = 100);
3) Prefers path with the shortest AS-Path;
4) Prefers the path locally originated via aggregate or BGP network announce;
5) Prefers the path with lowest ORIGIN (igp < egp < incomplete);
6) Prefers the path with the lowest MED (default = 0);
7) Prefers the path learned by eBGP over the ones by iBGP;
8) Prefers the path received from the router with lower Router ID;
9) Prefers the path with shortest route reflection cluster list (default = 0);
10)Prefers the path that comes from the lowest neighbor address.
BGP will compare identical prefixes in the following order:
32©Copyright md brasil - direitos reservados
Routing Filters
The way to influence BGP decision is by configuring
routing filters.
Filtering incoming routes will change, how we see the
external world, thus influencing how we send traffic;
Filtering outgoing routes will change how the world see
us, thus influencing how we receive traffic.
33©Copyright md brasil - direitos reservados
BGP Filter placement
Routing
Information Base
(RIB)
Routes processing
Route Updates
Forwarding
Information Base
(FIB)
Route Updates
Static and
connected
routes
BGP Routes Input Filters
Routes Exchanges
With Neighbor
Nodes
Output Filters
BGP Routes
advertisements
md1303082332
34©Copyright md brasil - direitos reservados
Understanding Routing Filters
“Semantics” in RouterOS
Matchers by the prefix
itself, prefix-length,
protocol, routing marks,
etc.
Matchers by BGP
attributes inside the
UPDATE message.
Actions to be done, like
accept, discard etc.
Actions intended to
modify BGP attributes on
a specific route.
Matchers Actions
35©Copyright md brasil - direitos reservados
Agenda
1) BGP essentials and basics of BGP
filtering;
2) Case Studies:
2.1) Overview
2.2) Single-Homed Provider
2.3) Single-Homed + IXP
2.4) Multi-Homed + IXP
2.5) Multi-Homed + IXP +
Providing transit services
36©Copyright md brasil - direitos reservados
Scenario I
Single Homed ISP
Internet
Transit
Operator
Your AS
©md1302192043
37©Copyright md brasil - direitos reservados
Your AS
Scenario II
Single-Homed + IXP
Internet
Transit
Operator
IXP
AS1
AS1
©md1302192044
38©Copyright md brasil - direitos reservados
Scenario III
Dual-Homed + IXP
Internet
Transit
Operator
Your AS
IXP
AS1
AS2
Transit
Operator 2
©md1302192045
39©Copyright md brasil - direitos reservados
Scenario IV
Dual-Homed + IXP
Providing Transit services
Internet
Transit
Operator
Your AS
IXP
AS1
AS2
Transit
Operator 2
©md1302192045
Transit
Client
40©Copyright md brasil - direitos reservados
Scenario V – Multi-Homed +
IXP + iBGP + Confederation
Internet
PTT
AS1
AS2
©md1302192258
TR2
TR1
41©Copyright md brasil - direitos reservados
Agenda
1) BGP essentials and basics of BGP
filtering;
2) Case Studies:
2.1) Overview
2.2) Single-Homed Provider
2.3) Single-Homed + IXP
2.4) Multi-Homed + IXP
2.5) Multi-Homed + IXP +
Providing transit services
42©Copyright md brasil - direitos reservados
Scenario I
Single-Homed ISP
Internet
Transit
Operator
Your AS
©md1302192043
43©Copyright md brasil - direitos reservados
Before BGP Session
You should sign an agreement with your transit provider
to define some policies for you BGP session, like:
 If you want Full or Partial Routing;
 Which prefixes you intend to announce;
 If you want a default Route;
 MD5 password;
 If the session should be established with a loopback
interface;
etc.
44©Copyright md brasil - direitos reservados
Simulating the Scenario
For the purpose of this presentation, we are going to
assume that:
 Our transit provider is sending us a Full routing
table;
 We’re announcing the prefix 11.11.0.0/20;
 Our peer will be established with a direct
connected interface*
 Our Transit Provider does not offer native IPv6
transit.
* Not a good practice. Please see work about routing security:
http://mum.mikrotik.com/presentations/HU11/maia.pdf
45©Copyright md brasil - direitos reservados
BGP Configuration
Minimal Configuration: AS Number and Peer
Router ID: Optional (but recommended)
ASN=65000
172.16.21.1/30
ASN=65021
172.16.21.2/30
46©Copyright md brasil - direitos reservados
BGP Configuration
Minimal configuration for peer: Remote IP and Remote AS
ASN=65000
172.16.21.1/30
ASN=65021
172.16.21.2/30
47©Copyright md brasil - direitos reservados
BGP Configuration
Checking results
ASN=65000
172.16.21.1/30
ASN=65021
172.16.21.2/30
Advertising the network
48©Copyright md brasil - direitos reservados
Testing the Results
Supposing you ask for a Full routing, by this time
you can look on your routing table and see ~400k
network prefixes.
Do we need this bunch of prefixes?
49©Copyright md brasil - direitos reservados
Prefixes Control
By default, nothing is filtered.
Routing filters allow the control of ingress and egress
announcements.
Transit
Operator
Your AS
©md1302192046
50©Copyright md brasil - direitos reservados
BGP Filtering for Scenario 1
To spare resources, you can:
 Discard all routes received
 Setup a static default
route
Internet
Transit
Operator
Your AS
©md1302192043
Filter
Peer
51©Copyright md brasil - direitos reservados
Break for hands on!
Discarding all routes and configuring a default one
(“Internet”  99.99.0.1)
52©Copyright md brasil - direitos reservados
Anything else to do with a
Single-Homed ISP?
Having a default route, all packets to any destination will be
forwarded, including that ones destined to bogons
networks.
Bogons prefixes are valid ones, but not allocated to any
provider or final consumer (they remain “in stock” of the
RIR’s0
It is a good practice to deal with BOGONS prefixes!
If we have a default route, should we do
anything else?
QUIZZ
53©Copyright md brasil - direitos reservados
Bogons treatment
To get automatic information about bogons prefixes, we’ll
establish a BGP session with Cymru Team http://www.team-
cymru.org/
Cymru will send bogons prefixes via BGP with the
COMMUNITY attribute 65332:888
54©Copyright md brasil - direitos reservados
Understanding Communities
A Community is a 32 bit number you can attach to a route with
the purpose to signalize something to other AS’s. A community
can be viewed like a “flag” in the route.
There are well known communities, like no-export, no-advertise
etc. but any AS can set this own set of communities. The usual
format of a community is to split the 32 bit in 2 numbers: AS
number:some_number
Communities are widely used to implement routing policies, like:
 Allowing a remote AS to set some Local Preference when
sending the announcements;
 Putting a IP address or network in black hole.
Etc.
55©Copyright md brasil - direitos reservados
Announcements
with community
65332:888
Understanding Communities
Cymru Your AS
In our case, we know that Cymru will send bogons prefixes
with the community 65332:888 and then we’ll set up an
ingress filter seeing in de BGP attributes if such “flag” is
present.
56©Copyright md brasil - direitos reservados
Peering with Cymru
Note that peering with Cymru is a Multihop session
57©Copyright md brasil - direitos reservados
Filtering Routes with Cymru
Accepting Cymru routes and
setting them as blackhole Avoiding other
routes IN and OUT
58©Copyright md brasil - direitos reservados
Break for hands on!
Establishing a peering to Cymru and putting routes in
blackhole
59©Copyright md brasil - direitos reservados
What about IPv6?
Supposing our transit provider doesn’t supply native IPv6
connectivity, and we want to use this protocol, we can, via a
Tunnel Broker, to be IPv6 worldwide connected.
Tunnel configuration BGP configuration
60©Copyright md brasil - direitos reservados
Break for hands on!
Establishing a IPv6 tunnel and receiving the routes
(“Internet”  2001:a::1)
61©Copyright md brasil - direitos reservados
Agenda
1) BGP essentials and basics of BGP
filtering;
2) Case Studies:
2.1) Overview
2.2) Single-Homed Provider
2.3) Single-Homed + IXP
2.4) Multi-Homed + IXP
2.5) Multi-Homed + IXP +
Providing transit services
62©Copyright md brasil - direitos reservados
What is an IXP?
IXP – Internet Exchange Point
(Or NAP – Network Exchange Point or MAE – Metropolitan Area
Exchange)
Network solution whose purpose is to facilitate direct
connections between Autonomous Systems, promoting the
exchange of Internet traffic.
An IXP optimizes AS interconnection, allowing:
Better quality (low latency);
Avoid intermediates;
Lowering of costs (with a MLPA);
Better organization of regional networks.
63©Copyright md brasil - direitos reservados
Internet Exchange Point
Basically an IXP is a Layer2
segment connecting AS’s
Internet
Google Facebook
IXP
IP transit provider
ISP Y
ISP X
64©Copyright md brasil - direitos reservados
Scenario II
Single Homed + IXP
Transit
Operator
IXP
AS1
©md1302192044
Internet
AS1
65©Copyright md brasil - direitos reservados
Your AS
Scenario II – without filtering
12.12.0.0/20, 13.13.0.0/20, …, 19.19.0.0/20 are networks
announced to IXP.
Note that without any filtering the IXP has “won” the election
Why?
Note that we also
have 2 destinations
to the same network.
66©Copyright md brasil - direitos reservados
What about IPv6?
In our IXP we have native IPv6 transit to the Internet and
we will use this as preferred path to IPv6 world keeping the
tunnel to HE as a backup.
IPv6 exchange peering IPv6 transit peering
67©Copyright md brasil - direitos reservados
Break for hands on!
Establishing the peering with IXP for: IPv4 exchange, IPv6
exchange and IPv6 transit.
68©Copyright md brasil - direitos reservados
Your AS
Scenario II
Single Homed + IXP
Transit
Operator
IXP
AS1
©md1302192044
Internet
AS1
Transit Effect
(undesired)
Without filtering AS-1
could decide that the
best path to go to the
Internet is via Your AS
69©Copyright md brasil - direitos reservados
Transit effect in Scenario II
To protect against undesirable “transit effect” your AS
should advertise only its own prefixes.
Above filters applied to peers IXP and Transit-1 in out-
filter channel
70©Copyright md brasil - direitos reservados
More Filtering – Ingress good
Practices
Good practices for ingress filters for all peers are:
 Discard receiving own prefix;
 Discard private and reserved networks stated at RFC
5735;
 Discard default route (we are assuming a Full Routing)
Is necessary to discard routes that contain
own AS number in the AS-Path?
QUIZZ
71©Copyright md brasil - direitos reservados
RFC 5735 – Summary Table
1/2
Address Block Present Use Reference
-------------------------------------------------------------------------
0.0.0.0/8 "This" Network RFC 1122
10.0.0.0/8 Private-Use Networks RFC 1918
127.0.0.0/8 Loopback RFC 1122
169.254.0.0/16 Link Local RFC 3927
172.16.0.0/12 Private-Use Networks RFC 1918
192.0.0.0/24 IETF Protocol Assignments RFC 5736
192.0.2.0/24 TEST-NET-1 RFC 5737
192.88.99.0/24 6to4 Relay Anycast RFC 3068
72©Copyright md brasil - direitos reservados
RFC 5735 – Summary Table
2/2
Address Block Present Use Reference
-------------------------------------------------------------------------
192.168.0.0/16 Private-Use Networks RFC 1918
198.18.0.0/15 Device Benchmark Testing RFC 2544
198.51.100.0/24 TEST-NET-2 RFC 5737
203.0.113.0/24 TEST-NET-3 RFC 5737
224.0.0.0/4 Multicast RFC 3171
240.0.0.0/4 Reserved for Future Use RFC 1112
255.255.255.255/32 Limited Broadcast RFC 919
RFC 922
73©Copyright md brasil - direitos reservados
Ingress Filters for (almost)
All Peers
N.B: Private networks
suppressed from this list
because we’re using
them.
Hint:
Action Jump can turn your
filters more readable!
74©Copyright md brasil - direitos reservados
Break for hands on!
Enable protection filters for undesired transit effect and good
practices ingress filters
75©Copyright md brasil - direitos reservados
Agenda
1) BGP essentials and basics of BGP
filtering;
2) Case Studies:
2.1) Overview
2.2) Single-Homed Provider
2.3) Single-Homed + IXP
2.4) Multi-Homed + IXP
2.5) Multi-Homed + IXP +
Providing transit services
76©Copyright md brasil - direitos reservados
Scenario III
Multi-Homed + IXP
77©Copyright md brasil - direitos reservados
Scenario III
Multi-Homed + IXP
Internet
Transit
Operator
IXP
AS1
AS2
Transit
Operator 2
©md1302192045
Your AS
78©Copyright md brasil - direitos reservados
Scenario III
Multi-Homed + IXP
Internet
Transit
Operator
IXP
AS1
AS2
Transit
Operator 2
©md1302192045
Your AS
79©Copyright md brasil - direitos reservados
Scenario III
without filtering
12.12.0.0/20, 13.13.0.0/20, …, 19.19.0.0/20 are networks
belonging to TR-2 and announced to IXP and TR-1
Note that we have a
direct path and 2
other options
80©Copyright md brasil - direitos reservados
Filtering for Scenario III
1) Ingress Filters will be the same:
2) Filters to avoid undesired traffic effect, as well
What about filters to manipulate traffic?
81©Copyright md brasil - direitos reservados
Traffic Manipulation
82©Copyright md brasil - direitos reservados
Routing Filters
The way to influence BGP decision is by configuring
routing filters.
Filtering incoming routes can change, how we see the
external world, thus influencing how we send traffic;
Filtering outgoing routes can change how the world see
us, thus influencing how we receive traffic.
83©Copyright md brasil - direitos reservados
Traffic Manipulation
How to check results?
1) Tools that don’t tell all the true:
Ping, traceroute, torch, bandwidth test…
2) Where should we see:
Results of our upload policy: Our routing table
Results of our download policy: Our routes as seen
by other AS’s (looking glasses)
84©Copyright md brasil - direitos reservados
Upload Control
85©Copyright md brasil - direitos reservados
Upload Manipulation
To influence our upload, basically we can manipulate 2
attributes:
Weight
Local-Preference
Both will cause the same effect if we have a single router.
86©Copyright md brasil - direitos reservados
Upload Manipulation
Weight
Weight
Filters can set a “weight” to
the route received from one
peer. Routes with higher
weight will be preferred
(Default =0)
OBS: Although weight is
usually treated as a BGP
attribute, in fact is not,
because it is not propagated
inside the update messages.
TR1
©md130230052
PTT
1.1.0.0/20
Weight=10
1.1.0.0/20
Weight=0
87©Copyright md brasil - direitos reservados
Upload Manipulation
Local-Preference
Local-Preference
Filters can set a Local-
Preference to the route(s)
received from one peer.
Routes with higher LP, will
be preferred to send traffic.
Default LP is 100.
OBS: Local Preference is a
real attribute that
propagates inside the entire
AS. Does not propagate to
other AS’s.
TR1
©md130230108
PTT
1.1.0.0/20
LP =150
1.1.0.0/20
LP = 100
88©Copyright md brasil - direitos reservados
Upload Manipulation
Weight or Local preference
Natural upload preference is via TR2. Filter to
set TR1 as the preferred path:
or
89©Copyright md brasil - direitos reservados
Break for hands on!
Enable Local Preference filter and show the effect on routing
table
90©Copyright md brasil - direitos reservados
Download Control
91©Copyright md brasil - direitos reservados
Download Manipulation
Basically there are 3 ways to influence how downloads
are received by our AS:
 Controlling network advertisements with longer
or shorter prefixes;
 Manipulating AS-Path attribute;
 Manipulating MED attribute;
92©Copyright md brasil - direitos reservados
Download Manipulation
with MED attribute
With MED (Multi Exit
Discriminator) one AS can
inform a neighbor one, which
is the preferred way to receive
traffic. Lower MED will be used
(default=0);
With RouterOS, MED will work
only when there are two ore
more connections between
AS’s.
NB: In a scenario like the picture,
TR1 MED will be ignored
TR1
©md1302230153
PTT
MED=20
MED=30
MED=10
AS-X
93©Copyright md brasil - direitos reservados
Download Manipulation
by more specific announcements
e.g.:
AS-x announces half of its
addresses for each link and
the whole IP range for both
links. The goal is to
“guarantee” the balance and
redundancy.
OBS: This policy will succeed
only if the use of ÍP’s are quite
equilibrated.
TR1
©md130230052
TR2
1.1.0.0/21
1.1.0.0/20
1.1.8.0/21
1.1.0.0/20
AS-X
94©Copyright md brasil - direitos reservados
Download Manipulation
AS-Path prepend technique
Example: before prepending
AS-20
AS-10
©md1302230258
AS-30
1 Gbps
100 Mbps1.1.0.0/20
Traffic Flow
95©Copyright md brasil - direitos reservados
Download Manipulation
AS-Path prepend technique
Prepending 3 times self AS
AS-20
AS-10
©md1302230258
AS-30
1 Gbps
100 Mbps1.1.0.0/20
Direção do tráfego
96©Copyright md brasil - direitos reservados
Download Manipulation
Comparing the methods:
MED:
Efficient, but limited when having 2 or more connections
to the same AS;
More specific announcements:
Aggressive resource. Will work regardless the number of
hops. Can choose sub-optimal paths. Use in extreme
cases.
AS-Path prepend:
“Soft” resource. Also has limitations due to number of
AS-Path’s and topology changes.
97©Copyright md brasil - direitos reservados
Download Manipulation
with AS-Path prepend
TR1 Routing table (looking glass) before AS-
Path prepend
Filters:
98
©Copyright md brasil - direitos reservados
Download Manipulation
with AS-Path prepend
TR1 Routing table (looking glass) after AS-Path
prepend:
99©Copyright md brasil - direitos reservados
Break for hands on!
Enable AS-Path prepend filter and show the results on the
“looking glass”
100©Copyright md brasil - direitos reservados
Agenda
1) BGP essentials and basics of BGP
filtering;
2) Case Studies:
2.1) Overview
2.2) Single-Homed Provider
2.3) Single-Homed + IXP
2.4) Multi-Homed + IXP
2.5) Multi-Homed + IXP +
Providing transit services
101©Copyright md brasil - direitos reservados
Scenario IV
Dual Homed + IXP
providing transit services
Internet
Transit
Operator
Your AS
IXP
AS1
AS2
Transit
Operator 2
©md1302192045
Transit
ClientLast Scenario 
102©Copyright md brasil - direitos reservados
Becoming a Transit AS
Supposing the agreement with our customer has the following
statements:
 He will announce prefix 200.0.0.0/20;
 His AS number is 200 and we’ll allow them to make any
number of prepends;
 He is not transit to any other provider;
 We’ll offer him native IPv6 transit.
103©Copyright md brasil - direitos reservados
Filtering for Scenario IV
1) Ingress Filters:
The same for discarding default route and own prefix:
+ Discard receiving via external peers, our customer’s
prefixes (if we only want to communicate with him directly):
104©Copyright md brasil - direitos reservados
Filtering for Scenario IV
2) Filters to avoid undesired traffic, have to be modified to
allow us sending the prefixes from our customer
Above filter should be done for each peer (TR1, TR2
and IXP) and placed before discard rule.
NB: We need also to notify external peers about the
new prefix and we’ll announce.
105©Copyright md brasil - direitos reservados
Filtering for Scenario IV
Avoiding “garbage”
from our Customer
Is possible to limit the
number of prefixes received
from peer.
Restart time will work in
case of Prefix Limit has
reached (BGP session is
closed)
106©Copyright md brasil - direitos reservados
Accepting only his prefix and only his AS number (but
allowing any number of prepends with regexp)
Filtering for Scenario IV
Avoiding “garbage”
from our Customer
Discarding all the rest
107©Copyright md brasil - direitos reservados
Agenda
1) BGP essentials and basics of BGP
filtering;
2) Case Studies:
2.1) Overview
2.2) Single-Homed Provider
2.3) Single-Homed + IXP
2.4) Multi-Homed + IXP
2.5) Multi-Homed + IXP +
Providing transit services
108©Copyright md brasil - direitos reservados
Final Considerations
Filtering techniques presented here are commonly used
practices considering natural scenarios evolution for
Small/Medium ISPs.
The purpose of this work is the orientation on how and
where to use the filters with Mikrotik RouterOS and
obviously they should be adapted for particular situations.
Some slides can have edition mistakes. So, if interested,
ask for the export file of the router.
109©Copyright md brasil - direitos reservados
Thank you
Hvala!
Wardner Maia – maia@mdbrasil.com.br
110©Copyright md brasil - direitos reservados
Download this
presentation
Soon, this presentation will be available for
download at Mikrotik and MD Brasil Web sites.
www.mikrotikbrasil.com.br/artigos
111©Copyright md brasil - direitos reservados

Weitere ähnliche Inhalte

Was ist angesagt?

CISCO Virtual Private LAN Service (VPLS) Technical Deployment Overview
CISCO Virtual Private LAN Service (VPLS) Technical Deployment OverviewCISCO Virtual Private LAN Service (VPLS) Technical Deployment Overview
CISCO Virtual Private LAN Service (VPLS) Technical Deployment OverviewAmeen Wayok
 
Mikrotik IP Settings For Performance and Security
Mikrotik IP Settings For Performance and SecurityMikrotik IP Settings For Performance and Security
Mikrotik IP Settings For Performance and SecurityGLC Networks
 
Segment Routing
Segment RoutingSegment Routing
Segment RoutingAPNIC
 
Visualizing and Troubleshooting BGP Routing
Visualizing and Troubleshooting BGP RoutingVisualizing and Troubleshooting BGP Routing
Visualizing and Troubleshooting BGP RoutingThousandEyes
 
MPLS L3 VPN Deployment
MPLS L3 VPN DeploymentMPLS L3 VPN Deployment
MPLS L3 VPN DeploymentAPNIC
 
Segment Routing: A Tutorial
Segment Routing: A TutorialSegment Routing: A Tutorial
Segment Routing: A TutorialAPNIC
 
Waris l2vpn-tutorial
Waris l2vpn-tutorialWaris l2vpn-tutorial
Waris l2vpn-tutorialrakiva29
 
MikroTik Basic Training Class - Online Moduls - English
 MikroTik Basic Training Class - Online Moduls - English MikroTik Basic Training Class - Online Moduls - English
MikroTik Basic Training Class - Online Moduls - EnglishAdhie Lesmana
 
Why and How to Interconnect IXP
Why and How to Interconnect IXPWhy and How to Interconnect IXP
Why and How to Interconnect IXPInternet Society
 
BGP Traffic Engineering / Routing Optimisation
BGP Traffic Engineering / Routing OptimisationBGP Traffic Engineering / Routing Optimisation
BGP Traffic Engineering / Routing OptimisationAndy Davidson
 
Cisco Live! :: Introduction to IOS XR for Enterprises and Service Providers
Cisco Live! :: Introduction to IOS XR for Enterprises and Service ProvidersCisco Live! :: Introduction to IOS XR for Enterprises and Service Providers
Cisco Live! :: Introduction to IOS XR for Enterprises and Service ProvidersBruno Teixeira
 
BGP Services IP Transit vs IP Peering
BGP Services  IP Transit vs IP PeeringBGP Services  IP Transit vs IP Peering
BGP Services IP Transit vs IP PeeringGLC Networks
 
MPLS SDN 2016 - Microloop avoidance with segment routing
MPLS SDN 2016 - Microloop avoidance with segment routingMPLS SDN 2016 - Microloop avoidance with segment routing
MPLS SDN 2016 - Microloop avoidance with segment routingStephane Litkowski
 
MikroTik & RouterOS
MikroTik & RouterOSMikroTik & RouterOS
MikroTik & RouterOSFaelix Ltd
 
MikroTik Multicast Routing [www.imxpert.co]
MikroTik Multicast Routing [www.imxpert.co]MikroTik Multicast Routing [www.imxpert.co]
MikroTik Multicast Routing [www.imxpert.co]Faisal Reza
 

Was ist angesagt? (20)

CISCO Virtual Private LAN Service (VPLS) Technical Deployment Overview
CISCO Virtual Private LAN Service (VPLS) Technical Deployment OverviewCISCO Virtual Private LAN Service (VPLS) Technical Deployment Overview
CISCO Virtual Private LAN Service (VPLS) Technical Deployment Overview
 
Mikrotik IP Settings For Performance and Security
Mikrotik IP Settings For Performance and SecurityMikrotik IP Settings For Performance and Security
Mikrotik IP Settings For Performance and Security
 
Segment Routing
Segment RoutingSegment Routing
Segment Routing
 
Visualizing and Troubleshooting BGP Routing
Visualizing and Troubleshooting BGP RoutingVisualizing and Troubleshooting BGP Routing
Visualizing and Troubleshooting BGP Routing
 
MPLS L3 VPN Deployment
MPLS L3 VPN DeploymentMPLS L3 VPN Deployment
MPLS L3 VPN Deployment
 
MENOG-Segment Routing Introduction
MENOG-Segment Routing IntroductionMENOG-Segment Routing Introduction
MENOG-Segment Routing Introduction
 
Segment Routing: A Tutorial
Segment Routing: A TutorialSegment Routing: A Tutorial
Segment Routing: A Tutorial
 
Waris l2vpn-tutorial
Waris l2vpn-tutorialWaris l2vpn-tutorial
Waris l2vpn-tutorial
 
MikroTik Basic Training Class - Online Moduls - English
 MikroTik Basic Training Class - Online Moduls - English MikroTik Basic Training Class - Online Moduls - English
MikroTik Basic Training Class - Online Moduls - English
 
Bgp
BgpBgp
Bgp
 
Vpc notes
Vpc notesVpc notes
Vpc notes
 
Why and How to Interconnect IXP
Why and How to Interconnect IXPWhy and How to Interconnect IXP
Why and How to Interconnect IXP
 
VLAN on mikrotik
VLAN on mikrotikVLAN on mikrotik
VLAN on mikrotik
 
BGP Traffic Engineering / Routing Optimisation
BGP Traffic Engineering / Routing OptimisationBGP Traffic Engineering / Routing Optimisation
BGP Traffic Engineering / Routing Optimisation
 
Cisco Live! :: Introduction to IOS XR for Enterprises and Service Providers
Cisco Live! :: Introduction to IOS XR for Enterprises and Service ProvidersCisco Live! :: Introduction to IOS XR for Enterprises and Service Providers
Cisco Live! :: Introduction to IOS XR for Enterprises and Service Providers
 
Secured Internet Gateway for ISP with pfsense & FRR
Secured Internet Gateway for ISP with pfsense & FRRSecured Internet Gateway for ISP with pfsense & FRR
Secured Internet Gateway for ISP with pfsense & FRR
 
BGP Services IP Transit vs IP Peering
BGP Services  IP Transit vs IP PeeringBGP Services  IP Transit vs IP Peering
BGP Services IP Transit vs IP Peering
 
MPLS SDN 2016 - Microloop avoidance with segment routing
MPLS SDN 2016 - Microloop avoidance with segment routingMPLS SDN 2016 - Microloop avoidance with segment routing
MPLS SDN 2016 - Microloop avoidance with segment routing
 
MikroTik & RouterOS
MikroTik & RouterOSMikroTik & RouterOS
MikroTik & RouterOS
 
MikroTik Multicast Routing [www.imxpert.co]
MikroTik Multicast Routing [www.imxpert.co]MikroTik Multicast Routing [www.imxpert.co]
MikroTik Multicast Routing [www.imxpert.co]
 

Andere mochten auch (20)

Bgp
BgpBgp
Bgp
 
PRUEBAS ICFES SABER 11
PRUEBAS ICFES SABER 11PRUEBAS ICFES SABER 11
PRUEBAS ICFES SABER 11
 
MPF
MPFMPF
MPF
 
Tupi es
Tupi esTupi es
Tupi es
 
Honors spanish 2 grammar book
Honors spanish 2 grammar bookHonors spanish 2 grammar book
Honors spanish 2 grammar book
 
Hardening em sistemas - Overview
Hardening em sistemas  - OverviewHardening em sistemas  - Overview
Hardening em sistemas - Overview
 
Sintesis informativa 01 04 2013
Sintesis informativa 01 04 2013Sintesis informativa 01 04 2013
Sintesis informativa 01 04 2013
 
Preconceito Na Escola
Preconceito Na EscolaPreconceito Na Escola
Preconceito Na Escola
 
Spanish grammar book
Spanish grammar book Spanish grammar book
Spanish grammar book
 
uso del e-mail
uso del e-mailuso del e-mail
uso del e-mail
 
Coracoes E Estrelas
Coracoes E EstrelasCoracoes E Estrelas
Coracoes E Estrelas
 
Taboao
TaboaoTaboao
Taboao
 
Teología A Distancia
Teología A DistanciaTeología A Distancia
Teología A Distancia
 
A2 A Ppt
A2 A PptA2 A Ppt
A2 A Ppt
 
Introduccion a MOSS 2007
Introduccion a MOSS 2007Introduccion a MOSS 2007
Introduccion a MOSS 2007
 
Apresentação midia kit alma do negócio
Apresentação midia kit  alma do negócioApresentação midia kit  alma do negócio
Apresentação midia kit alma do negócio
 
Universidades Públicas de São Paulo
Universidades Públicas de São PauloUniversidades Públicas de São Paulo
Universidades Públicas de São Paulo
 
Edital tj
Edital tjEdital tj
Edital tj
 
68060200610
6806020061068060200610
68060200610
 
Revista ciencias
Revista cienciasRevista ciencias
Revista ciencias
 

Ähnlich wie BGP filtering - Zagreb 2013

Mpls security - Venice 2014
Mpls security - Venice 2014 Mpls security - Venice 2014
Mpls security - Venice 2014 Wardner Maia
 
Lte outbound roaming_session
Lte outbound roaming_sessionLte outbound roaming_session
Lte outbound roaming_sessionSamir Mohanty
 
BGP evolution -from SDN perspective
BGP evolution -from SDN perspectiveBGP evolution -from SDN perspective
BGP evolution -from SDN perspectiveMiya Kohno
 
Mobile Services
Mobile ServicesMobile Services
Mobile Servicesjagishar
 
03_MAX-NG_OVERVIEW_CORE.pptx
03_MAX-NG_OVERVIEW_CORE.pptx03_MAX-NG_OVERVIEW_CORE.pptx
03_MAX-NG_OVERVIEW_CORE.pptxnitin_009
 
Trg138042019_1_annex_MAX-NG.pptx
Trg138042019_1_annex_MAX-NG.pptxTrg138042019_1_annex_MAX-NG.pptx
Trg138042019_1_annex_MAX-NG.pptxSAROORNAGARCMCORE
 
07_PRE_MIGRATION_ACT.ppt
07_PRE_MIGRATION_ACT.ppt07_PRE_MIGRATION_ACT.ppt
07_PRE_MIGRATION_ACT.pptnitin_009
 
SLT-IX Setting up an Internet Exchange : Sri Lankan experience
SLT-IX Setting up an Internet Exchange : Sri Lankan experienceSLT-IX Setting up an Internet Exchange : Sri Lankan experience
SLT-IX Setting up an Internet Exchange : Sri Lankan experienceAPNIC
 
F5 Solutions for Service Providers
F5 Solutions for Service ProvidersF5 Solutions for Service Providers
F5 Solutions for Service ProvidersBAKOTECH
 
AIRCOM LTE Webinar 1 - Network Architecture
AIRCOM LTE Webinar 1 - Network ArchitectureAIRCOM LTE Webinar 1 - Network Architecture
AIRCOM LTE Webinar 1 - Network ArchitectureAIRCOM International
 
CNv6_instructorPPT_Chapter3.pptx
CNv6_instructorPPT_Chapter3.pptxCNv6_instructorPPT_Chapter3.pptx
CNv6_instructorPPT_Chapter3.pptxVishalThakor19
 
Network Simulation - Prague 2015
Network Simulation - Prague 2015Network Simulation - Prague 2015
Network Simulation - Prague 2015Wardner Maia
 
P&G BT Global Services - LLD Final Revision Year 2008.
P&G BT Global Services - LLD Final Revision Year 2008.P&G BT Global Services - LLD Final Revision Year 2008.
P&G BT Global Services - LLD Final Revision Year 2008.Kapil Sabharwal
 
BGP Traffic Engineering with SDN Controller
BGP Traffic Engineering with SDN ControllerBGP Traffic Engineering with SDN Controller
BGP Traffic Engineering with SDN ControllerAPNIC
 
Webinar Renesas - IoT é Segura? Com Renesas Synergy sim! E o SSP 1.5 tornou a...
Webinar Renesas - IoT é Segura? Com Renesas Synergy sim! E o SSP 1.5 tornou a...Webinar Renesas - IoT é Segura? Com Renesas Synergy sim! E o SSP 1.5 tornou a...
Webinar Renesas - IoT é Segura? Com Renesas Synergy sim! E o SSP 1.5 tornou a...Embarcados
 
IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...
IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...
IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...gogo6
 
Soracom iot hands-on workshop in Montreal
Soracom iot hands-on workshop in MontrealSoracom iot hands-on workshop in Montreal
Soracom iot hands-on workshop in MontrealSoracom Global, Inc.
 
Black Belt Tips for Cloud Network Operations - AWS Summit Sydney
Black Belt Tips for Cloud Network Operations - AWS Summit SydneyBlack Belt Tips for Cloud Network Operations - AWS Summit Sydney
Black Belt Tips for Cloud Network Operations - AWS Summit SydneyAmazon Web Services
 
Introduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU Gateways
Introduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU GatewaysIntroduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU Gateways
Introduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU GatewaysICP DAS USA, Inc.
 

Ähnlich wie BGP filtering - Zagreb 2013 (20)

Mpls security - Venice 2014
Mpls security - Venice 2014 Mpls security - Venice 2014
Mpls security - Venice 2014
 
Lte outbound roaming_session
Lte outbound roaming_sessionLte outbound roaming_session
Lte outbound roaming_session
 
BGP evolution -from SDN perspective
BGP evolution -from SDN perspectiveBGP evolution -from SDN perspective
BGP evolution -from SDN perspective
 
Mobile Services
Mobile ServicesMobile Services
Mobile Services
 
03_MAX-NG_OVERVIEW_CORE.pptx
03_MAX-NG_OVERVIEW_CORE.pptx03_MAX-NG_OVERVIEW_CORE.pptx
03_MAX-NG_OVERVIEW_CORE.pptx
 
Trg138042019_1_annex_MAX-NG.pptx
Trg138042019_1_annex_MAX-NG.pptxTrg138042019_1_annex_MAX-NG.pptx
Trg138042019_1_annex_MAX-NG.pptx
 
1 owa010010 wcdma ran overview issue 1.15
1 owa010010 wcdma ran overview issue 1.151 owa010010 wcdma ran overview issue 1.15
1 owa010010 wcdma ran overview issue 1.15
 
07_PRE_MIGRATION_ACT.ppt
07_PRE_MIGRATION_ACT.ppt07_PRE_MIGRATION_ACT.ppt
07_PRE_MIGRATION_ACT.ppt
 
SLT-IX Setting up an Internet Exchange : Sri Lankan experience
SLT-IX Setting up an Internet Exchange : Sri Lankan experienceSLT-IX Setting up an Internet Exchange : Sri Lankan experience
SLT-IX Setting up an Internet Exchange : Sri Lankan experience
 
F5 Solutions for Service Providers
F5 Solutions for Service ProvidersF5 Solutions for Service Providers
F5 Solutions for Service Providers
 
AIRCOM LTE Webinar 1 - Network Architecture
AIRCOM LTE Webinar 1 - Network ArchitectureAIRCOM LTE Webinar 1 - Network Architecture
AIRCOM LTE Webinar 1 - Network Architecture
 
CNv6_instructorPPT_Chapter3.pptx
CNv6_instructorPPT_Chapter3.pptxCNv6_instructorPPT_Chapter3.pptx
CNv6_instructorPPT_Chapter3.pptx
 
Network Simulation - Prague 2015
Network Simulation - Prague 2015Network Simulation - Prague 2015
Network Simulation - Prague 2015
 
P&G BT Global Services - LLD Final Revision Year 2008.
P&G BT Global Services - LLD Final Revision Year 2008.P&G BT Global Services - LLD Final Revision Year 2008.
P&G BT Global Services - LLD Final Revision Year 2008.
 
BGP Traffic Engineering with SDN Controller
BGP Traffic Engineering with SDN ControllerBGP Traffic Engineering with SDN Controller
BGP Traffic Engineering with SDN Controller
 
Webinar Renesas - IoT é Segura? Com Renesas Synergy sim! E o SSP 1.5 tornou a...
Webinar Renesas - IoT é Segura? Com Renesas Synergy sim! E o SSP 1.5 tornou a...Webinar Renesas - IoT é Segura? Com Renesas Synergy sim! E o SSP 1.5 tornou a...
Webinar Renesas - IoT é Segura? Com Renesas Synergy sim! E o SSP 1.5 tornou a...
 
IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...
IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...
IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...
 
Soracom iot hands-on workshop in Montreal
Soracom iot hands-on workshop in MontrealSoracom iot hands-on workshop in Montreal
Soracom iot hands-on workshop in Montreal
 
Black Belt Tips for Cloud Network Operations - AWS Summit Sydney
Black Belt Tips for Cloud Network Operations - AWS Summit SydneyBlack Belt Tips for Cloud Network Operations - AWS Summit Sydney
Black Belt Tips for Cloud Network Operations - AWS Summit Sydney
 
Introduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU Gateways
Introduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU GatewaysIntroduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU Gateways
Introduction to Modbus to Ethernet Device Servers and Modbus TCP to RTU Gateways
 

Kürzlich hochgeladen

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Kürzlich hochgeladen (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

BGP filtering - Zagreb 2013

  • 1. BGP Filtering with RouterOS European MUM – 2013 - Zagreb / Croatia Wardner Maia External Connectivity Strategies for Multi- Homed ISP’s, connected to an IXP Environment and providing transit services
  • 2. Copyright Notice (Aviso sobre direitos autorais) English: This material is an effort intended to improve the level of knowledge of professionals that work with Mikrotik RouterOS and should be used solely for self-study purposes. Digital copies and/or any printed material contained in this presentation or derived from it are property of MD Brasil TI & Telecom and cannot be used for any kind of training, presentation or workshop, even non-commercial ones. Reproduction of any part or picture requires previous written authorization of MD Brasil. For information about how to obtain such authorization, please contact mdbrasil@mdbrasil.com.br. ©Copyright md brasil - direitos reservados 2 Portuguese: Este material é um esforço que visa aprimorar o grau de conhecimento de profissionais que trabalham com Mikrotik RouterOS e deve ser usado apenas com objetivos de auto estudo. Cópias digitais e/ou materiais impressos com conteúdo desta apresentação ou dela derivados são de propriedade a MD Brasil TI & Telecom a não podem ser usados para qualquer tipo de treinamento, apresentação ou seminário, mesmo os de finalidades não comerciais. A reprodução de qualquer parte ou figura requer prévia autorização por escrito da MD Brasil. Para informações em como obter esta autorização, por favor contate mdbrasil@mdbrasil.com.br.
  • 3. Introduction Wardner Maia Electronic and Telecommunications Engineer; Internet Service Provider since 1995; Radio Frequency Trainings since 2002; Certified Mikrotik Trainer since 2007; MD Brasil IT & Telecom CTO Member of the board of directors of LACNIC 3©Copyright md brasil - direitos reservados
  • 4. Introduction MD Brasil IT & Telecom Internet Access Provider in São Paulo state - Brazil; Telecom equipment manufacturer and integrator; Mikrotik Training Partner since 2007; Mikrotik distributor; Consulting services worldwide; http://www.mdbrasil.com.br http://mikrotikbrasil.com.br 4©Copyright md brasil - direitos reservados
  • 5. Objectives and Target Audience Objectives: To understand BGP filtering techniques to be applied to a multi connected network and intended to implement external routing policies, providing traffic balance, security and reliability. Target Audience: ISP’s and Telecom operators running or intending to run BGP with Mikrotik RouterOS. 5©Copyright md brasil - direitos reservados
  • 6. Agenda 1) BGP essentials and basics of BGP filtering; 2) Case Studies: 2.1) Overview 2.2) Single-Homed Provider 2.3) Single-Homed + IXP 2.4) Multi-Homed + IXP 2.5) Multi-Homed + IXP + Providing transit services 6©Copyright md brasil - direitos reservados
  • 7. Agenda 1) BGP essentials and basics of BGP filtering; 2) Case Studies: 2.1) Overview 2.2) Single-Homed Provider 2.3) Single-Homed + IXP 2.4) Multi-Homed + IXP 2.5) Multi-Homed + IXP + Providing transit services 7©Copyright md brasil - direitos reservados
  • 8. The Internet is composed of lots of interconnected networks, each one under an independent technical administration. Such networks are called an “Autonomous System”. Your AS Autonomous Systems and the Internet ©md1302192041 AS-1 AS-2 AS-3 8©Copyright md brasil - direitos reservados
  • 9. Autonomous System One definition for an AS can be: In practice you could become an AS with a administrative process, requesting numeration resources from a RIR (Regional Internet Registry) For Europe: RIPE NCC Autonomous System ©md1302192042 “An Autonomous System (AS) is a group of IP networks run by one or more network operators with a single, clearly defined routing policy.” 9©Copyright md brasil - direitos reservados
  • 10. Internet Numbering Resources IANA AFRINIC APNIC ARIN LACNIC RIPE MX BRID KR JP CH TW VT ©md1303102108 RIR’s LIR’s 10©Copyright md brasil - direitos reservados
  • 11. AS-1 BGP protocol is the “language” that AS’s talk each other, exchanging routing information and making all destinations reachable. AS-2 Your AS AS-3 BGP BGP BGP BGP BGP Autonomous Systems, Internet and BGP Protocol ©md1302192041 11©Copyright md brasil - direitos reservados
  • 12. To deal with all Internet traffic, BGP should: BGP Protocol  be a scalable protocol capable to handle with a huge amount of network prefixes always growing;  have robustness and reliability;  provide tools to in some way to influence on external traffic not under the direct control of the administrator. 12©Copyright md brasil - direitos reservados
  • 13. BGP Characteristics: BGP protocol  Can be considered a “vector distance” protocol, where each AS represents a single routing hop;  No matter how big is the network BGP doesn’t care about internal topology but only how can reach the networks.  Current BGP version is BGPv4 according to RFC-1771 13©Copyright md brasil - direitos reservados
  • 14. Basic principles: BGP Protocol BGP works exchanging routing information about reachability of networks with NLRI (Network Layer Reachability Information) messages; NLRI messages have one or more network prefixes and attributes associated with them; To ensure data integrity, information are transported over a TCP connection (port 179). 14©Copyright md brasil - direitos reservados
  • 15.  Both administrators configure the BGP peering;  A TCP session to port 179 is established and over it the BGP session;  Both sides exchange routing information until total convergence;  After this only information about new and withdrawn routes are excehanged. Running BGP AS-2AS-1 ©md1302200234 15©Copyright md brasil - direitos reservados
  • 16. BGP Messages OPEN First message sent after TCP connection establishment and confirmed with a KEEPALIVE; KEEPALIVE Messages exchanged in intervals of 60 seconds to check peer state; UPDATE Information about network prefixes; NOTIFICATION Sent when an error occurs; Optional message: ROUTE REFRESH Ask the neighbor to send the routes again. AS-2AS-1 ©md1302200234 16©Copyright md brasil - direitos reservados
  • 17. BGP states 3 - Active 2 - Connect 4-OpenSent 1-Idle 5-OpenConfirm 6-EstablishedKEEPALIVE KEEPALIVE OPEN Waiting for TCP connection Waiting for start event Trying to get a peer Neighbor negotiation complete KEEPALIVE UPDATE ©md1302200235 17©Copyright md brasil - direitos reservados
  • 18. BGP states 3 - Active 2 - Connect 4-OpenSent 1-Idle 6-EstablishedKEEPALIVE NOTIFICATION NOTIFICATION KEEPALIVE Waiting for keepalive or notification from a peer OPEN OPEN NOTIFICATION Waiting for TCP connection Waiting for start event Trying to get a peer Neighbor negotiation complete KEEPALIVE UPDATE ©md1302200235 5-OpenConfirm 18©Copyright md brasil - direitos reservados
  • 19. UPDATE message Unfeasible Routes Length (16 Bits) Withdrawn Routes (Variable) Total Path Attributes Length (16 Bits) Path Attributes (Variable) Prefix (1/2/3/4 bytes)Length (1 byte) Prefix (1/2/3/4 bytes)Length (1 byte) Unreachable Routes Path Attributes NLRI 19©Copyright md brasil - direitos reservados
  • 20. Attributes Types Attributes Well Known Mandatory Discretionary Optional Transitive Intransitive Recognized by all BGP implementations Optionally recognized Presents in all BGP messages May be present or not in BGP messages Propagated to other routers, even if not supported Not propagated to other routers©md1302201203 20©Copyright md brasil - direitos reservados
  • 21. AS-Path, Next-Hop, Communities and Local Preference AS-Path: AS sequence through which a network is reachable; Next-Hop: IP address of the next hop router Community: Numeric value that can be attached to a prefix with some specific purpose; Local Preference: Attribute used to choose a preferred outbound path inside an AS; 21©Copyright md brasil - direitos reservados
  • 22. Understanding the AS-Path ©md1302200202 AS-100 AS-400 AS-200 AS-300 Rede 1.1.0.0/20 AS-Path 200, 100 AS-Path 300, 200, 100 NETWORK 1.1.0.0/20 AS-path 300,200,100 AS-Path 100 22©Copyright md brasil - direitos reservados
  • 23. Looping Prevention ©md1302200202 AS-100 AS-400 AS-200 AS-300 Rede 1.1.0.0/20 AS-Path 200, 100 AS-Path 300, 200, 100 AS-Path 100 AS-Path 400, 300, 200, 100 When an AS sees his own AS number inside an AS-Path, the announcement will be discarded. 23©Copyright md brasil - direitos reservados
  • 25. Next-Hop on an shared network (e.g. IXP) ©md1302201755 AS-10 AS-30 Network 1.1.0.0/20 AS-20 10.1.1.1 10.1.1.2 10.1.1.3 Network 1.1.0.0/20 AS-Path 10 Next-Hop 10.1.1.1 To optimize packet forwarding, in a shared subnet, next hop will be kept. Network 1.1.0.0/20 AS-Path 10, 20 Next-Hop 10.1.1.1 25©Copyright md brasil - direitos reservados
  • 26. How BGP decides about the best route? 26©Copyright md brasil - direitos reservados
  • 27. Routing Essentials Routing Information Base (RIB) Routing Information base is the data base where all information about IP routes are stored. Each protocol has its RIB 27©Copyright md brasil - direitos reservados
  • 28. Routing Essentials Routes Processing This process will choose among the RIB routes, the ones that will be installed in the FIB 28©Copyright md brasil - direitos reservados
  • 29. Routing Essentials Forwarding Information Base (FIB) FIB contains information of prefixes related to the network interfaces that could be used to forward packets. 29©Copyright md brasil - direitos reservados
  • 30. How BGP decides about the best routes When receiving a BGP update message: Does AS-Path have my own AS? Discard Information UpdateMessage Yes No Install Route in the RIB Is the route discarded by routing filters? Is Next-Hop reachable? Yes No Yes No Copyright © MD1303091345 30©Copyright md brasil - direitos reservados
  • 31. How BGP decides about the best routes If the route is the first one in the RIB, it will be chosen. Otherwise, BGP decision criteria will be considered for selection Consider BGP Criteria to choose the best route Copyright © MD1303091345 Install this prefix in the FIB Route is in the RIB Is there an identical prefix? Yes No 31©Copyright md brasil - direitos reservados
  • 32. BGP criteria for decision 1) Prefers the path with highest WEIGHT (default = 0); 2) Prefers path with highest LOCAL-PREFERENCE (default = 100); 3) Prefers path with the shortest AS-Path; 4) Prefers the path locally originated via aggregate or BGP network announce; 5) Prefers the path with lowest ORIGIN (igp < egp < incomplete); 6) Prefers the path with the lowest MED (default = 0); 7) Prefers the path learned by eBGP over the ones by iBGP; 8) Prefers the path received from the router with lower Router ID; 9) Prefers the path with shortest route reflection cluster list (default = 0); 10)Prefers the path that comes from the lowest neighbor address. BGP will compare identical prefixes in the following order: 32©Copyright md brasil - direitos reservados
  • 33. Routing Filters The way to influence BGP decision is by configuring routing filters. Filtering incoming routes will change, how we see the external world, thus influencing how we send traffic; Filtering outgoing routes will change how the world see us, thus influencing how we receive traffic. 33©Copyright md brasil - direitos reservados
  • 34. BGP Filter placement Routing Information Base (RIB) Routes processing Route Updates Forwarding Information Base (FIB) Route Updates Static and connected routes BGP Routes Input Filters Routes Exchanges With Neighbor Nodes Output Filters BGP Routes advertisements md1303082332 34©Copyright md brasil - direitos reservados
  • 35. Understanding Routing Filters “Semantics” in RouterOS Matchers by the prefix itself, prefix-length, protocol, routing marks, etc. Matchers by BGP attributes inside the UPDATE message. Actions to be done, like accept, discard etc. Actions intended to modify BGP attributes on a specific route. Matchers Actions 35©Copyright md brasil - direitos reservados
  • 36. Agenda 1) BGP essentials and basics of BGP filtering; 2) Case Studies: 2.1) Overview 2.2) Single-Homed Provider 2.3) Single-Homed + IXP 2.4) Multi-Homed + IXP 2.5) Multi-Homed + IXP + Providing transit services 36©Copyright md brasil - direitos reservados
  • 37. Scenario I Single Homed ISP Internet Transit Operator Your AS ©md1302192043 37©Copyright md brasil - direitos reservados
  • 38. Your AS Scenario II Single-Homed + IXP Internet Transit Operator IXP AS1 AS1 ©md1302192044 38©Copyright md brasil - direitos reservados
  • 39. Scenario III Dual-Homed + IXP Internet Transit Operator Your AS IXP AS1 AS2 Transit Operator 2 ©md1302192045 39©Copyright md brasil - direitos reservados
  • 40. Scenario IV Dual-Homed + IXP Providing Transit services Internet Transit Operator Your AS IXP AS1 AS2 Transit Operator 2 ©md1302192045 Transit Client 40©Copyright md brasil - direitos reservados
  • 41. Scenario V – Multi-Homed + IXP + iBGP + Confederation Internet PTT AS1 AS2 ©md1302192258 TR2 TR1 41©Copyright md brasil - direitos reservados
  • 42. Agenda 1) BGP essentials and basics of BGP filtering; 2) Case Studies: 2.1) Overview 2.2) Single-Homed Provider 2.3) Single-Homed + IXP 2.4) Multi-Homed + IXP 2.5) Multi-Homed + IXP + Providing transit services 42©Copyright md brasil - direitos reservados
  • 43. Scenario I Single-Homed ISP Internet Transit Operator Your AS ©md1302192043 43©Copyright md brasil - direitos reservados
  • 44. Before BGP Session You should sign an agreement with your transit provider to define some policies for you BGP session, like:  If you want Full or Partial Routing;  Which prefixes you intend to announce;  If you want a default Route;  MD5 password;  If the session should be established with a loopback interface; etc. 44©Copyright md brasil - direitos reservados
  • 45. Simulating the Scenario For the purpose of this presentation, we are going to assume that:  Our transit provider is sending us a Full routing table;  We’re announcing the prefix 11.11.0.0/20;  Our peer will be established with a direct connected interface*  Our Transit Provider does not offer native IPv6 transit. * Not a good practice. Please see work about routing security: http://mum.mikrotik.com/presentations/HU11/maia.pdf 45©Copyright md brasil - direitos reservados
  • 46. BGP Configuration Minimal Configuration: AS Number and Peer Router ID: Optional (but recommended) ASN=65000 172.16.21.1/30 ASN=65021 172.16.21.2/30 46©Copyright md brasil - direitos reservados
  • 47. BGP Configuration Minimal configuration for peer: Remote IP and Remote AS ASN=65000 172.16.21.1/30 ASN=65021 172.16.21.2/30 47©Copyright md brasil - direitos reservados
  • 49. Testing the Results Supposing you ask for a Full routing, by this time you can look on your routing table and see ~400k network prefixes. Do we need this bunch of prefixes? 49©Copyright md brasil - direitos reservados
  • 50. Prefixes Control By default, nothing is filtered. Routing filters allow the control of ingress and egress announcements. Transit Operator Your AS ©md1302192046 50©Copyright md brasil - direitos reservados
  • 51. BGP Filtering for Scenario 1 To spare resources, you can:  Discard all routes received  Setup a static default route Internet Transit Operator Your AS ©md1302192043 Filter Peer 51©Copyright md brasil - direitos reservados
  • 52. Break for hands on! Discarding all routes and configuring a default one (“Internet”  99.99.0.1) 52©Copyright md brasil - direitos reservados
  • 53. Anything else to do with a Single-Homed ISP? Having a default route, all packets to any destination will be forwarded, including that ones destined to bogons networks. Bogons prefixes are valid ones, but not allocated to any provider or final consumer (they remain “in stock” of the RIR’s0 It is a good practice to deal with BOGONS prefixes! If we have a default route, should we do anything else? QUIZZ 53©Copyright md brasil - direitos reservados
  • 54. Bogons treatment To get automatic information about bogons prefixes, we’ll establish a BGP session with Cymru Team http://www.team- cymru.org/ Cymru will send bogons prefixes via BGP with the COMMUNITY attribute 65332:888 54©Copyright md brasil - direitos reservados
  • 55. Understanding Communities A Community is a 32 bit number you can attach to a route with the purpose to signalize something to other AS’s. A community can be viewed like a “flag” in the route. There are well known communities, like no-export, no-advertise etc. but any AS can set this own set of communities. The usual format of a community is to split the 32 bit in 2 numbers: AS number:some_number Communities are widely used to implement routing policies, like:  Allowing a remote AS to set some Local Preference when sending the announcements;  Putting a IP address or network in black hole. Etc. 55©Copyright md brasil - direitos reservados
  • 56. Announcements with community 65332:888 Understanding Communities Cymru Your AS In our case, we know that Cymru will send bogons prefixes with the community 65332:888 and then we’ll set up an ingress filter seeing in de BGP attributes if such “flag” is present. 56©Copyright md brasil - direitos reservados
  • 57. Peering with Cymru Note that peering with Cymru is a Multihop session 57©Copyright md brasil - direitos reservados
  • 58. Filtering Routes with Cymru Accepting Cymru routes and setting them as blackhole Avoiding other routes IN and OUT 58©Copyright md brasil - direitos reservados
  • 59. Break for hands on! Establishing a peering to Cymru and putting routes in blackhole 59©Copyright md brasil - direitos reservados
  • 60. What about IPv6? Supposing our transit provider doesn’t supply native IPv6 connectivity, and we want to use this protocol, we can, via a Tunnel Broker, to be IPv6 worldwide connected. Tunnel configuration BGP configuration 60©Copyright md brasil - direitos reservados
  • 61. Break for hands on! Establishing a IPv6 tunnel and receiving the routes (“Internet”  2001:a::1) 61©Copyright md brasil - direitos reservados
  • 62. Agenda 1) BGP essentials and basics of BGP filtering; 2) Case Studies: 2.1) Overview 2.2) Single-Homed Provider 2.3) Single-Homed + IXP 2.4) Multi-Homed + IXP 2.5) Multi-Homed + IXP + Providing transit services 62©Copyright md brasil - direitos reservados
  • 63. What is an IXP? IXP – Internet Exchange Point (Or NAP – Network Exchange Point or MAE – Metropolitan Area Exchange) Network solution whose purpose is to facilitate direct connections between Autonomous Systems, promoting the exchange of Internet traffic. An IXP optimizes AS interconnection, allowing: Better quality (low latency); Avoid intermediates; Lowering of costs (with a MLPA); Better organization of regional networks. 63©Copyright md brasil - direitos reservados
  • 64. Internet Exchange Point Basically an IXP is a Layer2 segment connecting AS’s Internet Google Facebook IXP IP transit provider ISP Y ISP X 64©Copyright md brasil - direitos reservados
  • 65. Scenario II Single Homed + IXP Transit Operator IXP AS1 ©md1302192044 Internet AS1 65©Copyright md brasil - direitos reservados Your AS
  • 66. Scenario II – without filtering 12.12.0.0/20, 13.13.0.0/20, …, 19.19.0.0/20 are networks announced to IXP. Note that without any filtering the IXP has “won” the election Why? Note that we also have 2 destinations to the same network. 66©Copyright md brasil - direitos reservados
  • 67. What about IPv6? In our IXP we have native IPv6 transit to the Internet and we will use this as preferred path to IPv6 world keeping the tunnel to HE as a backup. IPv6 exchange peering IPv6 transit peering 67©Copyright md brasil - direitos reservados
  • 68. Break for hands on! Establishing the peering with IXP for: IPv4 exchange, IPv6 exchange and IPv6 transit. 68©Copyright md brasil - direitos reservados
  • 69. Your AS Scenario II Single Homed + IXP Transit Operator IXP AS1 ©md1302192044 Internet AS1 Transit Effect (undesired) Without filtering AS-1 could decide that the best path to go to the Internet is via Your AS 69©Copyright md brasil - direitos reservados
  • 70. Transit effect in Scenario II To protect against undesirable “transit effect” your AS should advertise only its own prefixes. Above filters applied to peers IXP and Transit-1 in out- filter channel 70©Copyright md brasil - direitos reservados
  • 71. More Filtering – Ingress good Practices Good practices for ingress filters for all peers are:  Discard receiving own prefix;  Discard private and reserved networks stated at RFC 5735;  Discard default route (we are assuming a Full Routing) Is necessary to discard routes that contain own AS number in the AS-Path? QUIZZ 71©Copyright md brasil - direitos reservados
  • 72. RFC 5735 – Summary Table 1/2 Address Block Present Use Reference ------------------------------------------------------------------------- 0.0.0.0/8 "This" Network RFC 1122 10.0.0.0/8 Private-Use Networks RFC 1918 127.0.0.0/8 Loopback RFC 1122 169.254.0.0/16 Link Local RFC 3927 172.16.0.0/12 Private-Use Networks RFC 1918 192.0.0.0/24 IETF Protocol Assignments RFC 5736 192.0.2.0/24 TEST-NET-1 RFC 5737 192.88.99.0/24 6to4 Relay Anycast RFC 3068 72©Copyright md brasil - direitos reservados
  • 73. RFC 5735 – Summary Table 2/2 Address Block Present Use Reference ------------------------------------------------------------------------- 192.168.0.0/16 Private-Use Networks RFC 1918 198.18.0.0/15 Device Benchmark Testing RFC 2544 198.51.100.0/24 TEST-NET-2 RFC 5737 203.0.113.0/24 TEST-NET-3 RFC 5737 224.0.0.0/4 Multicast RFC 3171 240.0.0.0/4 Reserved for Future Use RFC 1112 255.255.255.255/32 Limited Broadcast RFC 919 RFC 922 73©Copyright md brasil - direitos reservados
  • 74. Ingress Filters for (almost) All Peers N.B: Private networks suppressed from this list because we’re using them. Hint: Action Jump can turn your filters more readable! 74©Copyright md brasil - direitos reservados
  • 75. Break for hands on! Enable protection filters for undesired transit effect and good practices ingress filters 75©Copyright md brasil - direitos reservados
  • 76. Agenda 1) BGP essentials and basics of BGP filtering; 2) Case Studies: 2.1) Overview 2.2) Single-Homed Provider 2.3) Single-Homed + IXP 2.4) Multi-Homed + IXP 2.5) Multi-Homed + IXP + Providing transit services 76©Copyright md brasil - direitos reservados
  • 77. Scenario III Multi-Homed + IXP 77©Copyright md brasil - direitos reservados
  • 78. Scenario III Multi-Homed + IXP Internet Transit Operator IXP AS1 AS2 Transit Operator 2 ©md1302192045 Your AS 78©Copyright md brasil - direitos reservados
  • 79. Scenario III Multi-Homed + IXP Internet Transit Operator IXP AS1 AS2 Transit Operator 2 ©md1302192045 Your AS 79©Copyright md brasil - direitos reservados
  • 80. Scenario III without filtering 12.12.0.0/20, 13.13.0.0/20, …, 19.19.0.0/20 are networks belonging to TR-2 and announced to IXP and TR-1 Note that we have a direct path and 2 other options 80©Copyright md brasil - direitos reservados
  • 81. Filtering for Scenario III 1) Ingress Filters will be the same: 2) Filters to avoid undesired traffic effect, as well What about filters to manipulate traffic? 81©Copyright md brasil - direitos reservados
  • 82. Traffic Manipulation 82©Copyright md brasil - direitos reservados
  • 83. Routing Filters The way to influence BGP decision is by configuring routing filters. Filtering incoming routes can change, how we see the external world, thus influencing how we send traffic; Filtering outgoing routes can change how the world see us, thus influencing how we receive traffic. 83©Copyright md brasil - direitos reservados
  • 84. Traffic Manipulation How to check results? 1) Tools that don’t tell all the true: Ping, traceroute, torch, bandwidth test… 2) Where should we see: Results of our upload policy: Our routing table Results of our download policy: Our routes as seen by other AS’s (looking glasses) 84©Copyright md brasil - direitos reservados
  • 85. Upload Control 85©Copyright md brasil - direitos reservados
  • 86. Upload Manipulation To influence our upload, basically we can manipulate 2 attributes: Weight Local-Preference Both will cause the same effect if we have a single router. 86©Copyright md brasil - direitos reservados
  • 87. Upload Manipulation Weight Weight Filters can set a “weight” to the route received from one peer. Routes with higher weight will be preferred (Default =0) OBS: Although weight is usually treated as a BGP attribute, in fact is not, because it is not propagated inside the update messages. TR1 ©md130230052 PTT 1.1.0.0/20 Weight=10 1.1.0.0/20 Weight=0 87©Copyright md brasil - direitos reservados
  • 88. Upload Manipulation Local-Preference Local-Preference Filters can set a Local- Preference to the route(s) received from one peer. Routes with higher LP, will be preferred to send traffic. Default LP is 100. OBS: Local Preference is a real attribute that propagates inside the entire AS. Does not propagate to other AS’s. TR1 ©md130230108 PTT 1.1.0.0/20 LP =150 1.1.0.0/20 LP = 100 88©Copyright md brasil - direitos reservados
  • 89. Upload Manipulation Weight or Local preference Natural upload preference is via TR2. Filter to set TR1 as the preferred path: or 89©Copyright md brasil - direitos reservados
  • 90. Break for hands on! Enable Local Preference filter and show the effect on routing table 90©Copyright md brasil - direitos reservados
  • 91. Download Control 91©Copyright md brasil - direitos reservados
  • 92. Download Manipulation Basically there are 3 ways to influence how downloads are received by our AS:  Controlling network advertisements with longer or shorter prefixes;  Manipulating AS-Path attribute;  Manipulating MED attribute; 92©Copyright md brasil - direitos reservados
  • 93. Download Manipulation with MED attribute With MED (Multi Exit Discriminator) one AS can inform a neighbor one, which is the preferred way to receive traffic. Lower MED will be used (default=0); With RouterOS, MED will work only when there are two ore more connections between AS’s. NB: In a scenario like the picture, TR1 MED will be ignored TR1 ©md1302230153 PTT MED=20 MED=30 MED=10 AS-X 93©Copyright md brasil - direitos reservados
  • 94. Download Manipulation by more specific announcements e.g.: AS-x announces half of its addresses for each link and the whole IP range for both links. The goal is to “guarantee” the balance and redundancy. OBS: This policy will succeed only if the use of ÍP’s are quite equilibrated. TR1 ©md130230052 TR2 1.1.0.0/21 1.1.0.0/20 1.1.8.0/21 1.1.0.0/20 AS-X 94©Copyright md brasil - direitos reservados
  • 95. Download Manipulation AS-Path prepend technique Example: before prepending AS-20 AS-10 ©md1302230258 AS-30 1 Gbps 100 Mbps1.1.0.0/20 Traffic Flow 95©Copyright md brasil - direitos reservados
  • 96. Download Manipulation AS-Path prepend technique Prepending 3 times self AS AS-20 AS-10 ©md1302230258 AS-30 1 Gbps 100 Mbps1.1.0.0/20 Direção do tráfego 96©Copyright md brasil - direitos reservados
  • 97. Download Manipulation Comparing the methods: MED: Efficient, but limited when having 2 or more connections to the same AS; More specific announcements: Aggressive resource. Will work regardless the number of hops. Can choose sub-optimal paths. Use in extreme cases. AS-Path prepend: “Soft” resource. Also has limitations due to number of AS-Path’s and topology changes. 97©Copyright md brasil - direitos reservados
  • 98. Download Manipulation with AS-Path prepend TR1 Routing table (looking glass) before AS- Path prepend Filters: 98 ©Copyright md brasil - direitos reservados
  • 99. Download Manipulation with AS-Path prepend TR1 Routing table (looking glass) after AS-Path prepend: 99©Copyright md brasil - direitos reservados
  • 100. Break for hands on! Enable AS-Path prepend filter and show the results on the “looking glass” 100©Copyright md brasil - direitos reservados
  • 101. Agenda 1) BGP essentials and basics of BGP filtering; 2) Case Studies: 2.1) Overview 2.2) Single-Homed Provider 2.3) Single-Homed + IXP 2.4) Multi-Homed + IXP 2.5) Multi-Homed + IXP + Providing transit services 101©Copyright md brasil - direitos reservados
  • 102. Scenario IV Dual Homed + IXP providing transit services Internet Transit Operator Your AS IXP AS1 AS2 Transit Operator 2 ©md1302192045 Transit ClientLast Scenario  102©Copyright md brasil - direitos reservados
  • 103. Becoming a Transit AS Supposing the agreement with our customer has the following statements:  He will announce prefix 200.0.0.0/20;  His AS number is 200 and we’ll allow them to make any number of prepends;  He is not transit to any other provider;  We’ll offer him native IPv6 transit. 103©Copyright md brasil - direitos reservados
  • 104. Filtering for Scenario IV 1) Ingress Filters: The same for discarding default route and own prefix: + Discard receiving via external peers, our customer’s prefixes (if we only want to communicate with him directly): 104©Copyright md brasil - direitos reservados
  • 105. Filtering for Scenario IV 2) Filters to avoid undesired traffic, have to be modified to allow us sending the prefixes from our customer Above filter should be done for each peer (TR1, TR2 and IXP) and placed before discard rule. NB: We need also to notify external peers about the new prefix and we’ll announce. 105©Copyright md brasil - direitos reservados
  • 106. Filtering for Scenario IV Avoiding “garbage” from our Customer Is possible to limit the number of prefixes received from peer. Restart time will work in case of Prefix Limit has reached (BGP session is closed) 106©Copyright md brasil - direitos reservados
  • 107. Accepting only his prefix and only his AS number (but allowing any number of prepends with regexp) Filtering for Scenario IV Avoiding “garbage” from our Customer Discarding all the rest 107©Copyright md brasil - direitos reservados
  • 108. Agenda 1) BGP essentials and basics of BGP filtering; 2) Case Studies: 2.1) Overview 2.2) Single-Homed Provider 2.3) Single-Homed + IXP 2.4) Multi-Homed + IXP 2.5) Multi-Homed + IXP + Providing transit services 108©Copyright md brasil - direitos reservados
  • 109. Final Considerations Filtering techniques presented here are commonly used practices considering natural scenarios evolution for Small/Medium ISPs. The purpose of this work is the orientation on how and where to use the filters with Mikrotik RouterOS and obviously they should be adapted for particular situations. Some slides can have edition mistakes. So, if interested, ask for the export file of the router. 109©Copyright md brasil - direitos reservados
  • 110. Thank you Hvala! Wardner Maia – maia@mdbrasil.com.br 110©Copyright md brasil - direitos reservados
  • 111. Download this presentation Soon, this presentation will be available for download at Mikrotik and MD Brasil Web sites. www.mikrotikbrasil.com.br/artigos 111©Copyright md brasil - direitos reservados