SlideShare a Scribd company logo
1© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP for Internet Service
Providers
Philip SmithPhilip Smith <<pfspfs@@ciscocisco.co.com>m>
AfNOGAfNOG 3,3, LomeLome, Togo, Togo
222© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Presentation Slides
• Will be available on
www.cisco.com/public/cons/seminars/AfNOG3
• Feel free to ask questions any time
333© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP for Internet Service Providers
• BGP Basics (quick recap)
• Scaling BGP
• Deploying BGP in an ISP network
• Multihoming Examples
4© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Basics
What is this BGP thing?What is this BGP thing?
555© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Border Gateway Protocol
• Routing Protocol used to exchange
routing information between networks
exterior gateway protocol
• RFC1771
work in progress to update
draft-ietf-idr-bgp4-17.txt
666© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Autonomous System (AS)
• Collection of networks with same routing policy
• Single routing protocol
• Usually under single ownership, trust and
administrative control
AS 100
777© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Basics
• Runs over TCP – port 179
• Path vector protocol
• Incremental updates
• “Internal” & “External” BGP
AS 100 AS 101
AS 102
EE
BB DD
AA CC
Peering
888© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
AS 100 AS 101
AS 102
DMZ
Network
AA
BB
CC
DD
EE
• Shared network between ASes
Demarcation Zone (DMZ)
999© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP General Operation
• Learns multiple paths via internal
and external BGP speakers
• Picks the best path and installs in
the forwarding table
• Best path is sent to external BGP
neighbours
• Policies applied by influencing the
best path selection
101010© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
External BGP Peering (eBGP)
AS 100 AS 101
CC
AA
• Between BGP speakers in different AS
• Should be directly connected
• Never run an IGP between eBGP peers
BB
111111© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Configuring External BGP
Router A in AS100
interface ethernet 5/0
ip address 222.222.10.2 255.255.255.240
router bgp 100
network 220.220.8.0 mask 255.255.252.0
neighbor 222.222.10.1 remote-as 101
neighbor 222.222.10.1 prefix-list RouterC in
neighbor 222.222.10.1 prefix-list RouterC out
Router C in AS101
interface ethernet 1/0/0
ip address 222.222.10.1 255.255.255.240
router bgp 101
network 220.220.16.0 mask 255.255.240.0
neighbor 222.222.10.2 remote-as 100
neighbor 222.222.10.2 prefix-list RouterA in
neighbor 222.222.10.2 prefix-list RouterA out
121212© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Internal BGP (iBGP)
• BGP peer within the same AS
• Not required to be directly connected
• iBGP speakers need to be fully meshed
they originate connected networks
they do not pass on prefixes learned from
other iBGP speakers
131313© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Internal BGP Peering (iBGP)
• Topology independent
• Each iBGP speaker must peer with
every other iBGP speaker in the AS
AS 100
AA
EE
BB
DD
141414© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Peering to Loop-back Address
AS 100
• Peer with loop-back address
Loop-back interface does not go down – ever!
• iBGP session is not dependent on state of a single
interface
• iBGP session is not dependent on physical topology
151515© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Configuring Internal BGP
Router A
interface loopback 0
ip address 215.10.7.1 255.255.255.255
router bgp 100
network 220.220.1.0
neighbor 215.10.7.2 remote-as 100
neighbor 215.10.7.2 update-source loopback0
neighbor 215.10.7.3 remote-as 100
neighbor 215.10.7.3 update-source loopback0
Router B
interface loopback 0
ip address 215.10.7.2 255.255.255.255
router bgp 100
network 220.220.5.0
neighbor 215.10.7.1 remote-as 100
neighbor 215.10.7.1 update-source loopback0
neighbor 215.10.7.3 remote-as 100
neighbor 215.10.7.3 update-source loopback0
16© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Attributes
Recap
171717© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
• Sequence of ASes a
route has traversed
• Loop detection
• Apply policy
AS-Path
AS 100
AS 300
AS 200
AS 500
AS 400
170.10.0.0/16 180.10.0.0/16
150.10.0.0/16
180.10.0.0/16 300 200 100
170.10.0.0/16 300 200
150.10.0.0/16 300 400
180.10.0.0/16 300 200 100
170.10.0.0/16 300 200
181818© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Next Hop
160.10.0.0/16
150.10.0.0/16
150.10.1.1 150.10.1.2
AS 100
AS 300
AS 200
AA BB
CC
150.10.0.0/16 150.10.1.1
160.10.0.0/16 150.10.1.1
eBGP
iBGP
eBGP – address of external neighbour
iBGP – NEXT_HOP from eBGP
191919© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
iBGP Next Hop
AS 300
BB
CC
220.1.1.0/24 220.1.254.2
220.1.2.0/23 220.1.254.3
iBGP
DD
AA
220.1.1.0/24
220.1.2.0/23
Loopback
220.1.254.2/32
Loopback
220.1.254.3/32
Next hop is ibgp router loopback address
Recursive route look-up
202020© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Third Party Next Hop
192.68.1.0/24
150.1.1.3150.1.1.3
150.1.1.1
150.1.1.2
192.68.1.0/24 150.1.1.3
AS 201
AS 200
CC
AA BB
• eBGP between Router A and
Router C
• eBGP between Router A and
Router B
• 192.68.1/24 prefix has next
hop address of 150.1.1.3 –
this is passed on to Router C
instead of 150.1.1.2
AS 202
212121© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Next Hop (summary)
• IGP should carry route to next hops
• Recursive route look-up
• Unlinks BGP from actual physical
topology
• Allows IGP to make intelligent forwarding
decision
222222© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Origin
• Conveys the origin of the prefix
• “Historical” attribute
• Influences best path selection
• Three values: IGP, EGP, incomplete
IGP – generated by BGP network statement
EGP – generated by EGP
incomplete – redistributed from another routing
protocol
232323© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Aggregator
• Conveys the IP address of the router/BGP
speaker generating the aggregate route
• Useful for debugging purposes
• Does not influence best path selection
242424© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Local Preference
AS 400
AS 200
160.10.0.0/16
AS 100
AS 300
160.10.0.0/16 500
> 160.10.0.0/16 800
500 800 EE
BB
CC
AA
DD
252525© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Local Preference
• Local to an AS – non-transitive
Default local preference is 100
• Used to influence BGP path selection
determines best path for outbound traffic
• Path with highest local preference wins
262626© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Local Preference
• Configuration of Router B:
router bgp 400
neighbor 220.5.1.1 remote-as 300
neighbor 220.5.1.1 route-map local-pref in
!
route-map local-pref permit 10
match ip address prefix-list MATCH
set local-preference 800
!
ip prefix-list MATCH permit 160.10.0.0/16
272727© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multi-Exit Discriminator (MED)
AS 201
AS 200
192.68.1.0/24
CC
AA BB
192.68.1.0/24 1000192.68.1.0/24 2000
282828© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multi-Exit Discriminator
• Inter-AS – non-transitive
• Used to convey the relative preference of entry
points
determines best path for inbound traffic
• Comparable if paths are from same AS
• IGP metric can be conveyed as MED
set metric-type internal in route-map
292929© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multi-Exit Discriminator
• Configuration of Router B:
router bgp 400
neighbor 220.5.1.1 remote-as 200
neighbor 220.5.1.1 route-map set-med out
!
route-map set-med permit 10
match ip address prefix-list MATCH
set metric 1000
!
ip prefix-list MATCH permit 192.68.1.0/24
303030© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Weight – Used to Deploy RPF
• Local to router on which it’s configured
Not really an attribute
• route-map: set weight
• Highest weight wins over all valid paths
• Weight customer eBGP on edge routers to allow RPF to work
correctly
AS4
AS1
Link to use for most traffic from AS1
Backup link, but RPF
still needs to work
AS4, LOCAL_PREF 200
AS4, LOCAL_PREF 100
313131© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Community
• BGP attribute
• Described in RFC1997
• 32 bit integer
Represented as two 16 bit integers
• Used to group destinations
Each destination could be member of multiple
communities
• Community attribute carried across AS’s
• Very useful in applying policies
323232© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
160.10.0.0/16 300:1
Community
AS 200
160.10.0.0/16 300:1
170.10.0.0/16 300:1
170.10.0.0/16 300:1
AS 400
DD
CC
FF
BB
170.10.0.0/16
AS 100
AA
160.10.0.0/16
ISP 1
200.10.0.0/16 300:9
XX
ISP 2
200.10.0.0/16
AS 300
EE
333333© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Well-Known Communities
• no-export
do not advertise to eBGP peers
• no-advertise
do not advertise to any peer
• local-AS
do not advertise outside local AS (only used with
confederations)
343434© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
No-Export Community
170.10.0.0/16
170.10.X.X No-Export
170.10.0.0/16
AS 100 AS 200
170.10.X.X
CC FF
GG
DDAA
BB EE
• AS100 announces aggregate and subprefixes
aim is to improve loadsharing by leaking subprefixes
• Subprefixes marked with no-export community
• Router G in AS200 does not announce prefixes with no-export
community set
35© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Path Selection Algorithm
Why Is This the Best Path?
363636© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Path Selection Algorithm
• Do not consider path if no route to next hop
• Do not consider iBGP path if not
synchronised (Cisco IOS)
• Highest weight (local to router)
• Highest local preference (global within AS)
• Prefer locally originated route
• Shortest AS path
373737© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Path Selection Algorithm
(continued)
• Lowest origin code
IGP < EGP < incomplete
• Lowest Multi-Exit Discriminator (MED)
If bgp deterministic-med, order the paths before
comparing
If bgp always-compare-med, then compare for all
paths
otherwise MED only considered if paths are from
the same AS (default)
383838© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Path Selection Algorithm
(continued)
• Prefer eBGP path over iBGP path
• Path with lowest IGP metric to next-hop
• Lowest router-id (originator-id for reflected
routes)
• Shortest Cluster-List
Client must be aware of Route Reflector
attributes!
• Lowest neighbour IP address
39© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Applying Policy with BGP
Control!
404040© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Applying Policy with BGP
• Applying Policy
Decisions based on AS path, community or the prefix
Rejecting/accepting selected routes
Set attributes to influence path selection
• Tools:
Prefix-list (filter prefixes)
Filter-list (filter ASes)
Route-maps and communities
414141© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Policy Control
Prefix List
• Filter routes based on prefix
• Inbound and Outbound
router bgp 200
neighbor 220.200.1.1 remote-as 210
neighbor 220.200.1.1 prefix-list PEER-IN in
neighbor 220.200.1.1 prefix-list PEER-OUT out
!
ip prefix-list PEER-IN deny 218.10.0.0/16
ip prefix-list PEER-IN permit 0.0.0.0/0 le 32
ip prefix-list PEER-OUT permit 215.7.0.0/16
424242© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Policy Control
Filter List
• Filter routes based on AS path
• Inbound and Outbound
router bgp 100
neighbor 220.200.1.1 remote-as 210
neighbor 220.200.1.1 filter-list 5 out
neighbor 220.200.1.1 filter-list 6 in
!
ip as-path access-list 5 permit ^200$
ip as-path access-list 6 permit ^150$
434343© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Policy Control
Regular Expressions
• Like Unix regular expressions
. Match one character
* Match any number of preceding expression
+ Match at least one of preceding expression
^ Beginning of line
$ End of line
_ Beginning, end, white-space, brace
| Or
() brackets to contain expression
444444© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Policy Control
Regular Expressions
• Simple Examples
.* Match anything
.+ Match at least one character
^$ Match routes local to this AS
_1800$ Originated by 1800
^1800_ Received from 1800
_1800_ Via 1800
_790_1800_ Passing through 1800 then 790
_(1800_)+ Match at least one of 1800 in sequence
_(65350)_ Via 65350 (confederation AS)
454545© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Policy Control
Route Maps
• A route-map is like a “programme” for IOS
• Has “line” numbers, like programmes
• Each line is a separate condition/action
• Concept is basically:
if match then do expression and exit
else
if match then do expression and exit
else etc
464646© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Policy Control
Route Maps
• Example using prefix-lists
router bgp 100
neighbor 1.1.1.1 route-map infilter in
!
route-map infilter permit 10
match ip address prefix-list HIGH-PREF
set local-preference 120
!
route-map infilter permit 20
match ip address prefix-list LOW-PREF
set local-preference 80
!
route-map infilter permit 30
!
ip prefix-list HIGH-PREF permit 10.0.0.0/8
ip prefix-list LOW-PREF permit 20.0.0.0/8
474747© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Policy Control
Route Maps
• Example using filter lists
router bgp 100
neighbor 220.200.1.2 route-map filter-on-as-path in
!
route-map filter-on-as-path permit 10
match as-path 1
set local-preference 80
!
route-map filter-on-as-path permit 20
match as-path 2
set local-preference 200
!
route-map filter-on-as-path permit 30
!
ip as-path access-list 1 permit _150$
ip as-path access-list 2 permit _210_
484848© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Policy Control
Route Maps
• Example configuration of AS-PATH prepend
router bgp 300
network 215.7.0.0
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 route-map SETPATH out
!
route-map SETPATH permit 10
set as-path prepend 300 300
• Use your own AS number when prepending
Otherwise BGP loop detection may cause
disconnects
494949© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Policy Control
Setting Communities
• Example Configuration
router bgp 100
neighbor 220.200.1.1 remote-as 200
neighbor 220.200.1.1 send-community
neighbor 220.200.1.1 route-map set-community out
!
route-map set-community permit 10
match ip address prefix-list NO-ANNOUNCE
set community no-export
!
route-map set-community permit 20
!
ip prefix-list NO-ANNOUNCE permit 172.168.0.0/16 ge 17
505050© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Policy Control
Matching Communities
• Example Configuration
router bgp 100
neighbor 220.200.1.2 remote-as 200
neighbor 220.200.1.2 route-map filter-on-community in
!
route-map filter-on-community permit 10
match community 1
set local-preference 50
!
route-map filter-on-community permit 20
match community 2 exact-match
set local-preference 200
!
ip community-list 1 permit 150:3 200:5
ip community-list 2 permit 88:6
515151© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP for Internet Service Providers
• BGP Basics (quick recap)
• Scaling BGP
• Deploying BGP in an ISP network
• Multihoming Examples
52© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Scaling Techniques
535353© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Scaling Techniques
• How to scale iBGP mesh beyond a few peers?
• How to implement new policy without causing
flaps and route churning?
• How to reduce the overhead on the routers?
• How to keep the network stable, scalable, as well
as simple?
545454© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Scaling Techniques
• Dynamic Reconfiguration
• Peer groups
• Route flap damping
55© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Dynamic Reconfiguration
Soft Reconfiguration and Route Refresh
565656© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Soft Reconfiguration
Problem:
• Hard BGP peer clear required after every
policy change because the router does not
store prefixes that are denied by a filter
• Hard BGP peer clearing consumes CPU
and affects connectivity for all networks
Solution:
• Soft-reconfiguration
575757© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Soft Reconfiguration
BGP in
process
BGP
table
BGP out
process
“BGP in
table”
received
received
and used
accepted
discarded
peer
peer
normal
soft
585858© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Soft Reconfiguration
• New policy is activated without tearing down
and restarting the peering session
• Per-neighbour basis
• Use more memory to keep prefixes whose
attributes have been changed or have not been
accepted
595959© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Configuring Soft Reconfiguration
router bgp 100
neighbor 1.1.1.1 remote-as 101
neighbor 1.1.1.1 route-map infilter in
neighbor 1.1.1.1 soft-reconfiguration inbound
! Outbound does not need to be configured !
Then when we change the policy, we issue an exec command
clear ip bgp 1.1.1.1 soft [in | out]
606060© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Route Refresh Capability
• Facilitates non-disruptive policy changes
• No configuration is needed
• No additional memory is used
• Requires peering routers to support “route
refresh capability” – RFC2918
• clear ip bgp x.x.x.x in tells peer to resend full
BGP announcement
616161© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Soft Reconfiguration
vs. Route Refresh
• Use Route Refresh capability if supported
find out from “show ip bgp neighbor”
uses much less memory
• Otherwise use Soft Reconfiguration
• Only hard-reset a BGP peering as a last resort
62© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Peer Groups
636363© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Peer Groups
Without peer groups
• iBGP neighbours receive same update
• Large iBGP mesh slow to build
• Router CPU wasted on repeat calculations
Solution – peer groups!
• Group peers with same outbound policy
• Updates are generated once per group
646464© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Peer Groups – Advantages
• Makes configuration easier
• Makes configuration less prone to error
• Makes configuration more readable
• Lower router CPU load
• iBGP mesh builds more quickly
• Members can have different inbound policy
• Can be used for eBGP neighbours too!
656565© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Configuring Peer Group
router bgp 100
neighbor ibgp-peer peer-group
neighbor ibgp-peer remote-as 100
neighbor ibgp-peer update-source loopback 0
neighbor ibgp-peer send-community
neighbor ibgp-peer route-map outfilter out
neighbor 1.1.1.1 peer-group ibgp-peer
neighbor 2.2.2.2 peer-group ibgp-peer
neighbor 2.2.2.2 route-map infilter in
neighbor 3.3.3.3 peer-group ibgp-peer
! note how 2.2.2.2 has different inbound filter from peer-group !
666666© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Configuring Peer Group
router bgp 109
neighbor external-peer peer-group
neighbor external-peer send-community
neighbor external-peer route-map set-metric out
neighbor 160.89.1.2 remote-as 200
neighbor 160.89.1.2 peer-group external-peer
neighbor 160.89.1.4 remote-as 300
neighbor 160.89.1.4 peer-group external-peer
neighbor 160.89.1.6 remote-as 400
neighbor 160.89.1.6 peer-group external-peer
neighbor 160.89.1.6 filter-list infilter in
67© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Route Flap Damping
Stabilising the Network
686868© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Route Flap Damping
• Route flap
Going up and down of path or change in attribute
BGP WITHDRAW followed by UPDATE = 1 flap
eBGP neighbour going down/up is NOT a flap
Ripples through the entire Internet
Wastes CPU
• Damping aims to reduce scope of route flap
propagation
696969© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Route Flap Damping (continued)
• Requirements
Fast convergence for normal route changes
History predicts future behaviour
Suppress oscillating routes
Advertise stable routes
• Documented in RFC2439
707070© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Operation
• Add penalty (1000) for each flap
Change in attribute gets penalty of 500
• Exponentially decay penalty
half life determines decay rate
• Penalty above suppress-limit
do not advertise route to BGP peers
• Penalty decayed below reuse-limit
re-advertise route to BGP peers
penalty reset to zero when it is half of reuse-limit
717171© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Operation
Reuse limit
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
0
1000
2000
3000
4000
Time
Penalty
Suppress limit
Network
Announced
Network
Re-announced
Network
Not Announced
727272© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Operation
• Only applied to inbound announcements
from eBGP peers
• Alternate paths still usable
• Controlled by:
Half-life (default 15 minutes)
reuse-limit (default 750)
suppress-limit (default 2000)
maximum suppress time (default 60 minutes)
737373© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Configuration
Fixed damping
router bgp 100
bgp dampening [<half-life> <reuse-value> <suppress-
penalty> <maximum suppress time>]
Selective and variable damping
bgp dampening [route-map <name>]
Variable damping
recommendations for ISPs
http://www.ripe.net/docs/ripe-229.html
747474© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Scaling Techniques
• These 3 techniques should be core
requirements in all ISP networks
Soft reconfiguration/Route Refresh
Peer groups
Route flap damping
757575© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP for Internet Service Providers
• BGP Basics (quick recap)
• Scaling BGP
• Deploying BGP in an ISP network
• Multihoming Examples
76© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Deploying BGP in an ISP
Network
Current Practices
777777© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP versus OSPF/ISIS
• Internal Routing Protocols (IGPs)
examples are ISIS and OSPF
used for carrying infrastructure addresses
NOT used for carrying Internet prefixes or
customer prefixes
design goal is to minimise number of prefixes
in IGP to aid scalability and rapid convergence
787878© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP versus OSPF/ISIS
• BGP used internally (iBGP) and externally
(eBGP)
• iBGP used to carry
some/all Internet prefixes across backbone
customer prefixes
• eBGP used to
exchange prefixes with other ASes
implement routing policy
797979© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP versus OSPF/ISIS
Configuration Example
router bgp 34567
neighbor core-ibgp peer-group
neighbor core-ibgp remote-as 34567
neighbor core-ibgp update-source Loopback0
neighbor core-ibgp send-community
neighbor core-ibgp-partial peer-group
neighbor core-ibgp-partial remote-as 34567
neighbor core-ibgp-partial update-source Loopback0
neighbor core-ibgp-partial send-community
neighbor core-ibgp-partial prefix-list network-ibgp out
neighbor 222.1.9.10 peer-group core-ibgp
neighbor 222.1.9.13 peer-group core-ibgp-partial
neighbor 222.1.9.14 peer-group core-ibgp-partial
808080© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP versus OSPF/ISIS
• DO NOT:
distribute BGP prefixes into an IGP
distribute IGP routes into BGP
use an IGP to carry customer prefixes
• YOUR NETWORK WILL NOT SCALE
81© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Aggregation
Quality or Quantity?
828282© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Aggregation
• ISPs receive address block from Regional
Registry or upstream provider
• Aggregation means announcing the address
block only, not subprefixes
Subprefixes should only be announced in special cases
– see later.
• Aggregate should be generated internally
Not on the network borders!
838383© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Configuring Aggregation
Method One
• ISP has 221.10.0.0/19 address block
• To put into BGP as an aggregate:
router bgp 100
network 221.10.0.0 mask 255.255.224.0
ip route 221.10.0.0 255.255.224.0 null0
• The static route is a “pull up” route
more specific prefixes within this address block ensure
connectivity to ISP’s customers
“longest match lookup”
848484© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Configuring Aggregation
Method Two
• Configuration Example
router bgp 109
network 221.10.0.0 mask 255.255.252.0
aggregate-address 221.10.0.0 255.255.224.0 [summary-only]
• Requires more specific prefix in routing table before
aggregate is announced
• {summary-only} keyword
ensures that only the summary is announced if a more
specific prefix exists in the routing table
• Sets “aggregator” attribute
Useful for debugging
858585© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Announcing Aggregate – Cisco IOS
• Configuration Example
router bgp 100
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.1 remote-as 101
neighbor 222.222.10.1 prefix-list out-filter out
!
ip route 221.10.0.0 255.255.224.0 null0
!
ip prefix-list out-filter permit 221.10.0.0/19
868686© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Announcing an Aggregate
• ISPs who don’t and won’t aggregate are
held in poor regard by community
• Registries’ minimum allocation size is now
a /20
no real reason to see subprefixes of allocated
blocks in the Internet
BUT there are currently >62000 /24s!
878787© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
The Internet Today
• Current Internet Routing Table Statistics
BGP Routing Table Entries 111947
Prefixes after maximum aggregation 73017
Unique prefixes in Internet 53184
Prefixes larger than registry alloc 45107
/24s announced 62487
only 5471 /24s are from 192.0.0.0/8
ASes in use 13045
88© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Receiving Prefixes
898989© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Receiving Prefixes from downstream
peers
• ISPs should only accept prefixes which have
been assigned or allocated to their
downstream peer
• For example
downstream has 220.50.0.0/20 block
should only announce this to peers
peers should only accept this from them
909090© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Receiving Prefixes:
Cisco IOS
• Configuration Example on upstream
router bgp 100
neighbor 222.222.10.1 remote-as 101
neighbor 222.222.10.1 prefix-list customer in
!
ip prefix-list customer permit 220.50.0.0/20
919191© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Receiving Prefixes from upstream
peers
• Not desirable unless really necessary
special circumstances – see later
• Ask upstream to either:
originate a default-route
-or-
announce one prefix you can use as default
929292© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Receiving Prefixes from upstream
peers
• Downstream Router Configuration
router bgp 100
network 221.10.0.0 mask 255.255.224.0
neighbor 221.5.7.1 remote-as 101
neighbor 221.5.7.1 prefix-list infilter in
neighbor 221.5.7.1 prefix-list outfilter out
!
ip prefix-list infilter permit 0.0.0.0/0
!
ip prefix-list outfilter permit 221.10.0.0/19
939393© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Receiving Prefixes from upstream
peers
• Upstream Router Configuration
router bgp 101
neighbor 221.5.7.2 remote-as 100
neighbor 221.5.7.2 default-originate
neighbor 221.5.7.2 prefix-list cust-in in
neighbor 221.5.7.2 prefix-list cust-out out
!
ip prefix-list cust-in permit 221.10.0.0/19
!
ip prefix-list cust-out permit 0.0.0.0/0
949494© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Receiving Prefixes from upstream
peers
• If necessary to receive prefixes from
upstream provider, care is required
don’t accept RFC1918 etc prefixes
http://www.ietf.org/internet-drafts/draft-manning-dsua-07.txt
don’t accept your own prefix
don’t accept default (unless you need it)
don’t accept prefixes longer than /24
This guideline may change “soon”
959595© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Receiving Prefixes
router bgp 100
network 221.10.0.0 mask 255.255.224.0
neighbor 221.5.7.1 remote-as 101
neighbor 221.5.7.1 prefix-list in-filter in
!
ip prefix-list in-filter deny 0.0.0.0/0 ! Block default
ip prefix-list in-filter deny 0.0.0.0/8 le 32
ip prefix-list in-filter deny 10.0.0.0/8 le 32
ip prefix-list in-filter deny 127.0.0.0/8 le 32
ip prefix-list in-filter deny 169.254.0.0/16 le 32
ip prefix-list in-filter deny 172.16.0.0/12 le 32
ip prefix-list in-filter deny 192.0.2.0/24 le 32
ip prefix-list in-filter deny 192.168.0.0/16 le 32
ip prefix-list in-filter deny 221.10.0.0/19 le 32 ! Block local prefix
ip prefix-list in-filter deny 224.0.0.0/3 le 32 ! Block multicast
ip prefix-list in-filter deny 0.0.0.0/0 ge 25 ! Block prefixes >/24
ip prefix-list in-filter permit 0.0.0.0/0 le 32
96© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Prefixes into iBGP
979797© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Injecting prefixes into iBGP
• Use iBGP to carry customer prefixes
don’t ever use IGP
• Point static route to customer interface
• Use BGP network statement
• As long as static route exists (interface
active), prefix will be in BGP
989898© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Router Configuration
network statement
• Example:
interface loopback 0
ip address 215.17.3.1 255.255.255.255
!
interface Serial 5/0
ip unnumbered loopback 0
ip verify unicast reverse-path
!
ip route 215.34.10.0 255.255.252.0 Serial 5/0
!
router bgp 100
network 215.34.10.0 mask 255.255.252.0
999999© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Injecting prefixes into iBGP
• interface flap will result in prefix withdraw
and re-announce
use “ip route…permanent”
Static route always exists, even if interface is down
→ prefix announced in iBGP
• many ISPs use redistribute static rather than
network statement
only use this if you understand why
100100100© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Inserting prefixes into BGP:
redistribute static
• Care required with redistribute!
redistribute <routing-protocol> means everything
in the <routing-protocol> will be transferred into
the current routing protocol
Does not scale if uncontrolled
Best avoided if at all possible
redistribute normally used with “route-maps” and
under tight administrative control
101101101© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Router Configuration:
redistribute static
• Example:
ip route 215.34.10.0 255.255.252.0 Serial 5/0
!
router bgp 100
redistribute static route-map static-to-bgp
<snip>
!
route-map static-to-bgp permit 10
match ip address prefix-list ISP-block
set origin igp
<snip>
!
ip prefix-list ISP-block permit 215.34.10.0/22 le 30
!
102102102© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Injecting prefixes into iBGP
• Route-map ISP-block can be used for many
things:
setting communities and other attributes
setting origin code to IGP, etc
• Be careful with prefix-lists and route-maps
absence of either/both could mean all statically
routed prefixes go into iBGP
103© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Configuration Tips
104104104© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
iBGP and IGPs
• Make sure loopback is configured on router
iBGP between loopbacks, NOT real interfaces
• Make sure IGP carries loopback /32 address
• Make sure IGP carries DMZ nets
Use ip-unnumbered where possible
Or use next-hop-self on iBGP neighbours
neighbor x.x.x.x next-hop-self
105105105© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Next-hop-self
• Used by many ISPs on edge routers
Preferable to carrying DMZ /30 addresses in
the IGP
Reduces size of IGP to just core infrastructure
Alternative to using ip unnumbered
Helps scale network
BGP speaker announces external network
using local address (loopback) as next-hop
106106106© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Template – iBGP peers
iBGP Peer Group
AS100
router bgp 100
neighbor internal peer-group
neighbor internal description ibgp peers
neighbor internal remote-as 100
neighbor internal update-source Loopback0
neighbor internal next-hop-self
neighbor internal send-community
neighbor internal version 4
neighbor internal password 7 03085A09
neighbor 1.0.0.1 peer-group internal
neighbor 1.0.0.2 peer-group internal
107107107© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Template – iBGP peers
• Use peer-groups
• iBGP between loopbacks!
• Next-hop-self
Keep DMZ and point-to-point out of IGP
• Always send communities in iBGP
Otherwise accidents will happen
• Hardwire BGP to version 4
Yes, this is being paranoid!
• Use passwords on iBGP session
Not being paranoid, VERY necessary
108108108© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Template – eBGP peers
Router B:
router bgp 100
bgp dampening route-map RIPE229-flap
network 10.60.0.0 mask 255.255.0.0
neighbor external peer-group
neighbor external remote-as 200
neighbor external description ISP connection
neighbor external remove-private-AS
neighbor external version 4
neighbor external prefix-list ispout out ! “real” filter
neighbor external filter-list 1 out ! “accident” filter
neighbor external route-map ispout out
neighbor external prefix-list ispin in
neighbor external filter-list 2 in
neighbor external route-map ispin in
neighbor external password 7 020A0559
neighbor external maximum-prefix 120000 [warning-only]
neighbor 10.200.0.1 peer-group external
!
ip route 10.60.0.0 255.255.0.0 null0 254
AS 200
AS100
10.0.0.0
A
B
10.60.0.0/16
10.200.0.0
.1
.2
AS 100 is a
customer
of AS 200
109109109© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP Template – eBGP peers
• BGP damping – use RIPE-229 parameters
• Remove private ASes from announcements
Common omission today
• Use extensive filters, with “backup”
Use as-path filters to backup prefix-lists
Use route-maps for policy
• Use password agreed between you and peer on eBGP
session
• Use maximum-prefix tracking
Router will warn you if there are sudden changes in BGP table
size, bringing down eBGP if necessary
110110110© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
More BGP “defaults”
• Log neighbour changes
bgp log-neighbor-changes
• Enable deterministic MED
bgp deterministic-med
Otherwise bestpath could be different every time BGP
session is reset
• Make BGP admin distance higher than any IGP
distance bgp 200 200 200
111111111© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP for Internet Service Providers
• BGP Basics (quick recap)
• Scaling BGP
• Deploying BGP in an ISP network
• Multihoming Examples
112© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multihoming
113113113© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multihoming
Definition
• More than one link external to the local
network
two or more links to the same ISP
two or more links to different ISPs
• Usually two external facing routers
one router gives link and provider redundancy
only
114114114© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
AS Numbers
• An Autonomous System Number is
required by BGP
• Obtained from upstream ISP or Regional
Registry
• Necessary when you have links to more
than one ISP or exchange point
115115115© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Configuring Policy
• Three BASIC Principles
prefix-lists to filter prefixes
filter-lists to filter ASNs
route-maps to apply policy
• Avoids confusion!
116116116© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Originating Prefixes
• Basic Assumptions
MUST announce assigned address block to Internet
MAY also announce subprefixes – reachability is not
guaranteed
RIR minimum allocation is /20
several ISPs filter RIR blocks on this boundary
called “Net Police” by some
117117117© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Part of the “Net Police” prefix list
!! APNIC
ip prefix-list FILTER permit 61.0.0.0/8 ge 9 le 20
ip prefix-list FILTER permit 202.0.0.0/7 ge 9 le 20
ip prefix-list FILTER permit 210.0.0.0/7 ge 9 le 20
ip prefix-list FILTER permit 218.0.0.0/7 ge 9 le 20
ip prefix-list FILTER permit 220.0.0.0/8 ge 9 le 20
!! ARIN
ip prefix-list FILTER permit 24.0.0.0/8 ge 9 le 20
ip prefix-list FILTER permit 63.0.0.0/8 ge 9 le 20
ip prefix-list FILTER permit 64.0.0.0/6 ge 9 le 20
ip prefix-list FILTER permit 68.0.0.0/8 ge 9 le 20
ip prefix-list FILTER permit 199.0.0.0/8 ge 9 le 20
ip prefix-list FILTER permit 200.0.0.0/8 ge 9 le 20
ip prefix-list FILTER permit 204.0.0.0/6 ge 9 le 20
ip prefix-list FILTER permit 208.0.0.0/7 ge 9 le 20
ip prefix-list FILTER permit 216.0.0.0/8 ge 9 le 20
!! RIPE NCC
ip prefix-list FILTER permit 62.0.0.0/8 ge 9 le 20
ip prefix-list FILTER permit 80.0.0.0/7 ge 9 le 20
ip prefix-list FILTER permit 193.0.0.0/8 ge 9 le 20
ip prefix-list FILTER permit 194.0.0.0/7 ge 9 le 20
ip prefix-list FILTER permit 212.0.0.0/7 ge 9 le 20
ip prefix-list FILTER permit 217.0.0.0/8 ge 9 le 20
118118118© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
“Net Police” prefix list issues
• meant to “punish” ISPs who won’t and don’t
aggregate
• impacts legitimate multihoming
• impacts regions where domestic backbone is
unavailable or costs $$$ compared with international
bandwidth
• hard to maintain – requires updating when RIRs start
allocating from new address blocks
• don’t do it unless consequences understood and you
are prepared to keep it current
119© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multihoming Options
120120120© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multihoming Scenarios
• Stub network
• Multi-homed stub network
• Multi-homed network
• Configuration Options
121121121© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Stub Network
• No need for BGP
• Point static default to upstream ISP
• Upstream ISP advertises stub network
• Policy confined within upstream ISP’s policy
AS100
AS101
122122122© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multi-homed Stub Network
• Use BGP (not IGP or static) to loadshare
• Use private AS (ASN > 64511)
• Upstream ISP advertises stub network
• Policy confined within upstream ISP’s policy
AS100
AS65530
123123123© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multi-Homed Network
• Many situations possible
multiple sessions to same ISP
secondary for backup only
load-share between primary and secondary
selectively use different ISPs
AS300 AS200
AS100
Global Internet
124124124© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Private-AS – Application
• Applications
ISP with single-
homed customers
(RFC2270)
corporate network
with several
regions and
connections to the
Internet only in the
core
1880
193.1.34.0/24 65003
193.2.35.0/24
65002
193.0.33.0/24
65001
193.0.32.0/24
A
193.1.32.0/22 1880
B
C
125125125© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Private-AS Removal
• neighbor x.x.x.x remove-private-AS
• Rules:
available for eBGP neighbors only
if the update has AS_PATH made up of private-AS numbers, the
private-AS will be dropped
if the AS_PATH includes private and public AS numbers, private AS
number will not be removed…it is a configuration error!
if AS_PATH contains the AS number of the eBGP neighbor, the
private-AS numbers will not be removed
if used with confederations, it will work as long as the private AS
numbers are after the confederation portion of the AS_PATH
126© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two links to the same ISP
With Redundancy and Loadsharing
127127127© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two links to the same ISP (with
redundancy)
AS 109 AS 65534
AA
CC
• AS109 removes private AS and any customer
subprefixes from Internet announcement
DDEE BB
Link one
Link two
128128128© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Loadsharing to the same ISP
• Announce /19 aggregate on each link
• Split /19 and announce as two /20s, one on each link
basic inbound loadsharing
assumes equal circuit capacity and even spread of traffic across
address block
• Vary the split until “perfect” loadsharing achieved
• Accept the default from upstream
basic outbound loadsharing by nearest exit
okay in first approx as most ISP and end-site traffic is inbound
129129129© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two links to the same ISP
• Router A Configuration
router bgp 65534
network 221.10.0.0 mask 255.255.224.0
network 221.10.0.0 mask 255.255.240.0
neighbor 222.222.10.2 remote-as 109
neighbor 222.222.10.2 prefix-list routerC out
neighbor 222.222.10.2 prefix-list default in
!
ip prefix-list default permit 0.0.0.0/0
ip prefix-list routerC permit 221.10.0.0/20
ip prefix-list routerC permit 221.10.0.0/19
!
ip route 221.10.0.0 255.255.240.0 null0
ip route 221.10.0.0 255.255.224.0 null0
Router B configuration is similar but with the other /20
130130130© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two links to the same ISP
• Router C Configuration
router bgp 109
neighbor 222.222.10.1 remote-as 65534
neighbor 222.222.10.1 default-originate
neighbor 222.222.10.1 prefix-list Customer in
neighbor 222.222.10.1 prefix-list default out
!
ip prefix-list Customer permit 221.10.0.0/19 le 20
ip prefix-list default permit 0.0.0.0/0
• Router C only allows in /19 and /20 prefixes from
customer block
• Router D configuration is identical
131131131© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Loadsharing to the same ISP
• Loadsharing configuration is only on customer
router
• Upstream ISP has to
remove customer subprefixes from external
announcements
remove private AS from external announcements
• Could also use BGP communities
132© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two links to the same ISP
Multiple Dualhomed Customers
(RFC2270)
133133133© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multiple Dualhomed Customers
(RFC2270)
AS 109
AS 65534A1A1
CC
• AS109 removes private AS and
any customer subprefixes from
Internet announcement
DDEE
B1B1
AS 65534A2A2
B2B2
AS 65534A3A3
B3B3
134134134© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multiple Dualhomed Customers
• Customer announcements as per previous
example
• Use the same private AS for each customer
documented in RFC2270
address space is not overlapping
each customer hears default only
• Router An and Bn configuration same as Router
A and B previously
135135135© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two links to the same ISP
• Router A1 Configuration
router bgp 65534
network 221.10.0.0 mask 255.255.224.0
network 221.10.0.0 mask 255.255.240.0
neighbor 222.222.10.2 remote-as 109
neighbor 222.222.10.2 prefix-list routerC out
neighbor 222.222.10.2 prefix-list default in
!
ip prefix-list default permit 0.0.0.0/0
ip prefix-list routerC permit 221.10.0.0/20
ip prefix-list routerC permit 221.10.0.0/19
!
ip route 221.10.0.0 255.255.240.0 null0
ip route 221.10.0.0 255.255.224.0 null0
Router B1 configuration is similar but for the other /20
136136136© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multiple Dualhomed Customers
• Router C Configuration
router bgp 109
neighbor bgp-customers peer-group
neighbor bgp-customers remote-as 65534
neighbor bgp-customers default-originate
neighbor bgp-customers prefix-list default out
neighbor 222.222.10.1 peer-group bgp-customers
neighbor 222.222.10.1 description Customer One
neighbor 222.222.10.1 prefix-list Customer1 in
neighbor 222.222.10.9 peer-group bgp-customers
neighbor 222.222.10.9 description Customer Two
neighbor 222.222.10.9 prefix-list Customer2 in
137137137© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multiple Dualhomed Customers
neighbor 222.222.10.17 peer-group bgp-customers
neighbor 222.222.10.17 description Customer Three
neighbor 222.222.10.17 prefix-list Customer3 in
!
ip prefix-list Customer1 permit 221.10.0.0/19 le 20
ip prefix-list Customer2 permit 221.16.64.0/19 le 20
ip prefix-list Customer3 permit 221.14.192.0/19 le 20
ip prefix-list default permit 0.0.0.0/0
• Router C only allows in /19 and /20 prefixes
from customer block
• Router D configuration is almost identical
138138138© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multiple Dualhomed Customers
• Router E Configuration
assumes customer address space is not part of
upstream’s address block
router bgp 109
neighbor 222.222.10.17 remote-as 110
neighbor 222.222.10.17 remove-private-AS
neighbor 222.222.10.17 prefix-list Customers out
!
ip prefix-list Customers permit 221.10.0.0/19
ip prefix-list Customers permit 221.16.64.0/19
ip prefix-list Customers permit 221.14.192.0/19
• Private AS still visible inside AS109
139139139© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Multiple Dualhomed Customers
• If customers’ prefixes come from
ISP’s address block
do NOT announce them to the Internet
announce ISP aggregate only
• Router E configuration:
router bgp 109
neighbor 222.222.10.17 remote-as 110
neighbor 222.222.10.17 prefix-list my-aggregate out
!
ip prefix-list my-aggregate permit 221.8.0.0/13
140© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two links to different ISPs
With Redundancy
141141141© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two links to different ISPs (with
redundancy)
• Announce /19 aggregate on each link
• Split /19 and announce as two /20s, one on
each link
basic inbound loadsharing
• When one link fails, the announcement of the
/19 aggregate via the other ISP ensures
continued connectivity
142142142© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
AS 109 AS 108
AS 107
CC DD
Two links to different ISPs (with
redundancy)
Announce second
/20 and /19 block
Internet
Announce first
/20 and /19 block
BBAA
143143143© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two links to different ISPs (with
redundancy)
• Router A Configuration
router bgp 107
network 221.10.0.0 mask 255.255.224.0
network 221.10.0.0 mask 255.255.240.0
neighbor 222.222.10.1 remote-as 109
neighbor 222.222.10.1 prefix-list firstblock out
neighbor 222.222.10.1 prefix-list default in
!
ip prefix-list default permit 0.0.0.0/0
!
ip prefix-list firstblock permit 221.10.0.0/20
ip prefix-list firstblock permit 221.10.0.0/19
144144144© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two links to different ISPs (with
redundancy)
• Router B Configuration
router bgp 107
network 221.10.0.0 mask 255.255.224.0
network 221.10.16.0 mask 255.255.240.0
neighbor 220.1.5.1 remote-as 108
neighbor 220.1.5.1 prefix-list secondblock out
neighbor 220.1.5.1 prefix-list default in
!
ip prefix-list default permit 0.0.0.0/0
!
ip prefix-list secondblock permit 221.10.16.0/20
ip prefix-list secondblock permit 221.10.0.0/19
145© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two links to different ISPs
More Controlled Loadsharing
146146146© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Loadsharing with different ISPs
• Announce /19 aggregate on each link
On first link, announce /19 as normal
On second link, announce /19 with longer AS
PATH, and announce one /20 subprefix
controls loadsharing between upstreams and the
Internet
• Vary the subprefix size and AS PATH length
until “perfect” loadsharing achieved
• Still require redundancy!
147147147© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
AS 109 AS 108
AS 107
CC DD
Loadsharing with different ISPs
Announce /20 subprefix, and
/19 block with longer AS path
Internet
Announce /19 block
BBAA
148148148© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Loadsharing with different ISPs
• Router A Configuration
router bgp 107
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.1 remote-as 109
neighbor 222.222.10.1 prefix-list default in
neighbor 222.222.10.1 prefix-list aggregate out
!
ip prefix-list aggregate permit 221.10.0.0/19
149149149© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Loadsharing with different ISPs
• Router B Configuration
router bgp 107
network 221.10.0.0 mask 255.255.224.0
network 221.10.16.0 mask 255.255.240.0
neighbor 220.1.5.1 remote-as 108
neighbor 220.1.5.1 prefix-list default in
neighbor 220.1.5.1 prefix-list subblocks out
neighbor 220.1.5.1 route-map routerD out
!
..next slide..
150150150© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Loadsharing with different ISPs
route-map routerD permit 10
match ip address prefix-list aggregate
set as-path prepend 107 107
route-map routerD permit 20
!
ip prefix-list subblocks permit 221.10.0.0/19 le 20
ip prefix-list aggregate permit 221.10.0.0/19
151© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Service Provider Multihoming
152152152© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Service Provider Multihoming
• Previous examples dealt with loadsharing
inbound traffic
What about outbound?
• ISPs strive to balance traffic flows in both
directions
Balance link utilisation
Try and keep most traffic flows symmetric
153153153© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Service Provider Multihoming
• Balancing outbound traffic requires
inbound routing information
Common solution is “full routing table”
Rarely necessary – the “routing mallet” to try
solve loadsharing problems
Keep It Simple (KISS) is often easier (and $$$
cheaper) than carrying n-copies of the full
routing table
154154154© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Service Provider Multihoming
• Examples
One upstream, one local peer
One upstream, local exchange point
Two upstreams, one local peer
• All examples require BGP and a public ASN
155© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Service Provider Multihoming
One Upstream, One local peerOne Upstream, One local peer
156156156© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, One Local Peer
• Announce /19 aggregate on each link
• Accept default route only from upstream
Either 0.0.0.0/0 or a network which can be used as
default
• Accept all routes from local peer
157157157© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, One Local Peer
AS 109
CC
AA
Upstream ISP
AS107
Local Peer
AS108
158158158© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, One Local Peer
• Router A Configuration
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.2 remote-as 108
neighbor 222.222.10.2 prefix-list my-block out
neighbor 222.222.10.2 prefix-list AS108-peer in
!
ip prefix-list AS108-peer permit 222.5.16.0/19
ip prefix-list AS108-peer permit 221.240.0.0/20
ip prefix-list my-block permit 221.10.0.0/19
!
ip route 221.10.0.0 255.255.224.0 null0
159159159© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, One Local Peer
• Router A – Alternative Configuration
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.2 remote-as 108
neighbor 222.222.10.2 prefix-list my-block out
neighbor 222.222.10.2 filter-list 10 in
!
ip as-path access-list 10 permit ^(108_)+$
!
ip prefix-list my-block permit 221.10.0.0/19
!
ip route 221.10.0.0 255.255.224.0 null0
160160160© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, One Local Peer
• Router C Configuration
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.1 remote-as 107
neighbor 222.222.10.1 prefix-list default in
neighbor 222.222.10.1 prefix-list my-block out
!
ip prefix-list my-block permit 221.10.0.0/19
ip prefix-list default permit 0.0.0.0/0
!
ip route 221.10.0.0 255.255.224.0 null0
161161161© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, One Local Peer
• Two configurations possible for Router A
Filter-lists assume peer knows what they are
doing
Prefix-list higher maintenance, but safer
• Local traffic goes to and from local peer,
everything else goes to upstream
162© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Service Provider Multihoming
One Upstream, Local Exchange PointOne Upstream, Local Exchange Point
163163163© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, Local Exchange Point
• Announce /19 aggregate to every
neighbouring AS
• Accept default route only from upstream
Either 0.0.0.0/0 or a network which can be used as
default
• Accept all routes from IXP peers
164164164© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, Local Exchange Point
AS 109
CC
AA
Upstream ISP
AS107
IXP
165165165© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, Local Exchange Point
• Router A Configuration
interface fastethernet 0/0
description Exchange Point LAN
ip address 220.5.10.1 mask 255.255.255.224
ip verify unicast reverse-path
no ip directed-broadcast
no ip proxy-arp
no ip redirects
!
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor ixp-peers peer-group
neighbor ixp-peers soft-reconfiguration in
neighbor ixp-peers prefix-list my-block out
..next slide
166166166© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, Local Exchange Point
neighbor 220.5.10.2 remote-as 100
neighbor 222.5.10.2 peer-group ixp-peers
neighbor 222.5.10.2 prefix-list peer100 in
neighbor 220.5.10.3 remote-as 101
neighbor 222.5.10.3 peer-group ixp-peers
neighbor 222.5.10.3 prefix-list peer101 in
neighbor 220.5.10.4 remote-as 102
neighbor 222.5.10.4 peer-group ixp-peers
neighbor 222.5.10.4 prefix-list peer102 in
neighbor 220.5.10.5 remote-as 103
neighbor 222.5.10.5 peer-group ixp-peers
neighbor 222.5.10.5 prefix-list peer103 in
..next slide
167167167© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, Local Exchange Point
ip route 221.10.0.0 255.255.224.0 null0
!
ip prefix-list my-block permit 221.10.0.0/19
ip prefix-list peer100 permit 222.0.0.0/19
ip prefix-list peer101 permit 222.30.0.0/19
ip prefix-list peer102 permit 222.12.0.0/19
ip prefix-list peer103 permit 222.18.128.0/19
!
168168168© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, Local Exchange Point
• Router C Configuration
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.1 remote-as 107
neighbor 222.222.10.1 prefix-list default in
neighbor 222.222.10.1 prefix-list my-block out
!
ip prefix-list my-block permit 221.10.0.0/19
ip prefix-list default permit 0.0.0.0/0
!
ip route 221.10.0.0 255.255.224.0 null0
169169169© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
One Upstream, Local Exchange Point
• Note Router A configuration
Prefix-list higher maintenance, but safer
uRPF on the FastEthernet interface
• IXP traffic goes to and from local IXP,
everything else goes to upstream
170© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Service Provider Multihoming
Two Upstreams, One local peerTwo Upstreams, One local peer
171171171© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer
• Announce /19 aggregate on each link
• Accept default route only from upstreams
Either 0.0.0.0/0 or a network which can be used as
default
• Accept all routes from local peer
172172172© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer
AS 109
CC
AA
Upstream ISP
AS106
Local Peer
AS108 DD
Upstream ISP
AS107
173173173© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer
• Router A
Same routing configuration as in example with
one upstream and one local peer
Same hardware configuration
174174174© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer
• Router C Configuration
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.1 remote-as 107
neighbor 222.222.10.1 prefix-list default in
neighbor 222.222.10.1 prefix-list my-block out
!
ip prefix-list my-block permit 221.10.0.0/19
ip prefix-list default permit 0.0.0.0/0
!
ip route 221.10.0.0 255.255.224.0 null0
175175175© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer
• Router D Configuration
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.5 remote-as 106
neighbor 222.222.10.5 prefix-list default in
neighbor 222.222.10.5 prefix-list my-block out
!
ip prefix-list my-block permit 221.10.0.0/19
ip prefix-list default permit 0.0.0.0/0
!
ip route 221.10.0.0 255.255.224.0 null0
176176176© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer
• This is the simple configuration for Router C and
D
• Traffic out to the two upstreams will take nearest
exit
Inexpensive routers required
This is not useful in practice especially for international
links
Loadsharing needs to be better
177177177© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer
• Better configuration options:
Accept full routing from both upstreams
Expensive & unnecessary!
Accept default from one upstream and some
routes from the other upstream
The way to go!
178178178© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Full Routes
• Router C Configuration
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.1 remote-as 107
neighbor 222.222.10.1 prefix-list rfc1918-deny in
neighbor 222.222.10.1 prefix-list my-block out
neighbor 222.222.10.1 route-map AS107-loadshare in
!
ip prefix-list my-block permit 221.10.0.0/19
! See earlier in presentation for RFC1918 list
..next slide
179179179© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Full Routes
ip route 221.10.0.0 255.255.224.0 null0
!
ip as-path access-list 10 permit ^(107_)+$
ip as-path access-list 10 permit ^(107_)+_[0-9]+$
!
route-map AS107-loadshare permit 10
match ip as-path 10
set local-preference 120
route-map AS107-loadshare permit 20
set local-preference 80
!
180180180© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Full Routes
• Router D Configuration
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.5 remote-as 106
neighbor 222.222.10.5 prefix-list rfc1918-deny in
neighbor 222.222.10.5 prefix-list my-block out
!
ip prefix-list my-block permit 221.10.0.0/19
! See earlier in presentation for RFC1918 list
181181181© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Full Routes
• Router C configuration:
Accept full routes from AS107
Tag prefixes originated by AS107 and AS107’s neighbouring
ASes with local preference 120
Traffic to those ASes will go over AS107 link
Remaining prefixes tagged with local preference of 80
Traffic to other all other ASes will go over the link to
AS106
• Router D configuration same as Router C without
the route-map
182182182© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Full Routes
• Full routes from upstreams
Expensive – needs 128Mbytes RAM today
Need to play preference games
Previous example is only an example – real life
will need improved fine-tuning!
Previous example doesn’t consider inbound
traffic – see earlier presentation for examples
183183183© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Partial Routes
• Router C Configuration
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.1 remote-as 107
neighbor 222.222.10.1 prefix-list rfc1918-nodef-deny in
neighbor 222.222.10.1 prefix-list my-block out
neighbor 222.222.10.1 filter-list 10 in
neighbor 222.222.10.1 route-map tag-default-low in
!
ip prefix-list my-block permit 221.10.0.0/19
ip prefix-list default permit 0.0.0.0/0
..next slide
184184184© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Partial Routes
! See earlier presentation for RFC1918 list
!
ip route 221.10.0.0 255.255.224.0 null0
!
ip as-path access-list 10 permit ^(107_)+$
ip as-path access-list 10 permit ^(107_)+_[0-9]+$
!
route-map tag-default-low permit 10
match ip address prefix-list default
set local-preference 80
route-map tag-default-low permit 20
!
185185185© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Partial Routes
• Router D Configuration
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.5 remote-as 106
neighbor 222.222.10.5 prefix-list default in
neighbor 222.222.10.5 prefix-list my-block out
!
ip prefix-list my-block permit 221.10.0.0/19
ip prefix-list default permit 0.0.0.0/0
!
ip route 221.10.0.0 255.255.224.0 null0
186186186© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Partial Routes
• Router C configuration:
Accept full routes from AS107
(or get them to send less)
Filter ASNs so only AS107 and AS107’s neighbouring ASes
are accepted
Allow default, and set it to local preference 80
Traffic to those ASes will go over AS107 link
Traffic to other all other ASes will go over the link to AS106
If AS106 link fails, backup via AS107 – and vice-versa
187187187© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Partial Routes
• Partial routes from upstreams
Not expensive – only carry the routes necessary for
loadsharing
Need to filter on AS paths
Previous example is only an example – real life will
need improved fine-tuning!
Previous example doesn’t consider inbound traffic –
see earlier presentation for examples
188188188© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Partial Routes
• When upstreams cannot or will not
announce default route
Because of operational policy against using
“default-originate” on BGP peering
Solution is to use IGP to propagate default
from the edge/peering routers
189189189© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Partial Routes
• Router C Configuration
router ospf 109
default-information originate metric 30
passive-interface Serial 0/0
!
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.1 remote-as 107
neighbor 222.222.10.1 prefix-list rfc1918-deny in
neighbor 222.222.10.1 prefix-list my-block out
neighbor 222.222.10.1 filter-list 10 in
!
..next slide
190190190© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Partial Routes
ip prefix-list my-block permit 221.10.0.0/19
! See earlier presentation for RFC1918 list
!
ip route 221.10.0.0 255.255.224.0 null0
ip route 0.0.0.0 0.0.0.0 serial 0/0 254
!
ip as-path access-list 10 permit ^(107_)+$
ip as-path access-list 10 permit ^(107_)+_[0-9]+$
!
191191191© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Partial Routes
• Router D Configuration
router ospf 109
default-information originate metric 10
passive-interface Serial 0/0
!
router bgp 109
network 221.10.0.0 mask 255.255.224.0
neighbor 222.222.10.5 remote-as 106
neighbor 222.222.10.5 prefix-list deny-all in
neighbor 222.222.10.5 prefix-list my-block out
!
..next slide
192192192© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Partial Routes
ip prefix-list deny-all deny 0.0.0.0/0 le 32
ip prefix-list my-block permit 221.10.0.0/19
! See earlier presentation for RFC1918 list
!
ip route 221.10.0.0 255.255.224.0 null0
ip route 0.0.0.0 0.0.0.0 serial 0/0 254
!
193193193© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Two Upstreams, One Local Peer:
Partial Routes
• Partial routes from upstreams
Use OSPF to determine outbound path
Router D default has metric 10 – primary outbound path
Router C default has metric 30 – backup outbound path
Serial interface goes down, static default is removed
from routing table, OSPF default withdrawn
194© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Service Provider Multihoming
Case StudyCase Study
195195195© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
Requirements (1)
• ISP needs to multihome:
To AS5400 in Europe
To AS2516 in Japan
/19 allocated by APNIC
AS 17660 assigned by APNIC
1Mbps circuits to both upstreams
196196196© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
Requirements (2)
• ISP wants:
Symmetric routing and equal link utilisation in and out
(as close as possible)
international circuits are expensive
Has two 2600 border routers with 64Mbytes memory
Cannot afford to upgrade memory or hardware on border
routers or internal routers
• “Philip, make it work, please”
197197197© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
AS 17660
AA
Upstream ISP
AS2516
BB
Upstream ISP
AS5400
ISP Core
Allocated /19 from APNIC
Circuit to AS5400 is 1Mbps, circuit to AS2516 is 1Mbps
198198198© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
• Both providers stated that routers with
128Mbytes memory required for AS17660 to
multihome
Wrong!
Full routing table is rarely required or desired
• Solution:
Accept default from one upstream
Accept partial prefixes from the other
199199199© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
Inbound Loadsharing
• First cut: Went to a few US Looking
Glasses
Checked the AS path to AS5400
Checked the AS path to AS2516
AS2516 was one hop “closer”
Sent AS-PATH prepend of one AS on AS2516
peering
200200200© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
Inbound Loadsharing
• Refinement
Did not need any
First cut worked, seeing on average 600kbps inbound
on each circuit
Does vary according to time of day, but this is as
balanced as it can get, given customer profile
J
201201201© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
Outbound Loadsharing
• First cut:
Requested default from AS2516
Requested full routes from AS5400
• Then looked at my Routing Report
Picked the top 5 ASNs and created a filter-list
If 701, 1, 7018, 1239 or 7046 are in AS-PATH, prefixes are
discarded
Allowed prefixes originated by AS5400 and up to two AS hops
away
Resulted in 32000 prefixes being accepted in AS17660
202202202© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
Outbound Loadsharing
• Refinement
32000 prefixes quite a lot, seeing more outbound traffic on
the AS5400 path
Traffic was very asymmetric
out through AS5400, in through AS2516
Added the next 3 ASNs from the Top 20 list
209, 2914 and 3549
Now seeing 14000 prefixes
Traffic is now evenly loadshared outbound
Around 200kbps on average
Mostly symmetric
203203203© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
Configuration Router A
router ospf 100
log-adjacency-changes
passive-interface default
no passive-interface Ethernet0/0
default-information originate metric 20
!
router bgp 17660
no synchronization
no bgp fast-external-fallover
bgp log-neighbor-changes
bgp deterministic-med
...next slide
204204204© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
Configuration Router A
neighbor 166.49.165.13 remote-as 5400
neighbor 166.49.165.13 description eBGP multihop to AS5400
neighbor 166.49.165.13 ebgp-multihop 5
neighbor 166.49.165.13 update-source Loopback0
neighbor 166.49.165.13 prefix-list in-filter in
neighbor 166.49.165.13 prefix-list out-filter out
neighbor 166.49.165.13 filter-list 1 in
neighbor 166.49.165.13 filter-list 3 out
!
prefix-list in-filter deny rfc1918etc in
prefix-list out-filter permit 202.144.128.0/19
!
ip route 0.0.0.0 0.0.0.0 serial 0/0 254
...next slide
205205205© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
Configuration Router A
ip as-path access-list 1 deny _701_
ip as-path access-list 1 deny _1_
ip as-path access-list 1 deny _7018_
ip as-path access-list 1 deny _1239_
ip as-path access-list 1 deny _7046_
ip as-path access-list 1 deny _209_
ip as-path access-list 1 deny _2914_
ip as-path access-list 1 deny _3549_
ip as-path access-list 1 permit _5400$
ip as-path access-list 1 permit _5400_[0-9]+$
ip as-path access-list 1 permit _5400_[0-9]+_[0-9]+$
ip as-path access-list 1 deny .*
ip as-path access-list 3 permit ^$
!
206206206© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
Configuration Router B
router ospf 100
log-adjacency-changes
passive-interface default
no passive-interface Ethernet0/0
default-information originate
!
router bgp 17660
no synchronization
no auto-summary
no bgp fast-external-fallover
...next slide
207207207© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
Configuration Router B
bgp log-neighbor-changes
bgp deterministic-med
neighbor 210.132.92.165 remote-as 2516
neighbor 210.132.92.165 description eBGP peering
neighbor 210.132.92.165 soft-reconfiguration inbound
neighbor 210.132.92.165 prefix-list default-route in
neighbor 210.132.92.165 prefix-list out-filter out
neighbor 210.132.92.165 route-map as2516-out out
neighbor 210.132.92.165 maximum-prefix 100
neighbor 210.132.92.165 filter-list 2 in
neighbor 210.132.92.165 filter-list 3 out
!
...next slide
208208208© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
Configuration Router B
!
prefix-list default-route permit 0.0.0.0/0
prefix-list out-filter permit 202.144.128.0/19
!
ip as-path access-list 2 permit _2516$
ip as-path access-list 2 deny .*
ip as-path access-list 3 permit ^$
!
route-map as2516-out permit 10
set as-path prepend 17660
!
209209209© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Configuration Summary
• Router A
Hears full routing table – throws away most of it
AS5400 BGP options are all or nothing
Static default pointing to serial interface – if link goes
down, OSPF default removed
• Router B
Hears default from AS2516
If default disappears (BGP goes down or link goes
down), OSPF default is removed
210210210© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study
MRTG Graphs
Router B to AS2516
Router A to AS5400
211211211© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
Case Study Summary
• Multihoming is not hard, really!
Needs a bit of thought, a bit of planning
Use this case study as an example strategy
Does not require sophisticated equipment, big
memory, fast CPUs…
212212212© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP for Internet Service Providers
• BGP Basics (quick recap)
• Scaling BGP
• Deploying BGP in an ISP network
• Multihoming Examples
213© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3
BGP for Internet Service
Providers
End of TutorialEnd of Tutorial

More Related Content

PPTX
Cisco Live Milan 2015 - BGP advance
PDF
How BGP Works
PPT
PPT
BGP protocol presentation
PPT
PDF
Cisco ospf
PPT
Cisco Live Milan 2015 - BGP advance
How BGP Works
BGP protocol presentation
Cisco ospf

What's hot (20)

PDF
PDF
VXLAN Design and Deployment.pdf
PPT
PPTX
Bgp protocol
PPT
PDF
Segment Routing Lab
PPTX
Border Gatway Protocol
PDF
MPLS Traffic Engineering
PDF
MPLS L3 VPN Deployment
PPTX
EVPN-Presentation.pptx
PDF
Layer-2 VPN
PDF
Cisco Live! :: Introduction to Segment Routing :: BRKRST-2124 | Las Vegas 2017
PDF
1000 Ccna Questions And Answers
PDF
Cisco Live! :: Cisco ASR 9000 Architecture :: BRKARC-2003 | Las Vegas 2017
PPT
Mpls L3_vpn
PDF
Ccnp workbook network bulls
PDF
Bidirectional Forwarding Detection (BFD)
PDF
Layer 3 redundancy hsrp
PPTX
Introduction to nexux from zero to Hero
VXLAN Design and Deployment.pdf
Bgp protocol
Segment Routing Lab
Border Gatway Protocol
MPLS Traffic Engineering
MPLS L3 VPN Deployment
EVPN-Presentation.pptx
Layer-2 VPN
Cisco Live! :: Introduction to Segment Routing :: BRKRST-2124 | Las Vegas 2017
1000 Ccna Questions And Answers
Cisco Live! :: Cisco ASR 9000 Architecture :: BRKARC-2003 | Las Vegas 2017
Mpls L3_vpn
Ccnp workbook network bulls
Bidirectional Forwarding Detection (BFD)
Layer 3 redundancy hsrp
Introduction to nexux from zero to Hero
Ad

Viewers also liked (20)

PPTX
BGP Traffic Engineering / Routing Optimisation
PPTX
Using BGP To Manage Dual Internet Connections
PPTX
Border Gateway Protocol
PDF
BGP Advance Technique by Steven & James
PPTX
An Overview of Border Gateway Protocol (BGP)
PPT
BGP Overview
DOC
Study Notes BGP Exam
PPTX
Implementing Internet and MPLS BGP
PPT
Bgp Basic Labs
PDF
Bgp multihoming
PPT
Bgp For Presentation
PPTX
bgp protocol
PDF
BGP Traffic Engineering with SDN Controller
PPTX
Routing Information Protocol
PDF
The benefit of BGP for every service provider
PDF
IP Routing Tutorial
PDF
Lecture03 H
PPTX
PDF
Create New Value for You - Huawei Agile Network
PPTX
Web technologies: recap on TCP-IP
BGP Traffic Engineering / Routing Optimisation
Using BGP To Manage Dual Internet Connections
Border Gateway Protocol
BGP Advance Technique by Steven & James
An Overview of Border Gateway Protocol (BGP)
BGP Overview
Study Notes BGP Exam
Implementing Internet and MPLS BGP
Bgp Basic Labs
Bgp multihoming
Bgp For Presentation
bgp protocol
BGP Traffic Engineering with SDN Controller
Routing Information Protocol
The benefit of BGP for every service provider
IP Routing Tutorial
Lecture03 H
Create New Value for You - Huawei Agile Network
Web technologies: recap on TCP-IP
Ad

Similar to Bgp tutorial for ISP (20)

PPT
bgp1 cryptogrphy and network security.ppt
PDF
NANOG50.Talk33.NANOG50-BGP-Techniques.pdf
PDF
Apnic_bgp_training_cisco_ciscosaicoc.pdf
PPT
Bgp training
PPTX
ENCOR_Chapter_11 - ‌BGP implementation.pptx
PDF
Redes Avanzado Sdwan proyecto autoestudio
PDF
Bgpeuro
PDF
Halabi Bgp4 Case Studies Tutorial
PDF
bgp features presentation routing protocle
PDF
SANOG23-BGP-Techniques.pdf
PDF
Bgp Toc
PDF
Bgp attribute-case study
PDF
BGP Techniques for Network Operators
PDF
Bgp
PDF
PDF
PPT
BSCI30S06 border gateway protocol BG ppt
PPT
bgp.ppt
bgp1 cryptogrphy and network security.ppt
NANOG50.Talk33.NANOG50-BGP-Techniques.pdf
Apnic_bgp_training_cisco_ciscosaicoc.pdf
Bgp training
ENCOR_Chapter_11 - ‌BGP implementation.pptx
Redes Avanzado Sdwan proyecto autoestudio
Bgpeuro
Halabi Bgp4 Case Studies Tutorial
bgp features presentation routing protocle
SANOG23-BGP-Techniques.pdf
Bgp Toc
Bgp attribute-case study
BGP Techniques for Network Operators
Bgp
BSCI30S06 border gateway protocol BG ppt
bgp.ppt

More from Wahyu Nasution (15)

PDF
Ft tx presentation to telkom 25092013
PPTX
Alu xgpon solution for pt telkom akses 20130830+
DOCX
VDSL Vectoring TEST PT TELKOM ALCATEL LUCENT
PPT
Gpon omci v2__voice_configuration_introduction_omciv2_v2_pt_telkom
PPTX
Ams operations
PPTX
ALU 7360 5520_gpon_basic_configuration
PPTX
ISAM ALU 7360 5520_ihub_turn_up_procedure
PDF
ALU GPON TRAINING 3
PDF
Alcatel Lucent Gpon Technology Training 2
PDF
ALU GPON TRAINING 1
PDF
Manual guide briker IP PABX
PPT
Ip sec training
PDF
Gateway load balancing protocol
PDF
Cisco hsrp configuration
DOC
Ipsec rbe guide
Ft tx presentation to telkom 25092013
Alu xgpon solution for pt telkom akses 20130830+
VDSL Vectoring TEST PT TELKOM ALCATEL LUCENT
Gpon omci v2__voice_configuration_introduction_omciv2_v2_pt_telkom
Ams operations
ALU 7360 5520_gpon_basic_configuration
ISAM ALU 7360 5520_ihub_turn_up_procedure
ALU GPON TRAINING 3
Alcatel Lucent Gpon Technology Training 2
ALU GPON TRAINING 1
Manual guide briker IP PABX
Ip sec training
Gateway load balancing protocol
Cisco hsrp configuration
Ipsec rbe guide

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Approach and Philosophy of On baking technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
KodekX | Application Modernization Development
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Spectroscopy.pptx food analysis technology
PDF
Empathic Computing: Creating Shared Understanding
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
NewMind AI Weekly Chronicles - August'25 Week I
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
“AI and Expert System Decision Support & Business Intelligence Systems”
Dropbox Q2 2025 Financial Results & Investor Presentation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Understanding_Digital_Forensics_Presentation.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Approach and Philosophy of On baking technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KodekX | Application Modernization Development
The Rise and Fall of 3GPP – Time for a Sabbatical?
Spectroscopy.pptx food analysis technology
Empathic Computing: Creating Shared Understanding
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Programs and apps: productivity, graphics, security and other tools
sap open course for s4hana steps from ECC to s4
Machine learning based COVID-19 study performance prediction
Encapsulation_ Review paper, used for researhc scholars
Review of recent advances in non-invasive hemoglobin estimation
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

Bgp tutorial for ISP

  • 1. 1© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP for Internet Service Providers Philip SmithPhilip Smith <<pfspfs@@ciscocisco.co.com>m> AfNOGAfNOG 3,3, LomeLome, Togo, Togo
  • 2. 222© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Presentation Slides • Will be available on www.cisco.com/public/cons/seminars/AfNOG3 • Feel free to ask questions any time
  • 3. 333© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP for Internet Service Providers • BGP Basics (quick recap) • Scaling BGP • Deploying BGP in an ISP network • Multihoming Examples
  • 4. 4© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Basics What is this BGP thing?What is this BGP thing?
  • 5. 555© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Border Gateway Protocol • Routing Protocol used to exchange routing information between networks exterior gateway protocol • RFC1771 work in progress to update draft-ietf-idr-bgp4-17.txt
  • 6. 666© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Autonomous System (AS) • Collection of networks with same routing policy • Single routing protocol • Usually under single ownership, trust and administrative control AS 100
  • 7. 777© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Basics • Runs over TCP – port 179 • Path vector protocol • Incremental updates • “Internal” & “External” BGP AS 100 AS 101 AS 102 EE BB DD AA CC Peering
  • 8. 888© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 AS 100 AS 101 AS 102 DMZ Network AA BB CC DD EE • Shared network between ASes Demarcation Zone (DMZ)
  • 9. 999© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP General Operation • Learns multiple paths via internal and external BGP speakers • Picks the best path and installs in the forwarding table • Best path is sent to external BGP neighbours • Policies applied by influencing the best path selection
  • 10. 101010© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 External BGP Peering (eBGP) AS 100 AS 101 CC AA • Between BGP speakers in different AS • Should be directly connected • Never run an IGP between eBGP peers BB
  • 11. 111111© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Configuring External BGP Router A in AS100 interface ethernet 5/0 ip address 222.222.10.2 255.255.255.240 router bgp 100 network 220.220.8.0 mask 255.255.252.0 neighbor 222.222.10.1 remote-as 101 neighbor 222.222.10.1 prefix-list RouterC in neighbor 222.222.10.1 prefix-list RouterC out Router C in AS101 interface ethernet 1/0/0 ip address 222.222.10.1 255.255.255.240 router bgp 101 network 220.220.16.0 mask 255.255.240.0 neighbor 222.222.10.2 remote-as 100 neighbor 222.222.10.2 prefix-list RouterA in neighbor 222.222.10.2 prefix-list RouterA out
  • 12. 121212© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Internal BGP (iBGP) • BGP peer within the same AS • Not required to be directly connected • iBGP speakers need to be fully meshed they originate connected networks they do not pass on prefixes learned from other iBGP speakers
  • 13. 131313© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Internal BGP Peering (iBGP) • Topology independent • Each iBGP speaker must peer with every other iBGP speaker in the AS AS 100 AA EE BB DD
  • 14. 141414© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Peering to Loop-back Address AS 100 • Peer with loop-back address Loop-back interface does not go down – ever! • iBGP session is not dependent on state of a single interface • iBGP session is not dependent on physical topology
  • 15. 151515© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Configuring Internal BGP Router A interface loopback 0 ip address 215.10.7.1 255.255.255.255 router bgp 100 network 220.220.1.0 neighbor 215.10.7.2 remote-as 100 neighbor 215.10.7.2 update-source loopback0 neighbor 215.10.7.3 remote-as 100 neighbor 215.10.7.3 update-source loopback0 Router B interface loopback 0 ip address 215.10.7.2 255.255.255.255 router bgp 100 network 220.220.5.0 neighbor 215.10.7.1 remote-as 100 neighbor 215.10.7.1 update-source loopback0 neighbor 215.10.7.3 remote-as 100 neighbor 215.10.7.3 update-source loopback0
  • 16. 16© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Attributes Recap
  • 17. 171717© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 • Sequence of ASes a route has traversed • Loop detection • Apply policy AS-Path AS 100 AS 300 AS 200 AS 500 AS 400 170.10.0.0/16 180.10.0.0/16 150.10.0.0/16 180.10.0.0/16 300 200 100 170.10.0.0/16 300 200 150.10.0.0/16 300 400 180.10.0.0/16 300 200 100 170.10.0.0/16 300 200
  • 18. 181818© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Next Hop 160.10.0.0/16 150.10.0.0/16 150.10.1.1 150.10.1.2 AS 100 AS 300 AS 200 AA BB CC 150.10.0.0/16 150.10.1.1 160.10.0.0/16 150.10.1.1 eBGP iBGP eBGP – address of external neighbour iBGP – NEXT_HOP from eBGP
  • 19. 191919© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 iBGP Next Hop AS 300 BB CC 220.1.1.0/24 220.1.254.2 220.1.2.0/23 220.1.254.3 iBGP DD AA 220.1.1.0/24 220.1.2.0/23 Loopback 220.1.254.2/32 Loopback 220.1.254.3/32 Next hop is ibgp router loopback address Recursive route look-up
  • 20. 202020© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Third Party Next Hop 192.68.1.0/24 150.1.1.3150.1.1.3 150.1.1.1 150.1.1.2 192.68.1.0/24 150.1.1.3 AS 201 AS 200 CC AA BB • eBGP between Router A and Router C • eBGP between Router A and Router B • 192.68.1/24 prefix has next hop address of 150.1.1.3 – this is passed on to Router C instead of 150.1.1.2 AS 202
  • 21. 212121© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Next Hop (summary) • IGP should carry route to next hops • Recursive route look-up • Unlinks BGP from actual physical topology • Allows IGP to make intelligent forwarding decision
  • 22. 222222© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Origin • Conveys the origin of the prefix • “Historical” attribute • Influences best path selection • Three values: IGP, EGP, incomplete IGP – generated by BGP network statement EGP – generated by EGP incomplete – redistributed from another routing protocol
  • 23. 232323© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Aggregator • Conveys the IP address of the router/BGP speaker generating the aggregate route • Useful for debugging purposes • Does not influence best path selection
  • 24. 242424© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Local Preference AS 400 AS 200 160.10.0.0/16 AS 100 AS 300 160.10.0.0/16 500 > 160.10.0.0/16 800 500 800 EE BB CC AA DD
  • 25. 252525© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Local Preference • Local to an AS – non-transitive Default local preference is 100 • Used to influence BGP path selection determines best path for outbound traffic • Path with highest local preference wins
  • 26. 262626© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Local Preference • Configuration of Router B: router bgp 400 neighbor 220.5.1.1 remote-as 300 neighbor 220.5.1.1 route-map local-pref in ! route-map local-pref permit 10 match ip address prefix-list MATCH set local-preference 800 ! ip prefix-list MATCH permit 160.10.0.0/16
  • 27. 272727© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multi-Exit Discriminator (MED) AS 201 AS 200 192.68.1.0/24 CC AA BB 192.68.1.0/24 1000192.68.1.0/24 2000
  • 28. 282828© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multi-Exit Discriminator • Inter-AS – non-transitive • Used to convey the relative preference of entry points determines best path for inbound traffic • Comparable if paths are from same AS • IGP metric can be conveyed as MED set metric-type internal in route-map
  • 29. 292929© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multi-Exit Discriminator • Configuration of Router B: router bgp 400 neighbor 220.5.1.1 remote-as 200 neighbor 220.5.1.1 route-map set-med out ! route-map set-med permit 10 match ip address prefix-list MATCH set metric 1000 ! ip prefix-list MATCH permit 192.68.1.0/24
  • 30. 303030© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Weight – Used to Deploy RPF • Local to router on which it’s configured Not really an attribute • route-map: set weight • Highest weight wins over all valid paths • Weight customer eBGP on edge routers to allow RPF to work correctly AS4 AS1 Link to use for most traffic from AS1 Backup link, but RPF still needs to work AS4, LOCAL_PREF 200 AS4, LOCAL_PREF 100
  • 31. 313131© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Community • BGP attribute • Described in RFC1997 • 32 bit integer Represented as two 16 bit integers • Used to group destinations Each destination could be member of multiple communities • Community attribute carried across AS’s • Very useful in applying policies
  • 32. 323232© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 160.10.0.0/16 300:1 Community AS 200 160.10.0.0/16 300:1 170.10.0.0/16 300:1 170.10.0.0/16 300:1 AS 400 DD CC FF BB 170.10.0.0/16 AS 100 AA 160.10.0.0/16 ISP 1 200.10.0.0/16 300:9 XX ISP 2 200.10.0.0/16 AS 300 EE
  • 33. 333333© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Well-Known Communities • no-export do not advertise to eBGP peers • no-advertise do not advertise to any peer • local-AS do not advertise outside local AS (only used with confederations)
  • 34. 343434© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 No-Export Community 170.10.0.0/16 170.10.X.X No-Export 170.10.0.0/16 AS 100 AS 200 170.10.X.X CC FF GG DDAA BB EE • AS100 announces aggregate and subprefixes aim is to improve loadsharing by leaking subprefixes • Subprefixes marked with no-export community • Router G in AS200 does not announce prefixes with no-export community set
  • 35. 35© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Path Selection Algorithm Why Is This the Best Path?
  • 36. 363636© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Path Selection Algorithm • Do not consider path if no route to next hop • Do not consider iBGP path if not synchronised (Cisco IOS) • Highest weight (local to router) • Highest local preference (global within AS) • Prefer locally originated route • Shortest AS path
  • 37. 373737© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Path Selection Algorithm (continued) • Lowest origin code IGP < EGP < incomplete • Lowest Multi-Exit Discriminator (MED) If bgp deterministic-med, order the paths before comparing If bgp always-compare-med, then compare for all paths otherwise MED only considered if paths are from the same AS (default)
  • 38. 383838© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Path Selection Algorithm (continued) • Prefer eBGP path over iBGP path • Path with lowest IGP metric to next-hop • Lowest router-id (originator-id for reflected routes) • Shortest Cluster-List Client must be aware of Route Reflector attributes! • Lowest neighbour IP address
  • 39. 39© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Applying Policy with BGP Control!
  • 40. 404040© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Applying Policy with BGP • Applying Policy Decisions based on AS path, community or the prefix Rejecting/accepting selected routes Set attributes to influence path selection • Tools: Prefix-list (filter prefixes) Filter-list (filter ASes) Route-maps and communities
  • 41. 414141© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Policy Control Prefix List • Filter routes based on prefix • Inbound and Outbound router bgp 200 neighbor 220.200.1.1 remote-as 210 neighbor 220.200.1.1 prefix-list PEER-IN in neighbor 220.200.1.1 prefix-list PEER-OUT out ! ip prefix-list PEER-IN deny 218.10.0.0/16 ip prefix-list PEER-IN permit 0.0.0.0/0 le 32 ip prefix-list PEER-OUT permit 215.7.0.0/16
  • 42. 424242© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Policy Control Filter List • Filter routes based on AS path • Inbound and Outbound router bgp 100 neighbor 220.200.1.1 remote-as 210 neighbor 220.200.1.1 filter-list 5 out neighbor 220.200.1.1 filter-list 6 in ! ip as-path access-list 5 permit ^200$ ip as-path access-list 6 permit ^150$
  • 43. 434343© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Policy Control Regular Expressions • Like Unix regular expressions . Match one character * Match any number of preceding expression + Match at least one of preceding expression ^ Beginning of line $ End of line _ Beginning, end, white-space, brace | Or () brackets to contain expression
  • 44. 444444© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Policy Control Regular Expressions • Simple Examples .* Match anything .+ Match at least one character ^$ Match routes local to this AS _1800$ Originated by 1800 ^1800_ Received from 1800 _1800_ Via 1800 _790_1800_ Passing through 1800 then 790 _(1800_)+ Match at least one of 1800 in sequence _(65350)_ Via 65350 (confederation AS)
  • 45. 454545© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Policy Control Route Maps • A route-map is like a “programme” for IOS • Has “line” numbers, like programmes • Each line is a separate condition/action • Concept is basically: if match then do expression and exit else if match then do expression and exit else etc
  • 46. 464646© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Policy Control Route Maps • Example using prefix-lists router bgp 100 neighbor 1.1.1.1 route-map infilter in ! route-map infilter permit 10 match ip address prefix-list HIGH-PREF set local-preference 120 ! route-map infilter permit 20 match ip address prefix-list LOW-PREF set local-preference 80 ! route-map infilter permit 30 ! ip prefix-list HIGH-PREF permit 10.0.0.0/8 ip prefix-list LOW-PREF permit 20.0.0.0/8
  • 47. 474747© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Policy Control Route Maps • Example using filter lists router bgp 100 neighbor 220.200.1.2 route-map filter-on-as-path in ! route-map filter-on-as-path permit 10 match as-path 1 set local-preference 80 ! route-map filter-on-as-path permit 20 match as-path 2 set local-preference 200 ! route-map filter-on-as-path permit 30 ! ip as-path access-list 1 permit _150$ ip as-path access-list 2 permit _210_
  • 48. 484848© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Policy Control Route Maps • Example configuration of AS-PATH prepend router bgp 300 network 215.7.0.0 neighbor 2.2.2.2 remote-as 100 neighbor 2.2.2.2 route-map SETPATH out ! route-map SETPATH permit 10 set as-path prepend 300 300 • Use your own AS number when prepending Otherwise BGP loop detection may cause disconnects
  • 49. 494949© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Policy Control Setting Communities • Example Configuration router bgp 100 neighbor 220.200.1.1 remote-as 200 neighbor 220.200.1.1 send-community neighbor 220.200.1.1 route-map set-community out ! route-map set-community permit 10 match ip address prefix-list NO-ANNOUNCE set community no-export ! route-map set-community permit 20 ! ip prefix-list NO-ANNOUNCE permit 172.168.0.0/16 ge 17
  • 50. 505050© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Policy Control Matching Communities • Example Configuration router bgp 100 neighbor 220.200.1.2 remote-as 200 neighbor 220.200.1.2 route-map filter-on-community in ! route-map filter-on-community permit 10 match community 1 set local-preference 50 ! route-map filter-on-community permit 20 match community 2 exact-match set local-preference 200 ! ip community-list 1 permit 150:3 200:5 ip community-list 2 permit 88:6
  • 51. 515151© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP for Internet Service Providers • BGP Basics (quick recap) • Scaling BGP • Deploying BGP in an ISP network • Multihoming Examples
  • 52. 52© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Scaling Techniques
  • 53. 535353© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Scaling Techniques • How to scale iBGP mesh beyond a few peers? • How to implement new policy without causing flaps and route churning? • How to reduce the overhead on the routers? • How to keep the network stable, scalable, as well as simple?
  • 54. 545454© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Scaling Techniques • Dynamic Reconfiguration • Peer groups • Route flap damping
  • 55. 55© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Dynamic Reconfiguration Soft Reconfiguration and Route Refresh
  • 56. 565656© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Soft Reconfiguration Problem: • Hard BGP peer clear required after every policy change because the router does not store prefixes that are denied by a filter • Hard BGP peer clearing consumes CPU and affects connectivity for all networks Solution: • Soft-reconfiguration
  • 57. 575757© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Soft Reconfiguration BGP in process BGP table BGP out process “BGP in table” received received and used accepted discarded peer peer normal soft
  • 58. 585858© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Soft Reconfiguration • New policy is activated without tearing down and restarting the peering session • Per-neighbour basis • Use more memory to keep prefixes whose attributes have been changed or have not been accepted
  • 59. 595959© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Configuring Soft Reconfiguration router bgp 100 neighbor 1.1.1.1 remote-as 101 neighbor 1.1.1.1 route-map infilter in neighbor 1.1.1.1 soft-reconfiguration inbound ! Outbound does not need to be configured ! Then when we change the policy, we issue an exec command clear ip bgp 1.1.1.1 soft [in | out]
  • 60. 606060© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Route Refresh Capability • Facilitates non-disruptive policy changes • No configuration is needed • No additional memory is used • Requires peering routers to support “route refresh capability” – RFC2918 • clear ip bgp x.x.x.x in tells peer to resend full BGP announcement
  • 61. 616161© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Soft Reconfiguration vs. Route Refresh • Use Route Refresh capability if supported find out from “show ip bgp neighbor” uses much less memory • Otherwise use Soft Reconfiguration • Only hard-reset a BGP peering as a last resort
  • 62. 62© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Peer Groups
  • 63. 636363© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Peer Groups Without peer groups • iBGP neighbours receive same update • Large iBGP mesh slow to build • Router CPU wasted on repeat calculations Solution – peer groups! • Group peers with same outbound policy • Updates are generated once per group
  • 64. 646464© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Peer Groups – Advantages • Makes configuration easier • Makes configuration less prone to error • Makes configuration more readable • Lower router CPU load • iBGP mesh builds more quickly • Members can have different inbound policy • Can be used for eBGP neighbours too!
  • 65. 656565© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Configuring Peer Group router bgp 100 neighbor ibgp-peer peer-group neighbor ibgp-peer remote-as 100 neighbor ibgp-peer update-source loopback 0 neighbor ibgp-peer send-community neighbor ibgp-peer route-map outfilter out neighbor 1.1.1.1 peer-group ibgp-peer neighbor 2.2.2.2 peer-group ibgp-peer neighbor 2.2.2.2 route-map infilter in neighbor 3.3.3.3 peer-group ibgp-peer ! note how 2.2.2.2 has different inbound filter from peer-group !
  • 66. 666666© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Configuring Peer Group router bgp 109 neighbor external-peer peer-group neighbor external-peer send-community neighbor external-peer route-map set-metric out neighbor 160.89.1.2 remote-as 200 neighbor 160.89.1.2 peer-group external-peer neighbor 160.89.1.4 remote-as 300 neighbor 160.89.1.4 peer-group external-peer neighbor 160.89.1.6 remote-as 400 neighbor 160.89.1.6 peer-group external-peer neighbor 160.89.1.6 filter-list infilter in
  • 67. 67© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Route Flap Damping Stabilising the Network
  • 68. 686868© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Route Flap Damping • Route flap Going up and down of path or change in attribute BGP WITHDRAW followed by UPDATE = 1 flap eBGP neighbour going down/up is NOT a flap Ripples through the entire Internet Wastes CPU • Damping aims to reduce scope of route flap propagation
  • 69. 696969© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Route Flap Damping (continued) • Requirements Fast convergence for normal route changes History predicts future behaviour Suppress oscillating routes Advertise stable routes • Documented in RFC2439
  • 70. 707070© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Operation • Add penalty (1000) for each flap Change in attribute gets penalty of 500 • Exponentially decay penalty half life determines decay rate • Penalty above suppress-limit do not advertise route to BGP peers • Penalty decayed below reuse-limit re-advertise route to BGP peers penalty reset to zero when it is half of reuse-limit
  • 71. 717171© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Operation Reuse limit 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 0 1000 2000 3000 4000 Time Penalty Suppress limit Network Announced Network Re-announced Network Not Announced
  • 72. 727272© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Operation • Only applied to inbound announcements from eBGP peers • Alternate paths still usable • Controlled by: Half-life (default 15 minutes) reuse-limit (default 750) suppress-limit (default 2000) maximum suppress time (default 60 minutes)
  • 73. 737373© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Configuration Fixed damping router bgp 100 bgp dampening [<half-life> <reuse-value> <suppress- penalty> <maximum suppress time>] Selective and variable damping bgp dampening [route-map <name>] Variable damping recommendations for ISPs http://www.ripe.net/docs/ripe-229.html
  • 74. 747474© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Scaling Techniques • These 3 techniques should be core requirements in all ISP networks Soft reconfiguration/Route Refresh Peer groups Route flap damping
  • 75. 757575© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP for Internet Service Providers • BGP Basics (quick recap) • Scaling BGP • Deploying BGP in an ISP network • Multihoming Examples
  • 76. 76© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Deploying BGP in an ISP Network Current Practices
  • 77. 777777© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP versus OSPF/ISIS • Internal Routing Protocols (IGPs) examples are ISIS and OSPF used for carrying infrastructure addresses NOT used for carrying Internet prefixes or customer prefixes design goal is to minimise number of prefixes in IGP to aid scalability and rapid convergence
  • 78. 787878© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP versus OSPF/ISIS • BGP used internally (iBGP) and externally (eBGP) • iBGP used to carry some/all Internet prefixes across backbone customer prefixes • eBGP used to exchange prefixes with other ASes implement routing policy
  • 79. 797979© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP versus OSPF/ISIS Configuration Example router bgp 34567 neighbor core-ibgp peer-group neighbor core-ibgp remote-as 34567 neighbor core-ibgp update-source Loopback0 neighbor core-ibgp send-community neighbor core-ibgp-partial peer-group neighbor core-ibgp-partial remote-as 34567 neighbor core-ibgp-partial update-source Loopback0 neighbor core-ibgp-partial send-community neighbor core-ibgp-partial prefix-list network-ibgp out neighbor 222.1.9.10 peer-group core-ibgp neighbor 222.1.9.13 peer-group core-ibgp-partial neighbor 222.1.9.14 peer-group core-ibgp-partial
  • 80. 808080© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP versus OSPF/ISIS • DO NOT: distribute BGP prefixes into an IGP distribute IGP routes into BGP use an IGP to carry customer prefixes • YOUR NETWORK WILL NOT SCALE
  • 81. 81© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Aggregation Quality or Quantity?
  • 82. 828282© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Aggregation • ISPs receive address block from Regional Registry or upstream provider • Aggregation means announcing the address block only, not subprefixes Subprefixes should only be announced in special cases – see later. • Aggregate should be generated internally Not on the network borders!
  • 83. 838383© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Configuring Aggregation Method One • ISP has 221.10.0.0/19 address block • To put into BGP as an aggregate: router bgp 100 network 221.10.0.0 mask 255.255.224.0 ip route 221.10.0.0 255.255.224.0 null0 • The static route is a “pull up” route more specific prefixes within this address block ensure connectivity to ISP’s customers “longest match lookup”
  • 84. 848484© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Configuring Aggregation Method Two • Configuration Example router bgp 109 network 221.10.0.0 mask 255.255.252.0 aggregate-address 221.10.0.0 255.255.224.0 [summary-only] • Requires more specific prefix in routing table before aggregate is announced • {summary-only} keyword ensures that only the summary is announced if a more specific prefix exists in the routing table • Sets “aggregator” attribute Useful for debugging
  • 85. 858585© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Announcing Aggregate – Cisco IOS • Configuration Example router bgp 100 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.1 remote-as 101 neighbor 222.222.10.1 prefix-list out-filter out ! ip route 221.10.0.0 255.255.224.0 null0 ! ip prefix-list out-filter permit 221.10.0.0/19
  • 86. 868686© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Announcing an Aggregate • ISPs who don’t and won’t aggregate are held in poor regard by community • Registries’ minimum allocation size is now a /20 no real reason to see subprefixes of allocated blocks in the Internet BUT there are currently >62000 /24s!
  • 87. 878787© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 The Internet Today • Current Internet Routing Table Statistics BGP Routing Table Entries 111947 Prefixes after maximum aggregation 73017 Unique prefixes in Internet 53184 Prefixes larger than registry alloc 45107 /24s announced 62487 only 5471 /24s are from 192.0.0.0/8 ASes in use 13045
  • 88. 88© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Receiving Prefixes
  • 89. 898989© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Receiving Prefixes from downstream peers • ISPs should only accept prefixes which have been assigned or allocated to their downstream peer • For example downstream has 220.50.0.0/20 block should only announce this to peers peers should only accept this from them
  • 90. 909090© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Receiving Prefixes: Cisco IOS • Configuration Example on upstream router bgp 100 neighbor 222.222.10.1 remote-as 101 neighbor 222.222.10.1 prefix-list customer in ! ip prefix-list customer permit 220.50.0.0/20
  • 91. 919191© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Receiving Prefixes from upstream peers • Not desirable unless really necessary special circumstances – see later • Ask upstream to either: originate a default-route -or- announce one prefix you can use as default
  • 92. 929292© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Receiving Prefixes from upstream peers • Downstream Router Configuration router bgp 100 network 221.10.0.0 mask 255.255.224.0 neighbor 221.5.7.1 remote-as 101 neighbor 221.5.7.1 prefix-list infilter in neighbor 221.5.7.1 prefix-list outfilter out ! ip prefix-list infilter permit 0.0.0.0/0 ! ip prefix-list outfilter permit 221.10.0.0/19
  • 93. 939393© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Receiving Prefixes from upstream peers • Upstream Router Configuration router bgp 101 neighbor 221.5.7.2 remote-as 100 neighbor 221.5.7.2 default-originate neighbor 221.5.7.2 prefix-list cust-in in neighbor 221.5.7.2 prefix-list cust-out out ! ip prefix-list cust-in permit 221.10.0.0/19 ! ip prefix-list cust-out permit 0.0.0.0/0
  • 94. 949494© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Receiving Prefixes from upstream peers • If necessary to receive prefixes from upstream provider, care is required don’t accept RFC1918 etc prefixes http://www.ietf.org/internet-drafts/draft-manning-dsua-07.txt don’t accept your own prefix don’t accept default (unless you need it) don’t accept prefixes longer than /24 This guideline may change “soon”
  • 95. 959595© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Receiving Prefixes router bgp 100 network 221.10.0.0 mask 255.255.224.0 neighbor 221.5.7.1 remote-as 101 neighbor 221.5.7.1 prefix-list in-filter in ! ip prefix-list in-filter deny 0.0.0.0/0 ! Block default ip prefix-list in-filter deny 0.0.0.0/8 le 32 ip prefix-list in-filter deny 10.0.0.0/8 le 32 ip prefix-list in-filter deny 127.0.0.0/8 le 32 ip prefix-list in-filter deny 169.254.0.0/16 le 32 ip prefix-list in-filter deny 172.16.0.0/12 le 32 ip prefix-list in-filter deny 192.0.2.0/24 le 32 ip prefix-list in-filter deny 192.168.0.0/16 le 32 ip prefix-list in-filter deny 221.10.0.0/19 le 32 ! Block local prefix ip prefix-list in-filter deny 224.0.0.0/3 le 32 ! Block multicast ip prefix-list in-filter deny 0.0.0.0/0 ge 25 ! Block prefixes >/24 ip prefix-list in-filter permit 0.0.0.0/0 le 32
  • 96. 96© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Prefixes into iBGP
  • 97. 979797© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Injecting prefixes into iBGP • Use iBGP to carry customer prefixes don’t ever use IGP • Point static route to customer interface • Use BGP network statement • As long as static route exists (interface active), prefix will be in BGP
  • 98. 989898© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Router Configuration network statement • Example: interface loopback 0 ip address 215.17.3.1 255.255.255.255 ! interface Serial 5/0 ip unnumbered loopback 0 ip verify unicast reverse-path ! ip route 215.34.10.0 255.255.252.0 Serial 5/0 ! router bgp 100 network 215.34.10.0 mask 255.255.252.0
  • 99. 999999© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Injecting prefixes into iBGP • interface flap will result in prefix withdraw and re-announce use “ip route…permanent” Static route always exists, even if interface is down → prefix announced in iBGP • many ISPs use redistribute static rather than network statement only use this if you understand why
  • 100. 100100100© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Inserting prefixes into BGP: redistribute static • Care required with redistribute! redistribute <routing-protocol> means everything in the <routing-protocol> will be transferred into the current routing protocol Does not scale if uncontrolled Best avoided if at all possible redistribute normally used with “route-maps” and under tight administrative control
  • 101. 101101101© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Router Configuration: redistribute static • Example: ip route 215.34.10.0 255.255.252.0 Serial 5/0 ! router bgp 100 redistribute static route-map static-to-bgp <snip> ! route-map static-to-bgp permit 10 match ip address prefix-list ISP-block set origin igp <snip> ! ip prefix-list ISP-block permit 215.34.10.0/22 le 30 !
  • 102. 102102102© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Injecting prefixes into iBGP • Route-map ISP-block can be used for many things: setting communities and other attributes setting origin code to IGP, etc • Be careful with prefix-lists and route-maps absence of either/both could mean all statically routed prefixes go into iBGP
  • 103. 103© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Configuration Tips
  • 104. 104104104© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 iBGP and IGPs • Make sure loopback is configured on router iBGP between loopbacks, NOT real interfaces • Make sure IGP carries loopback /32 address • Make sure IGP carries DMZ nets Use ip-unnumbered where possible Or use next-hop-self on iBGP neighbours neighbor x.x.x.x next-hop-self
  • 105. 105105105© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Next-hop-self • Used by many ISPs on edge routers Preferable to carrying DMZ /30 addresses in the IGP Reduces size of IGP to just core infrastructure Alternative to using ip unnumbered Helps scale network BGP speaker announces external network using local address (loopback) as next-hop
  • 106. 106106106© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Template – iBGP peers iBGP Peer Group AS100 router bgp 100 neighbor internal peer-group neighbor internal description ibgp peers neighbor internal remote-as 100 neighbor internal update-source Loopback0 neighbor internal next-hop-self neighbor internal send-community neighbor internal version 4 neighbor internal password 7 03085A09 neighbor 1.0.0.1 peer-group internal neighbor 1.0.0.2 peer-group internal
  • 107. 107107107© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Template – iBGP peers • Use peer-groups • iBGP between loopbacks! • Next-hop-self Keep DMZ and point-to-point out of IGP • Always send communities in iBGP Otherwise accidents will happen • Hardwire BGP to version 4 Yes, this is being paranoid! • Use passwords on iBGP session Not being paranoid, VERY necessary
  • 108. 108108108© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Template – eBGP peers Router B: router bgp 100 bgp dampening route-map RIPE229-flap network 10.60.0.0 mask 255.255.0.0 neighbor external peer-group neighbor external remote-as 200 neighbor external description ISP connection neighbor external remove-private-AS neighbor external version 4 neighbor external prefix-list ispout out ! “real” filter neighbor external filter-list 1 out ! “accident” filter neighbor external route-map ispout out neighbor external prefix-list ispin in neighbor external filter-list 2 in neighbor external route-map ispin in neighbor external password 7 020A0559 neighbor external maximum-prefix 120000 [warning-only] neighbor 10.200.0.1 peer-group external ! ip route 10.60.0.0 255.255.0.0 null0 254 AS 200 AS100 10.0.0.0 A B 10.60.0.0/16 10.200.0.0 .1 .2 AS 100 is a customer of AS 200
  • 109. 109109109© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP Template – eBGP peers • BGP damping – use RIPE-229 parameters • Remove private ASes from announcements Common omission today • Use extensive filters, with “backup” Use as-path filters to backup prefix-lists Use route-maps for policy • Use password agreed between you and peer on eBGP session • Use maximum-prefix tracking Router will warn you if there are sudden changes in BGP table size, bringing down eBGP if necessary
  • 110. 110110110© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 More BGP “defaults” • Log neighbour changes bgp log-neighbor-changes • Enable deterministic MED bgp deterministic-med Otherwise bestpath could be different every time BGP session is reset • Make BGP admin distance higher than any IGP distance bgp 200 200 200
  • 111. 111111111© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP for Internet Service Providers • BGP Basics (quick recap) • Scaling BGP • Deploying BGP in an ISP network • Multihoming Examples
  • 112. 112© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multihoming
  • 113. 113113113© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multihoming Definition • More than one link external to the local network two or more links to the same ISP two or more links to different ISPs • Usually two external facing routers one router gives link and provider redundancy only
  • 114. 114114114© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 AS Numbers • An Autonomous System Number is required by BGP • Obtained from upstream ISP or Regional Registry • Necessary when you have links to more than one ISP or exchange point
  • 115. 115115115© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Configuring Policy • Three BASIC Principles prefix-lists to filter prefixes filter-lists to filter ASNs route-maps to apply policy • Avoids confusion!
  • 116. 116116116© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Originating Prefixes • Basic Assumptions MUST announce assigned address block to Internet MAY also announce subprefixes – reachability is not guaranteed RIR minimum allocation is /20 several ISPs filter RIR blocks on this boundary called “Net Police” by some
  • 117. 117117117© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Part of the “Net Police” prefix list !! APNIC ip prefix-list FILTER permit 61.0.0.0/8 ge 9 le 20 ip prefix-list FILTER permit 202.0.0.0/7 ge 9 le 20 ip prefix-list FILTER permit 210.0.0.0/7 ge 9 le 20 ip prefix-list FILTER permit 218.0.0.0/7 ge 9 le 20 ip prefix-list FILTER permit 220.0.0.0/8 ge 9 le 20 !! ARIN ip prefix-list FILTER permit 24.0.0.0/8 ge 9 le 20 ip prefix-list FILTER permit 63.0.0.0/8 ge 9 le 20 ip prefix-list FILTER permit 64.0.0.0/6 ge 9 le 20 ip prefix-list FILTER permit 68.0.0.0/8 ge 9 le 20 ip prefix-list FILTER permit 199.0.0.0/8 ge 9 le 20 ip prefix-list FILTER permit 200.0.0.0/8 ge 9 le 20 ip prefix-list FILTER permit 204.0.0.0/6 ge 9 le 20 ip prefix-list FILTER permit 208.0.0.0/7 ge 9 le 20 ip prefix-list FILTER permit 216.0.0.0/8 ge 9 le 20 !! RIPE NCC ip prefix-list FILTER permit 62.0.0.0/8 ge 9 le 20 ip prefix-list FILTER permit 80.0.0.0/7 ge 9 le 20 ip prefix-list FILTER permit 193.0.0.0/8 ge 9 le 20 ip prefix-list FILTER permit 194.0.0.0/7 ge 9 le 20 ip prefix-list FILTER permit 212.0.0.0/7 ge 9 le 20 ip prefix-list FILTER permit 217.0.0.0/8 ge 9 le 20
  • 118. 118118118© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 “Net Police” prefix list issues • meant to “punish” ISPs who won’t and don’t aggregate • impacts legitimate multihoming • impacts regions where domestic backbone is unavailable or costs $$$ compared with international bandwidth • hard to maintain – requires updating when RIRs start allocating from new address blocks • don’t do it unless consequences understood and you are prepared to keep it current
  • 119. 119© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multihoming Options
  • 120. 120120120© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multihoming Scenarios • Stub network • Multi-homed stub network • Multi-homed network • Configuration Options
  • 121. 121121121© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Stub Network • No need for BGP • Point static default to upstream ISP • Upstream ISP advertises stub network • Policy confined within upstream ISP’s policy AS100 AS101
  • 122. 122122122© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multi-homed Stub Network • Use BGP (not IGP or static) to loadshare • Use private AS (ASN > 64511) • Upstream ISP advertises stub network • Policy confined within upstream ISP’s policy AS100 AS65530
  • 123. 123123123© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multi-Homed Network • Many situations possible multiple sessions to same ISP secondary for backup only load-share between primary and secondary selectively use different ISPs AS300 AS200 AS100 Global Internet
  • 124. 124124124© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Private-AS – Application • Applications ISP with single- homed customers (RFC2270) corporate network with several regions and connections to the Internet only in the core 1880 193.1.34.0/24 65003 193.2.35.0/24 65002 193.0.33.0/24 65001 193.0.32.0/24 A 193.1.32.0/22 1880 B C
  • 125. 125125125© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Private-AS Removal • neighbor x.x.x.x remove-private-AS • Rules: available for eBGP neighbors only if the update has AS_PATH made up of private-AS numbers, the private-AS will be dropped if the AS_PATH includes private and public AS numbers, private AS number will not be removed…it is a configuration error! if AS_PATH contains the AS number of the eBGP neighbor, the private-AS numbers will not be removed if used with confederations, it will work as long as the private AS numbers are after the confederation portion of the AS_PATH
  • 126. 126© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two links to the same ISP With Redundancy and Loadsharing
  • 127. 127127127© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two links to the same ISP (with redundancy) AS 109 AS 65534 AA CC • AS109 removes private AS and any customer subprefixes from Internet announcement DDEE BB Link one Link two
  • 128. 128128128© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Loadsharing to the same ISP • Announce /19 aggregate on each link • Split /19 and announce as two /20s, one on each link basic inbound loadsharing assumes equal circuit capacity and even spread of traffic across address block • Vary the split until “perfect” loadsharing achieved • Accept the default from upstream basic outbound loadsharing by nearest exit okay in first approx as most ISP and end-site traffic is inbound
  • 129. 129129129© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two links to the same ISP • Router A Configuration router bgp 65534 network 221.10.0.0 mask 255.255.224.0 network 221.10.0.0 mask 255.255.240.0 neighbor 222.222.10.2 remote-as 109 neighbor 222.222.10.2 prefix-list routerC out neighbor 222.222.10.2 prefix-list default in ! ip prefix-list default permit 0.0.0.0/0 ip prefix-list routerC permit 221.10.0.0/20 ip prefix-list routerC permit 221.10.0.0/19 ! ip route 221.10.0.0 255.255.240.0 null0 ip route 221.10.0.0 255.255.224.0 null0 Router B configuration is similar but with the other /20
  • 130. 130130130© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two links to the same ISP • Router C Configuration router bgp 109 neighbor 222.222.10.1 remote-as 65534 neighbor 222.222.10.1 default-originate neighbor 222.222.10.1 prefix-list Customer in neighbor 222.222.10.1 prefix-list default out ! ip prefix-list Customer permit 221.10.0.0/19 le 20 ip prefix-list default permit 0.0.0.0/0 • Router C only allows in /19 and /20 prefixes from customer block • Router D configuration is identical
  • 131. 131131131© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Loadsharing to the same ISP • Loadsharing configuration is only on customer router • Upstream ISP has to remove customer subprefixes from external announcements remove private AS from external announcements • Could also use BGP communities
  • 132. 132© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two links to the same ISP Multiple Dualhomed Customers (RFC2270)
  • 133. 133133133© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multiple Dualhomed Customers (RFC2270) AS 109 AS 65534A1A1 CC • AS109 removes private AS and any customer subprefixes from Internet announcement DDEE B1B1 AS 65534A2A2 B2B2 AS 65534A3A3 B3B3
  • 134. 134134134© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multiple Dualhomed Customers • Customer announcements as per previous example • Use the same private AS for each customer documented in RFC2270 address space is not overlapping each customer hears default only • Router An and Bn configuration same as Router A and B previously
  • 135. 135135135© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two links to the same ISP • Router A1 Configuration router bgp 65534 network 221.10.0.0 mask 255.255.224.0 network 221.10.0.0 mask 255.255.240.0 neighbor 222.222.10.2 remote-as 109 neighbor 222.222.10.2 prefix-list routerC out neighbor 222.222.10.2 prefix-list default in ! ip prefix-list default permit 0.0.0.0/0 ip prefix-list routerC permit 221.10.0.0/20 ip prefix-list routerC permit 221.10.0.0/19 ! ip route 221.10.0.0 255.255.240.0 null0 ip route 221.10.0.0 255.255.224.0 null0 Router B1 configuration is similar but for the other /20
  • 136. 136136136© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multiple Dualhomed Customers • Router C Configuration router bgp 109 neighbor bgp-customers peer-group neighbor bgp-customers remote-as 65534 neighbor bgp-customers default-originate neighbor bgp-customers prefix-list default out neighbor 222.222.10.1 peer-group bgp-customers neighbor 222.222.10.1 description Customer One neighbor 222.222.10.1 prefix-list Customer1 in neighbor 222.222.10.9 peer-group bgp-customers neighbor 222.222.10.9 description Customer Two neighbor 222.222.10.9 prefix-list Customer2 in
  • 137. 137137137© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multiple Dualhomed Customers neighbor 222.222.10.17 peer-group bgp-customers neighbor 222.222.10.17 description Customer Three neighbor 222.222.10.17 prefix-list Customer3 in ! ip prefix-list Customer1 permit 221.10.0.0/19 le 20 ip prefix-list Customer2 permit 221.16.64.0/19 le 20 ip prefix-list Customer3 permit 221.14.192.0/19 le 20 ip prefix-list default permit 0.0.0.0/0 • Router C only allows in /19 and /20 prefixes from customer block • Router D configuration is almost identical
  • 138. 138138138© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multiple Dualhomed Customers • Router E Configuration assumes customer address space is not part of upstream’s address block router bgp 109 neighbor 222.222.10.17 remote-as 110 neighbor 222.222.10.17 remove-private-AS neighbor 222.222.10.17 prefix-list Customers out ! ip prefix-list Customers permit 221.10.0.0/19 ip prefix-list Customers permit 221.16.64.0/19 ip prefix-list Customers permit 221.14.192.0/19 • Private AS still visible inside AS109
  • 139. 139139139© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Multiple Dualhomed Customers • If customers’ prefixes come from ISP’s address block do NOT announce them to the Internet announce ISP aggregate only • Router E configuration: router bgp 109 neighbor 222.222.10.17 remote-as 110 neighbor 222.222.10.17 prefix-list my-aggregate out ! ip prefix-list my-aggregate permit 221.8.0.0/13
  • 140. 140© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two links to different ISPs With Redundancy
  • 141. 141141141© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two links to different ISPs (with redundancy) • Announce /19 aggregate on each link • Split /19 and announce as two /20s, one on each link basic inbound loadsharing • When one link fails, the announcement of the /19 aggregate via the other ISP ensures continued connectivity
  • 142. 142142142© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 AS 109 AS 108 AS 107 CC DD Two links to different ISPs (with redundancy) Announce second /20 and /19 block Internet Announce first /20 and /19 block BBAA
  • 143. 143143143© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two links to different ISPs (with redundancy) • Router A Configuration router bgp 107 network 221.10.0.0 mask 255.255.224.0 network 221.10.0.0 mask 255.255.240.0 neighbor 222.222.10.1 remote-as 109 neighbor 222.222.10.1 prefix-list firstblock out neighbor 222.222.10.1 prefix-list default in ! ip prefix-list default permit 0.0.0.0/0 ! ip prefix-list firstblock permit 221.10.0.0/20 ip prefix-list firstblock permit 221.10.0.0/19
  • 144. 144144144© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two links to different ISPs (with redundancy) • Router B Configuration router bgp 107 network 221.10.0.0 mask 255.255.224.0 network 221.10.16.0 mask 255.255.240.0 neighbor 220.1.5.1 remote-as 108 neighbor 220.1.5.1 prefix-list secondblock out neighbor 220.1.5.1 prefix-list default in ! ip prefix-list default permit 0.0.0.0/0 ! ip prefix-list secondblock permit 221.10.16.0/20 ip prefix-list secondblock permit 221.10.0.0/19
  • 145. 145© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two links to different ISPs More Controlled Loadsharing
  • 146. 146146146© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Loadsharing with different ISPs • Announce /19 aggregate on each link On first link, announce /19 as normal On second link, announce /19 with longer AS PATH, and announce one /20 subprefix controls loadsharing between upstreams and the Internet • Vary the subprefix size and AS PATH length until “perfect” loadsharing achieved • Still require redundancy!
  • 147. 147147147© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 AS 109 AS 108 AS 107 CC DD Loadsharing with different ISPs Announce /20 subprefix, and /19 block with longer AS path Internet Announce /19 block BBAA
  • 148. 148148148© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Loadsharing with different ISPs • Router A Configuration router bgp 107 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.1 remote-as 109 neighbor 222.222.10.1 prefix-list default in neighbor 222.222.10.1 prefix-list aggregate out ! ip prefix-list aggregate permit 221.10.0.0/19
  • 149. 149149149© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Loadsharing with different ISPs • Router B Configuration router bgp 107 network 221.10.0.0 mask 255.255.224.0 network 221.10.16.0 mask 255.255.240.0 neighbor 220.1.5.1 remote-as 108 neighbor 220.1.5.1 prefix-list default in neighbor 220.1.5.1 prefix-list subblocks out neighbor 220.1.5.1 route-map routerD out ! ..next slide..
  • 150. 150150150© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Loadsharing with different ISPs route-map routerD permit 10 match ip address prefix-list aggregate set as-path prepend 107 107 route-map routerD permit 20 ! ip prefix-list subblocks permit 221.10.0.0/19 le 20 ip prefix-list aggregate permit 221.10.0.0/19
  • 151. 151© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Service Provider Multihoming
  • 152. 152152152© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Service Provider Multihoming • Previous examples dealt with loadsharing inbound traffic What about outbound? • ISPs strive to balance traffic flows in both directions Balance link utilisation Try and keep most traffic flows symmetric
  • 153. 153153153© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Service Provider Multihoming • Balancing outbound traffic requires inbound routing information Common solution is “full routing table” Rarely necessary – the “routing mallet” to try solve loadsharing problems Keep It Simple (KISS) is often easier (and $$$ cheaper) than carrying n-copies of the full routing table
  • 154. 154154154© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Service Provider Multihoming • Examples One upstream, one local peer One upstream, local exchange point Two upstreams, one local peer • All examples require BGP and a public ASN
  • 155. 155© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Service Provider Multihoming One Upstream, One local peerOne Upstream, One local peer
  • 156. 156156156© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, One Local Peer • Announce /19 aggregate on each link • Accept default route only from upstream Either 0.0.0.0/0 or a network which can be used as default • Accept all routes from local peer
  • 157. 157157157© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, One Local Peer AS 109 CC AA Upstream ISP AS107 Local Peer AS108
  • 158. 158158158© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, One Local Peer • Router A Configuration router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.2 remote-as 108 neighbor 222.222.10.2 prefix-list my-block out neighbor 222.222.10.2 prefix-list AS108-peer in ! ip prefix-list AS108-peer permit 222.5.16.0/19 ip prefix-list AS108-peer permit 221.240.0.0/20 ip prefix-list my-block permit 221.10.0.0/19 ! ip route 221.10.0.0 255.255.224.0 null0
  • 159. 159159159© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, One Local Peer • Router A – Alternative Configuration router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.2 remote-as 108 neighbor 222.222.10.2 prefix-list my-block out neighbor 222.222.10.2 filter-list 10 in ! ip as-path access-list 10 permit ^(108_)+$ ! ip prefix-list my-block permit 221.10.0.0/19 ! ip route 221.10.0.0 255.255.224.0 null0
  • 160. 160160160© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, One Local Peer • Router C Configuration router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.1 remote-as 107 neighbor 222.222.10.1 prefix-list default in neighbor 222.222.10.1 prefix-list my-block out ! ip prefix-list my-block permit 221.10.0.0/19 ip prefix-list default permit 0.0.0.0/0 ! ip route 221.10.0.0 255.255.224.0 null0
  • 161. 161161161© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, One Local Peer • Two configurations possible for Router A Filter-lists assume peer knows what they are doing Prefix-list higher maintenance, but safer • Local traffic goes to and from local peer, everything else goes to upstream
  • 162. 162© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Service Provider Multihoming One Upstream, Local Exchange PointOne Upstream, Local Exchange Point
  • 163. 163163163© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, Local Exchange Point • Announce /19 aggregate to every neighbouring AS • Accept default route only from upstream Either 0.0.0.0/0 or a network which can be used as default • Accept all routes from IXP peers
  • 164. 164164164© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, Local Exchange Point AS 109 CC AA Upstream ISP AS107 IXP
  • 165. 165165165© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, Local Exchange Point • Router A Configuration interface fastethernet 0/0 description Exchange Point LAN ip address 220.5.10.1 mask 255.255.255.224 ip verify unicast reverse-path no ip directed-broadcast no ip proxy-arp no ip redirects ! router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor ixp-peers peer-group neighbor ixp-peers soft-reconfiguration in neighbor ixp-peers prefix-list my-block out ..next slide
  • 166. 166166166© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, Local Exchange Point neighbor 220.5.10.2 remote-as 100 neighbor 222.5.10.2 peer-group ixp-peers neighbor 222.5.10.2 prefix-list peer100 in neighbor 220.5.10.3 remote-as 101 neighbor 222.5.10.3 peer-group ixp-peers neighbor 222.5.10.3 prefix-list peer101 in neighbor 220.5.10.4 remote-as 102 neighbor 222.5.10.4 peer-group ixp-peers neighbor 222.5.10.4 prefix-list peer102 in neighbor 220.5.10.5 remote-as 103 neighbor 222.5.10.5 peer-group ixp-peers neighbor 222.5.10.5 prefix-list peer103 in ..next slide
  • 167. 167167167© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, Local Exchange Point ip route 221.10.0.0 255.255.224.0 null0 ! ip prefix-list my-block permit 221.10.0.0/19 ip prefix-list peer100 permit 222.0.0.0/19 ip prefix-list peer101 permit 222.30.0.0/19 ip prefix-list peer102 permit 222.12.0.0/19 ip prefix-list peer103 permit 222.18.128.0/19 !
  • 168. 168168168© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, Local Exchange Point • Router C Configuration router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.1 remote-as 107 neighbor 222.222.10.1 prefix-list default in neighbor 222.222.10.1 prefix-list my-block out ! ip prefix-list my-block permit 221.10.0.0/19 ip prefix-list default permit 0.0.0.0/0 ! ip route 221.10.0.0 255.255.224.0 null0
  • 169. 169169169© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 One Upstream, Local Exchange Point • Note Router A configuration Prefix-list higher maintenance, but safer uRPF on the FastEthernet interface • IXP traffic goes to and from local IXP, everything else goes to upstream
  • 170. 170© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Service Provider Multihoming Two Upstreams, One local peerTwo Upstreams, One local peer
  • 171. 171171171© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer • Announce /19 aggregate on each link • Accept default route only from upstreams Either 0.0.0.0/0 or a network which can be used as default • Accept all routes from local peer
  • 172. 172172172© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer AS 109 CC AA Upstream ISP AS106 Local Peer AS108 DD Upstream ISP AS107
  • 173. 173173173© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer • Router A Same routing configuration as in example with one upstream and one local peer Same hardware configuration
  • 174. 174174174© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer • Router C Configuration router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.1 remote-as 107 neighbor 222.222.10.1 prefix-list default in neighbor 222.222.10.1 prefix-list my-block out ! ip prefix-list my-block permit 221.10.0.0/19 ip prefix-list default permit 0.0.0.0/0 ! ip route 221.10.0.0 255.255.224.0 null0
  • 175. 175175175© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer • Router D Configuration router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.5 remote-as 106 neighbor 222.222.10.5 prefix-list default in neighbor 222.222.10.5 prefix-list my-block out ! ip prefix-list my-block permit 221.10.0.0/19 ip prefix-list default permit 0.0.0.0/0 ! ip route 221.10.0.0 255.255.224.0 null0
  • 176. 176176176© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer • This is the simple configuration for Router C and D • Traffic out to the two upstreams will take nearest exit Inexpensive routers required This is not useful in practice especially for international links Loadsharing needs to be better
  • 177. 177177177© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer • Better configuration options: Accept full routing from both upstreams Expensive & unnecessary! Accept default from one upstream and some routes from the other upstream The way to go!
  • 178. 178178178© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Full Routes • Router C Configuration router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.1 remote-as 107 neighbor 222.222.10.1 prefix-list rfc1918-deny in neighbor 222.222.10.1 prefix-list my-block out neighbor 222.222.10.1 route-map AS107-loadshare in ! ip prefix-list my-block permit 221.10.0.0/19 ! See earlier in presentation for RFC1918 list ..next slide
  • 179. 179179179© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Full Routes ip route 221.10.0.0 255.255.224.0 null0 ! ip as-path access-list 10 permit ^(107_)+$ ip as-path access-list 10 permit ^(107_)+_[0-9]+$ ! route-map AS107-loadshare permit 10 match ip as-path 10 set local-preference 120 route-map AS107-loadshare permit 20 set local-preference 80 !
  • 180. 180180180© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Full Routes • Router D Configuration router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.5 remote-as 106 neighbor 222.222.10.5 prefix-list rfc1918-deny in neighbor 222.222.10.5 prefix-list my-block out ! ip prefix-list my-block permit 221.10.0.0/19 ! See earlier in presentation for RFC1918 list
  • 181. 181181181© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Full Routes • Router C configuration: Accept full routes from AS107 Tag prefixes originated by AS107 and AS107’s neighbouring ASes with local preference 120 Traffic to those ASes will go over AS107 link Remaining prefixes tagged with local preference of 80 Traffic to other all other ASes will go over the link to AS106 • Router D configuration same as Router C without the route-map
  • 182. 182182182© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Full Routes • Full routes from upstreams Expensive – needs 128Mbytes RAM today Need to play preference games Previous example is only an example – real life will need improved fine-tuning! Previous example doesn’t consider inbound traffic – see earlier presentation for examples
  • 183. 183183183© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Partial Routes • Router C Configuration router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.1 remote-as 107 neighbor 222.222.10.1 prefix-list rfc1918-nodef-deny in neighbor 222.222.10.1 prefix-list my-block out neighbor 222.222.10.1 filter-list 10 in neighbor 222.222.10.1 route-map tag-default-low in ! ip prefix-list my-block permit 221.10.0.0/19 ip prefix-list default permit 0.0.0.0/0 ..next slide
  • 184. 184184184© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Partial Routes ! See earlier presentation for RFC1918 list ! ip route 221.10.0.0 255.255.224.0 null0 ! ip as-path access-list 10 permit ^(107_)+$ ip as-path access-list 10 permit ^(107_)+_[0-9]+$ ! route-map tag-default-low permit 10 match ip address prefix-list default set local-preference 80 route-map tag-default-low permit 20 !
  • 185. 185185185© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Partial Routes • Router D Configuration router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.5 remote-as 106 neighbor 222.222.10.5 prefix-list default in neighbor 222.222.10.5 prefix-list my-block out ! ip prefix-list my-block permit 221.10.0.0/19 ip prefix-list default permit 0.0.0.0/0 ! ip route 221.10.0.0 255.255.224.0 null0
  • 186. 186186186© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Partial Routes • Router C configuration: Accept full routes from AS107 (or get them to send less) Filter ASNs so only AS107 and AS107’s neighbouring ASes are accepted Allow default, and set it to local preference 80 Traffic to those ASes will go over AS107 link Traffic to other all other ASes will go over the link to AS106 If AS106 link fails, backup via AS107 – and vice-versa
  • 187. 187187187© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Partial Routes • Partial routes from upstreams Not expensive – only carry the routes necessary for loadsharing Need to filter on AS paths Previous example is only an example – real life will need improved fine-tuning! Previous example doesn’t consider inbound traffic – see earlier presentation for examples
  • 188. 188188188© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Partial Routes • When upstreams cannot or will not announce default route Because of operational policy against using “default-originate” on BGP peering Solution is to use IGP to propagate default from the edge/peering routers
  • 189. 189189189© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Partial Routes • Router C Configuration router ospf 109 default-information originate metric 30 passive-interface Serial 0/0 ! router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.1 remote-as 107 neighbor 222.222.10.1 prefix-list rfc1918-deny in neighbor 222.222.10.1 prefix-list my-block out neighbor 222.222.10.1 filter-list 10 in ! ..next slide
  • 190. 190190190© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Partial Routes ip prefix-list my-block permit 221.10.0.0/19 ! See earlier presentation for RFC1918 list ! ip route 221.10.0.0 255.255.224.0 null0 ip route 0.0.0.0 0.0.0.0 serial 0/0 254 ! ip as-path access-list 10 permit ^(107_)+$ ip as-path access-list 10 permit ^(107_)+_[0-9]+$ !
  • 191. 191191191© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Partial Routes • Router D Configuration router ospf 109 default-information originate metric 10 passive-interface Serial 0/0 ! router bgp 109 network 221.10.0.0 mask 255.255.224.0 neighbor 222.222.10.5 remote-as 106 neighbor 222.222.10.5 prefix-list deny-all in neighbor 222.222.10.5 prefix-list my-block out ! ..next slide
  • 192. 192192192© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Partial Routes ip prefix-list deny-all deny 0.0.0.0/0 le 32 ip prefix-list my-block permit 221.10.0.0/19 ! See earlier presentation for RFC1918 list ! ip route 221.10.0.0 255.255.224.0 null0 ip route 0.0.0.0 0.0.0.0 serial 0/0 254 !
  • 193. 193193193© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Two Upstreams, One Local Peer: Partial Routes • Partial routes from upstreams Use OSPF to determine outbound path Router D default has metric 10 – primary outbound path Router C default has metric 30 – backup outbound path Serial interface goes down, static default is removed from routing table, OSPF default withdrawn
  • 194. 194© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Service Provider Multihoming Case StudyCase Study
  • 195. 195195195© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Requirements (1) • ISP needs to multihome: To AS5400 in Europe To AS2516 in Japan /19 allocated by APNIC AS 17660 assigned by APNIC 1Mbps circuits to both upstreams
  • 196. 196196196© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Requirements (2) • ISP wants: Symmetric routing and equal link utilisation in and out (as close as possible) international circuits are expensive Has two 2600 border routers with 64Mbytes memory Cannot afford to upgrade memory or hardware on border routers or internal routers • “Philip, make it work, please”
  • 197. 197197197© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study AS 17660 AA Upstream ISP AS2516 BB Upstream ISP AS5400 ISP Core Allocated /19 from APNIC Circuit to AS5400 is 1Mbps, circuit to AS2516 is 1Mbps
  • 198. 198198198© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study • Both providers stated that routers with 128Mbytes memory required for AS17660 to multihome Wrong! Full routing table is rarely required or desired • Solution: Accept default from one upstream Accept partial prefixes from the other
  • 199. 199199199© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Inbound Loadsharing • First cut: Went to a few US Looking Glasses Checked the AS path to AS5400 Checked the AS path to AS2516 AS2516 was one hop “closer” Sent AS-PATH prepend of one AS on AS2516 peering
  • 200. 200200200© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Inbound Loadsharing • Refinement Did not need any First cut worked, seeing on average 600kbps inbound on each circuit Does vary according to time of day, but this is as balanced as it can get, given customer profile J
  • 201. 201201201© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Outbound Loadsharing • First cut: Requested default from AS2516 Requested full routes from AS5400 • Then looked at my Routing Report Picked the top 5 ASNs and created a filter-list If 701, 1, 7018, 1239 or 7046 are in AS-PATH, prefixes are discarded Allowed prefixes originated by AS5400 and up to two AS hops away Resulted in 32000 prefixes being accepted in AS17660
  • 202. 202202202© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Outbound Loadsharing • Refinement 32000 prefixes quite a lot, seeing more outbound traffic on the AS5400 path Traffic was very asymmetric out through AS5400, in through AS2516 Added the next 3 ASNs from the Top 20 list 209, 2914 and 3549 Now seeing 14000 prefixes Traffic is now evenly loadshared outbound Around 200kbps on average Mostly symmetric
  • 203. 203203203© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Configuration Router A router ospf 100 log-adjacency-changes passive-interface default no passive-interface Ethernet0/0 default-information originate metric 20 ! router bgp 17660 no synchronization no bgp fast-external-fallover bgp log-neighbor-changes bgp deterministic-med ...next slide
  • 204. 204204204© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Configuration Router A neighbor 166.49.165.13 remote-as 5400 neighbor 166.49.165.13 description eBGP multihop to AS5400 neighbor 166.49.165.13 ebgp-multihop 5 neighbor 166.49.165.13 update-source Loopback0 neighbor 166.49.165.13 prefix-list in-filter in neighbor 166.49.165.13 prefix-list out-filter out neighbor 166.49.165.13 filter-list 1 in neighbor 166.49.165.13 filter-list 3 out ! prefix-list in-filter deny rfc1918etc in prefix-list out-filter permit 202.144.128.0/19 ! ip route 0.0.0.0 0.0.0.0 serial 0/0 254 ...next slide
  • 205. 205205205© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Configuration Router A ip as-path access-list 1 deny _701_ ip as-path access-list 1 deny _1_ ip as-path access-list 1 deny _7018_ ip as-path access-list 1 deny _1239_ ip as-path access-list 1 deny _7046_ ip as-path access-list 1 deny _209_ ip as-path access-list 1 deny _2914_ ip as-path access-list 1 deny _3549_ ip as-path access-list 1 permit _5400$ ip as-path access-list 1 permit _5400_[0-9]+$ ip as-path access-list 1 permit _5400_[0-9]+_[0-9]+$ ip as-path access-list 1 deny .* ip as-path access-list 3 permit ^$ !
  • 206. 206206206© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Configuration Router B router ospf 100 log-adjacency-changes passive-interface default no passive-interface Ethernet0/0 default-information originate ! router bgp 17660 no synchronization no auto-summary no bgp fast-external-fallover ...next slide
  • 207. 207207207© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Configuration Router B bgp log-neighbor-changes bgp deterministic-med neighbor 210.132.92.165 remote-as 2516 neighbor 210.132.92.165 description eBGP peering neighbor 210.132.92.165 soft-reconfiguration inbound neighbor 210.132.92.165 prefix-list default-route in neighbor 210.132.92.165 prefix-list out-filter out neighbor 210.132.92.165 route-map as2516-out out neighbor 210.132.92.165 maximum-prefix 100 neighbor 210.132.92.165 filter-list 2 in neighbor 210.132.92.165 filter-list 3 out ! ...next slide
  • 208. 208208208© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Configuration Router B ! prefix-list default-route permit 0.0.0.0/0 prefix-list out-filter permit 202.144.128.0/19 ! ip as-path access-list 2 permit _2516$ ip as-path access-list 2 deny .* ip as-path access-list 3 permit ^$ ! route-map as2516-out permit 10 set as-path prepend 17660 !
  • 209. 209209209© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Configuration Summary • Router A Hears full routing table – throws away most of it AS5400 BGP options are all or nothing Static default pointing to serial interface – if link goes down, OSPF default removed • Router B Hears default from AS2516 If default disappears (BGP goes down or link goes down), OSPF default is removed
  • 210. 210210210© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study MRTG Graphs Router B to AS2516 Router A to AS5400
  • 211. 211211211© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 Case Study Summary • Multihoming is not hard, really! Needs a bit of thought, a bit of planning Use this case study as an example strategy Does not require sophisticated equipment, big memory, fast CPUs…
  • 212. 212212212© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP for Internet Service Providers • BGP Basics (quick recap) • Scaling BGP • Deploying BGP in an ISP network • Multihoming Examples
  • 213. 213© 2002, Cisco Systems, Inc. All rights reserved.AfNOG 3 BGP for Internet Service Providers End of TutorialEnd of Tutorial