SlideShare a Scribd company logo
Using BGP to Manage 
Dual Internet 
connections 
SDCUG 
Sept 10, 2014 
Meredith Rose, CCIE#4617
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
2 
Intro 
• Meredith Rose, CCIE#4617 Emeritus 
• Currently a Solutions Architect for SIGAMnet 
• Disaster Recovery and Redundancy are 
recurring themes requested by customers 
striving to improve their network uptime 
• Internet access has become 
better/faster/cheaper, causing more 
companies to rely on it and expect 5-nines 
uptime. 
• Not planning on reviewing the BGP protocol 
details, but please ask questions any time.
High Level Agenda 
• The need for Corp Internet x 2 
• What you need to use BGP 
• Key considerations 
• BGP routes offered by ISPs 
• Influencing traffic flows 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
3
Does a Company Need 2 Connections to 
the Internet? 
• Internet access is business-critical 
• Apps, data exist in the cloud (ie AWS, WebEx) 
• Branch connectivity via VPNs over the Internet 
• Remote access, B2B connections 
• eCommerce hosted at Corp data center 
• Redundancy is a must; the less $ the better 
• BGP can give you tools for utilizing the bandwidth 
of both Internet connections simultaneously 
and/or dynamic failover with 1 connection 
backing up the other 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
4
“I want to use BGP to Load Balance my 
Internet Connections” 
• The BGP protocol does NOT know how to “load balance” your Internet traffic! 
• BGP’s job is to select the single best path to a destination among the BGP 
paths that are learned from different sources/ISP’s. 
• BGP is not aware which link is “full” (oversubscribed) or “faster” (lower latency) 
• Load sharing across your redundant Internet connections is a manual process 
done on a per prefix basis that takes some TLC. 
• Inbound and Outbound traffic loads of each link are tuned separately by 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
5 
manipulating BGP attributes
One Internet Connection 
ISP Router 
Global Internet 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
6 
Internet Connection 
Corporate LAN 
Corp Router 
ISP 
• Static routes to Corp on ISP router 
• static default route to ISP on Corp router 
• No need for BGP
Redundant Internet Connections 
ISP#1 Router 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
7 
InternetConnection#1 
Corporate LAN 
Corp Router#1 
ISP#1 
Global Internet 
ISP#2 Router 
InternetConnection#2 
Corp Router#2 
ISP#2 
eBGP eBGP 
iBGP 
L3 
FHRP/OSPF/etc
Review of Recovery from Failure 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
8 
• ISP failure 
– Internet handoff 
– Router failure 
– Upstream peering issues 
• Corp Router failure 
– Internet handoff 
– Router failure 
– Connection to Corp LAN
Getting started with BGP to the Internet 
• You will need an ASN (Autonomous System 
Number). AKA “AS number” 
– This can be private if using redundant 
connections to the same ISP. 
 Obtain from ISP 
 Will be removed by ISP before being advertised to 
global Internet 
 Note: impacts ability to influence inbound traffic with 
as-path pre-pending 
– This will be a public ASN if connecting to diverse 
ISPs. 
 Obtain from ARIN 
 More flexibility, ISP-independent 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
9
Getting started with BGP to the Internet 
• You will need a public IP address “block” to advertise 
• /24 minimum 
– This can be assigned/leased to you from your ISP 
 Easy if both Internet connections are from same ISP 
 Make sure the ISP that allocated the block to you advertises your 
specific subnet (ie /24) and not just their supernet block. 
 If using diverse ISP’s, must check with both to make sure it is ok to 
advertise IP block from ISP#1 IP space through ISP#2. 
 More convenient, but less portable 
– This IP block can be owned by your company. 
 You can advertise your block to both ISPs. 
 More mobility if change ISP’s 
– Make sure you only advertise your assigned, routable IP 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
10 
address space! 
– You will advertise the SAME IP block out to BOTH ISP’s 
 Can do some tricks with splitting into sub-prefixes and advertising 
smaller, more specific chunks. Always >=/24
Key Considerations 
• Ingress and Egress “traffic engineering” managed separately 
• OUTBOUND traffic influencing 
– Get your Corp traffic to its destination on the Internet 
– Want to send traffic out the “best” ISP 
 Shortest AS path is usually best 
– Want to avoid oversubscribing a link 
• INBOUND traffic influencing 
– Packets from everywhere on the global Internet have to find 
your Corp network. ISP advertises your IP block(s) to global 
Internet 
– Asymmetric is usually OK here (out one ISP, in the other) 
 Caveat: not ok if you have non-stateful firewalls 
– Want to take “best” route from global Internet to Corp 
 Shortest AS path wins in most cases by default 
– Want to avoid oversubscribing a link 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
11
Key Considerations (Continued) 
• Redundancy protocols on Corp routers. 
– HSRP/VRRP if L2 connected 
– Or use L3 dynamic protocol like OSPF. Internet 
routers can be in different Corp locations, L3 
connected. Each Corp BGP router can originate a 
default route in Corp-wide OSPF. 
• Corp routers need to know how to get to ISP 
router’s peering IP address (or use next-hop-self 
on iBGP session). If iBGP routers peer on 
loopback, must be reachable (use IGP + update-source 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
12 
loopback0) 
• Get Corp traffic destined for Internet to one of 
the Corp Internet routers. It doesn’t really matter 
which one. BGP will take it from there. 
• It’s about manual traffic load distribution; BGP 
does not know how to do dynamic Load 
Balancing to multiple ISPs on its own 
• You do not want your Corp to be come a 
“Transit” path between your two ISP’s!
“Transit” - What’s the big deal? 
Corporate LAN 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
13 
ISP#1 
Global Internet 
ISP#2 
ISP#1 
Routes 
ISP#2 says “Hey 
Global Internet! 
Here’s a quick way 
to reach ISP#1 
customers!”
Don’t be a Transit! 
Corporate LAN 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
14 
ISP#1 
Global Internet 
ISP#2 
ISP#2 Routes ISP#1 Routes 
Only send 
routes 
originating 
from your 
Corp ASN to 
each ISP 
iBGP full route 
exchange
What Routes to Take in from ISP 
• Remember: this affects OUTBOUND decisions (not inbound), 
ie which ISP your Corp will use to make a connection to a site 
on the Internet. Most common options: 
• Option#1: Full Internet routes from each ISP 
• Option#2: Default/0.0.0.0 only from each ISP 
– Tune so use one link as primary, other as backup 
• Option#3: ISP’s Customer Routes Only 
– AKA “Partial Routes” 
– Get each ISP’s local customer routes only. Use a 
default route to put the rest of the outbound traffic on 
one ISP’s link, backup by other ISP. 
– Or use just one ISP link to receive that ISP’s directly 
connected customers, use default route to put the rest 
of the outbound traffic on the other link 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
15
Option#1: Full Routes from Both 
Corporate LAN 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
16 
ISP#1 
Global Internet 
ISP#2 
Full 
Routes 
from 
ISP#1 
iBGP full route 
exchange 
Full 
Routes 
from 
ISP#2
What Routes to Take In from ISP 
• Option#1: Full Internet routes from each ISP 
– Need a lot of memory for this. Each router will have 
2xfull Internet routing table (table>450k routes)! 
– Let it play out and monitor for over-utilization of one 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
17 
link 
– Tune to balance links better if necessary 
– Use route-map + as-path access list to make sure you 
do not become a transit between ISP’s. 
 Do not advertise routes to ISP#2 that you learned from ISP#1 
and vice versa 
 apply a similar route map outbound to each ISP neighbor so 
that only locally originated BGP routes are advertised 
– route-map localonly permit 10 
– match as-path 10 
– ip as-path access-list 10 permit ^$ 
– Not a bad idea to take a default from each ISP as well
Option#2: Default from Both 
Corporate LAN 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
18 
ISP#1 
Global Internet 
ISP#2 
0.0.0.0 
iBGP exchange 
default received 
routes 
w/preferences 
Configure iBGP to 
prefer default 
route from ISP#1 
0.0.0.0 
iBGP will agree to 
prefer 0.0.0.0 from 
ISP#1 over ISP#2
What Routes to Take In from ISP 
• Option#2: Default only from each ISP 
– Tune BGP (local pref is common) so use one link 
as primary, other as backup (again, only applies to 
OUTBOUND traffic) 
– Tell your ISPs you only want them to send you the 
default route 
– Use an inbound prefix-list on route-map inbound 
on the ISP neighbor statement or similar filter to 
make sure to drop every route except default just 
in case 
 ip prefix-list default-only seq 5 permit 0.0.0.0/0 
– Still only advertise prefixes originated by your AS 
to ISP#1 and ISP#2 (by default, BGP won’t send 
them each other’s 0.0.0.0 that you learned – 
phew!) 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
19
Option#3: ISP Local Routes Only 
Corporate LAN 
Routes 
from ISP#2 
customers 
+ 0.0.0.0 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
20 
ISP#1 
Global Internet 
ISP#2 
Routes 
from ISP#1 
customers 
+ 0.0.0.0 
iBGP will naturally 
send traffic for 
local routes to its 
corresponding ISP 
Configure iBGP to prefer 
default route from ISP#1 
to catch routes not local 
to either ISP 
iBGP will agree to prefer 
ISP#1 for everything not 
local to ISP#2
What Routes to Take In from ISP 
• Option#3: ISP’s routes only + Default 
– Only receive routes from an ISP of that ISP’s directly 
connected customers (think of how many big companies 
host with ATT, etc) 
– You can ask your ISP to send you just their customer routes 
– Filter routes not sourced from that ISP just in case (in this 
example, ISP = AS100, route-map is inbound on neighbor 
statement to ISP): 
 ip as-path access-list 20 permit ^100$ 
 route-map as100only permit 10 
 match as-path 20 
– Use one link for one directly connected ISP’s customers 
(more local provider), use default route to prefer to put the 
rest of the outbound traffic on the other link or similar combo 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
21
Influencing Traffic Flows: OUTBOUND 
• OUTBOUND Traffic Control is easier than INBOUND. 
It’s all on you. 
• All you have to control is how attractive a destination 
looks to your Corp BGP routers. 
• You can only control the next AS in the path (ie ISP#1 
vs ISP#2), not the entire path through the global 
Internet to the destination. 
• Most common OUTBOUND: 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
22 
– Local preference 
 Outbound traffic flows to one of your Corp BGP routers. BGP will 
have used the “local preference” attribute to tell that router which 
route to take (ISP#1 vs ISP#2) to reach the destination. 
 Monitor regularly and tweak/tune local pref of prefixes as desired 
 Look for popular, heavily-used prefixes to influence to get the 
most bang for your buck (or increase local pref of big /4 chunks)
Influencing Traffic Flows: INBOUND 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
23 
• Most common INBOUND: 
– AS-Path prepend 
 Backup Path: If you don’t want traffic to come in on a link for a prefix (or the entire IP block), use 
Prepending feature to add AS Path length to your outbound advertisement, making this link the less 
preferred path for traffic to your IP block. Aka “padding”. 4xAS# is generally sufficient 
 Primary Path: Use standard advertisement (no prepending) for the link you prefer to use for inbound 
traffic to your company 
 Still have (pre-pended, valid) advertisement from backup path if primary path fails. 
– Example: set as-path prepend 130 130 130 (add to route-map and apply to neighbor statement to backup ISP) 
– Communities 
 Community = instructions from you to your ISP on how to tweak what you advertise 
 ISP will let you know definition of communities they honor 
 You will attach a community to a prefix that you are advertising to your ISP(s) 
 Consists of a series of numbers that correspond to handling instructions for that prefix (such as set 
local pref within provider’s AS) 
 Communities can also be used internally to identify routes. For example, you can assign all routes that came 
from ISP#1 with a community and routes that came from ISP#2 with a different community. That community 
identifier can then be used by your company to assign preferences to routes advertised internally via iBGP. For 
example, I want all traffic destined for YouTube’s /16 IP Block to use ISP#2, even though ISP#1 has a shorter 
AS-Path for the YouTube subnet (perhaps bandwidth is greater to ISP#2). So use the community to set a 
better metric on that route when it comes in from ISP#2. Remember, weight and local pref take precedence 
over AS-path length. 
– Prefix-splitting 
 ie /192x/20 subnets. Advertise one to each ISP, both also advertise complete /19 aggregate as a 
safety-net to cover failure of one ISP. Remember: most specific advertisement always wins! 
 Works best when you own your IP Space (splits still >=/24) 
 Use a BGP Looking Glass or Route Server to see how to get to your Corp AS’s prefixes
Thank You! 
SDCUG 
Sept 10, 2014 
Meredith Rose, CCIE#4617
Redundant Internet Connections 
ISP#1 Router 
Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 
25 
InternetConnection#1 
Corporate LAN 
Corp Router#1 
ISP#1 
Global Internet 
ISP#2 Router 
InternetConnection#2 
Corp Router#2 
ISP#2 
eBGP eBGP 
iBGP 
L3 
FHRP/OSPF/etc

More Related Content

What's hot (20)

PDF
Eigrp.ppt
Edgardo Scrimaglia
 
PPTX
Multicastingand multicast routing protocols
Iffat Anjum
 
PPTX
Border Gateway Protocol
Kashif Latif
 
PPT
BGP Overview
Matt Bynum
 
PPT
MPLS (Multi-Protocol Label Switching)
Vipin Sahu
 
PPTX
Routing Information Protocol
Kashif Latif
 
PDF
Link state protocols.ppt
Edgardo Scrimaglia
 
PDF
Ccnp workbook network bulls
Swapnil Kapate
 
PPTX
Border Gatway Protocol
Shashank Asthana
 
PPTX
Presentation on arp protocol
Mohd. Ahmad Siddiqi
 
PDF
Troubleshooting BGP
APNIC
 
PPTX
CCNA training 101
Rohan Reddy
 
PPTX
Rip presentation
Ebrahim AlRahawe
 
PPTX
Link state routing protocol
Aung Thu Rha Hein
 
PPTX
Router configuration in packet tracer
Anabia Anabia
 
PPTX
Virtual Private Network(VPN)
Abrish06
 
PPTX
Open Shortest Path First
Kashif Latif
 
PPT
Data Link Layer
Rutwik Jadhav
 
PPTX
Troubleshooting complex layer 2 issues ppt 16 bsit098
Quratulain baloch
 
Multicastingand multicast routing protocols
Iffat Anjum
 
Border Gateway Protocol
Kashif Latif
 
BGP Overview
Matt Bynum
 
MPLS (Multi-Protocol Label Switching)
Vipin Sahu
 
Routing Information Protocol
Kashif Latif
 
Link state protocols.ppt
Edgardo Scrimaglia
 
Ccnp workbook network bulls
Swapnil Kapate
 
Border Gatway Protocol
Shashank Asthana
 
Presentation on arp protocol
Mohd. Ahmad Siddiqi
 
Troubleshooting BGP
APNIC
 
CCNA training 101
Rohan Reddy
 
Rip presentation
Ebrahim AlRahawe
 
Link state routing protocol
Aung Thu Rha Hein
 
Router configuration in packet tracer
Anabia Anabia
 
Virtual Private Network(VPN)
Abrish06
 
Open Shortest Path First
Kashif Latif
 
Data Link Layer
Rutwik Jadhav
 
Troubleshooting complex layer 2 issues ppt 16 bsit098
Quratulain baloch
 

Similar to Using BGP To Manage Dual Internet Connections (20)

PDF
The benefit of BGP for every service provider
Thomas Mangin
 
PPT
Bigbgp (1)
acharyanirali
 
PDF
multihoming_202001tttyuyuyyoiouihh25.pdf
soeminTun7
 
PPTX
Introduction to Wide Area Network Routing
Network Utility Force
 
PPT
BGP
Reza Farahani
 
PDF
Practical Implementation of Large BGP Community with Geotags and Traffic Engi...
APNIC
 
PDF
Practical Implementation of Large BGP communities with Geotags and Traffic En...
Muhammad Moinur Rahman
 
PPT
Bigbgp
tushar sharda
 
PPT
Multi
ndthanh0501
 
PDF
U5CSS2 (1).pdf
chelsi33
 
PDF
Optimizing AS Paths
ThousandEyes
 
PDF
BGP on mikrotik
Achmad Mardiansyah
 
DOCX
BGP Protocol Makes the Internet Work
IT Tech
 
PDF
Alternatives to Redistribution Communities in Inter-domain traffic Engineering
cscpconf
 
PDF
How BGP Works
ThousandEyes
 
PDF
BGP-EDS Presentation
East Coast Datacom, Inc.
 
PDF
Network tips tricks
Muhammad Moinur Rahman
 
PDF
Advanced multihoming
Chinmay Biswas
 
PPT
Who are the INTERNET SERVICE PROVIDERS?
Likan Patra
 
PDF
LkNOG 3: Strengthening the Internet infrastructure in Sri Lanka
APNIC
 
The benefit of BGP for every service provider
Thomas Mangin
 
Bigbgp (1)
acharyanirali
 
multihoming_202001tttyuyuyyoiouihh25.pdf
soeminTun7
 
Introduction to Wide Area Network Routing
Network Utility Force
 
Practical Implementation of Large BGP Community with Geotags and Traffic Engi...
APNIC
 
Practical Implementation of Large BGP communities with Geotags and Traffic En...
Muhammad Moinur Rahman
 
U5CSS2 (1).pdf
chelsi33
 
Optimizing AS Paths
ThousandEyes
 
BGP on mikrotik
Achmad Mardiansyah
 
BGP Protocol Makes the Internet Work
IT Tech
 
Alternatives to Redistribution Communities in Inter-domain traffic Engineering
cscpconf
 
How BGP Works
ThousandEyes
 
BGP-EDS Presentation
East Coast Datacom, Inc.
 
Network tips tricks
Muhammad Moinur Rahman
 
Advanced multihoming
Chinmay Biswas
 
Who are the INTERNET SERVICE PROVIDERS?
Likan Patra
 
LkNOG 3: Strengthening the Internet infrastructure in Sri Lanka
APNIC
 
Ad

Recently uploaded (20)

PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
July Patch Tuesday
Ivanti
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
July Patch Tuesday
Ivanti
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Ad

Using BGP To Manage Dual Internet Connections

  • 1. Using BGP to Manage Dual Internet connections SDCUG Sept 10, 2014 Meredith Rose, CCIE#4617
  • 2. Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 2 Intro • Meredith Rose, CCIE#4617 Emeritus • Currently a Solutions Architect for SIGAMnet • Disaster Recovery and Redundancy are recurring themes requested by customers striving to improve their network uptime • Internet access has become better/faster/cheaper, causing more companies to rely on it and expect 5-nines uptime. • Not planning on reviewing the BGP protocol details, but please ask questions any time.
  • 3. High Level Agenda • The need for Corp Internet x 2 • What you need to use BGP • Key considerations • BGP routes offered by ISPs • Influencing traffic flows Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 3
  • 4. Does a Company Need 2 Connections to the Internet? • Internet access is business-critical • Apps, data exist in the cloud (ie AWS, WebEx) • Branch connectivity via VPNs over the Internet • Remote access, B2B connections • eCommerce hosted at Corp data center • Redundancy is a must; the less $ the better • BGP can give you tools for utilizing the bandwidth of both Internet connections simultaneously and/or dynamic failover with 1 connection backing up the other Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 4
  • 5. “I want to use BGP to Load Balance my Internet Connections” • The BGP protocol does NOT know how to “load balance” your Internet traffic! • BGP’s job is to select the single best path to a destination among the BGP paths that are learned from different sources/ISP’s. • BGP is not aware which link is “full” (oversubscribed) or “faster” (lower latency) • Load sharing across your redundant Internet connections is a manual process done on a per prefix basis that takes some TLC. • Inbound and Outbound traffic loads of each link are tuned separately by Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 5 manipulating BGP attributes
  • 6. One Internet Connection ISP Router Global Internet Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 6 Internet Connection Corporate LAN Corp Router ISP • Static routes to Corp on ISP router • static default route to ISP on Corp router • No need for BGP
  • 7. Redundant Internet Connections ISP#1 Router Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 7 InternetConnection#1 Corporate LAN Corp Router#1 ISP#1 Global Internet ISP#2 Router InternetConnection#2 Corp Router#2 ISP#2 eBGP eBGP iBGP L3 FHRP/OSPF/etc
  • 8. Review of Recovery from Failure Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 8 • ISP failure – Internet handoff – Router failure – Upstream peering issues • Corp Router failure – Internet handoff – Router failure – Connection to Corp LAN
  • 9. Getting started with BGP to the Internet • You will need an ASN (Autonomous System Number). AKA “AS number” – This can be private if using redundant connections to the same ISP.  Obtain from ISP  Will be removed by ISP before being advertised to global Internet  Note: impacts ability to influence inbound traffic with as-path pre-pending – This will be a public ASN if connecting to diverse ISPs.  Obtain from ARIN  More flexibility, ISP-independent Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 9
  • 10. Getting started with BGP to the Internet • You will need a public IP address “block” to advertise • /24 minimum – This can be assigned/leased to you from your ISP  Easy if both Internet connections are from same ISP  Make sure the ISP that allocated the block to you advertises your specific subnet (ie /24) and not just their supernet block.  If using diverse ISP’s, must check with both to make sure it is ok to advertise IP block from ISP#1 IP space through ISP#2.  More convenient, but less portable – This IP block can be owned by your company.  You can advertise your block to both ISPs.  More mobility if change ISP’s – Make sure you only advertise your assigned, routable IP Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 10 address space! – You will advertise the SAME IP block out to BOTH ISP’s  Can do some tricks with splitting into sub-prefixes and advertising smaller, more specific chunks. Always >=/24
  • 11. Key Considerations • Ingress and Egress “traffic engineering” managed separately • OUTBOUND traffic influencing – Get your Corp traffic to its destination on the Internet – Want to send traffic out the “best” ISP  Shortest AS path is usually best – Want to avoid oversubscribing a link • INBOUND traffic influencing – Packets from everywhere on the global Internet have to find your Corp network. ISP advertises your IP block(s) to global Internet – Asymmetric is usually OK here (out one ISP, in the other)  Caveat: not ok if you have non-stateful firewalls – Want to take “best” route from global Internet to Corp  Shortest AS path wins in most cases by default – Want to avoid oversubscribing a link Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 11
  • 12. Key Considerations (Continued) • Redundancy protocols on Corp routers. – HSRP/VRRP if L2 connected – Or use L3 dynamic protocol like OSPF. Internet routers can be in different Corp locations, L3 connected. Each Corp BGP router can originate a default route in Corp-wide OSPF. • Corp routers need to know how to get to ISP router’s peering IP address (or use next-hop-self on iBGP session). If iBGP routers peer on loopback, must be reachable (use IGP + update-source Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 12 loopback0) • Get Corp traffic destined for Internet to one of the Corp Internet routers. It doesn’t really matter which one. BGP will take it from there. • It’s about manual traffic load distribution; BGP does not know how to do dynamic Load Balancing to multiple ISPs on its own • You do not want your Corp to be come a “Transit” path between your two ISP’s!
  • 13. “Transit” - What’s the big deal? Corporate LAN Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 13 ISP#1 Global Internet ISP#2 ISP#1 Routes ISP#2 says “Hey Global Internet! Here’s a quick way to reach ISP#1 customers!”
  • 14. Don’t be a Transit! Corporate LAN Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 14 ISP#1 Global Internet ISP#2 ISP#2 Routes ISP#1 Routes Only send routes originating from your Corp ASN to each ISP iBGP full route exchange
  • 15. What Routes to Take in from ISP • Remember: this affects OUTBOUND decisions (not inbound), ie which ISP your Corp will use to make a connection to a site on the Internet. Most common options: • Option#1: Full Internet routes from each ISP • Option#2: Default/0.0.0.0 only from each ISP – Tune so use one link as primary, other as backup • Option#3: ISP’s Customer Routes Only – AKA “Partial Routes” – Get each ISP’s local customer routes only. Use a default route to put the rest of the outbound traffic on one ISP’s link, backup by other ISP. – Or use just one ISP link to receive that ISP’s directly connected customers, use default route to put the rest of the outbound traffic on the other link Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 15
  • 16. Option#1: Full Routes from Both Corporate LAN Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 16 ISP#1 Global Internet ISP#2 Full Routes from ISP#1 iBGP full route exchange Full Routes from ISP#2
  • 17. What Routes to Take In from ISP • Option#1: Full Internet routes from each ISP – Need a lot of memory for this. Each router will have 2xfull Internet routing table (table>450k routes)! – Let it play out and monitor for over-utilization of one Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 17 link – Tune to balance links better if necessary – Use route-map + as-path access list to make sure you do not become a transit between ISP’s.  Do not advertise routes to ISP#2 that you learned from ISP#1 and vice versa  apply a similar route map outbound to each ISP neighbor so that only locally originated BGP routes are advertised – route-map localonly permit 10 – match as-path 10 – ip as-path access-list 10 permit ^$ – Not a bad idea to take a default from each ISP as well
  • 18. Option#2: Default from Both Corporate LAN Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 18 ISP#1 Global Internet ISP#2 0.0.0.0 iBGP exchange default received routes w/preferences Configure iBGP to prefer default route from ISP#1 0.0.0.0 iBGP will agree to prefer 0.0.0.0 from ISP#1 over ISP#2
  • 19. What Routes to Take In from ISP • Option#2: Default only from each ISP – Tune BGP (local pref is common) so use one link as primary, other as backup (again, only applies to OUTBOUND traffic) – Tell your ISPs you only want them to send you the default route – Use an inbound prefix-list on route-map inbound on the ISP neighbor statement or similar filter to make sure to drop every route except default just in case  ip prefix-list default-only seq 5 permit 0.0.0.0/0 – Still only advertise prefixes originated by your AS to ISP#1 and ISP#2 (by default, BGP won’t send them each other’s 0.0.0.0 that you learned – phew!) Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 19
  • 20. Option#3: ISP Local Routes Only Corporate LAN Routes from ISP#2 customers + 0.0.0.0 Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 20 ISP#1 Global Internet ISP#2 Routes from ISP#1 customers + 0.0.0.0 iBGP will naturally send traffic for local routes to its corresponding ISP Configure iBGP to prefer default route from ISP#1 to catch routes not local to either ISP iBGP will agree to prefer ISP#1 for everything not local to ISP#2
  • 21. What Routes to Take In from ISP • Option#3: ISP’s routes only + Default – Only receive routes from an ISP of that ISP’s directly connected customers (think of how many big companies host with ATT, etc) – You can ask your ISP to send you just their customer routes – Filter routes not sourced from that ISP just in case (in this example, ISP = AS100, route-map is inbound on neighbor statement to ISP):  ip as-path access-list 20 permit ^100$  route-map as100only permit 10  match as-path 20 – Use one link for one directly connected ISP’s customers (more local provider), use default route to prefer to put the rest of the outbound traffic on the other link or similar combo Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 21
  • 22. Influencing Traffic Flows: OUTBOUND • OUTBOUND Traffic Control is easier than INBOUND. It’s all on you. • All you have to control is how attractive a destination looks to your Corp BGP routers. • You can only control the next AS in the path (ie ISP#1 vs ISP#2), not the entire path through the global Internet to the destination. • Most common OUTBOUND: Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 22 – Local preference  Outbound traffic flows to one of your Corp BGP routers. BGP will have used the “local preference” attribute to tell that router which route to take (ISP#1 vs ISP#2) to reach the destination.  Monitor regularly and tweak/tune local pref of prefixes as desired  Look for popular, heavily-used prefixes to influence to get the most bang for your buck (or increase local pref of big /4 chunks)
  • 23. Influencing Traffic Flows: INBOUND Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 23 • Most common INBOUND: – AS-Path prepend  Backup Path: If you don’t want traffic to come in on a link for a prefix (or the entire IP block), use Prepending feature to add AS Path length to your outbound advertisement, making this link the less preferred path for traffic to your IP block. Aka “padding”. 4xAS# is generally sufficient  Primary Path: Use standard advertisement (no prepending) for the link you prefer to use for inbound traffic to your company  Still have (pre-pended, valid) advertisement from backup path if primary path fails. – Example: set as-path prepend 130 130 130 (add to route-map and apply to neighbor statement to backup ISP) – Communities  Community = instructions from you to your ISP on how to tweak what you advertise  ISP will let you know definition of communities they honor  You will attach a community to a prefix that you are advertising to your ISP(s)  Consists of a series of numbers that correspond to handling instructions for that prefix (such as set local pref within provider’s AS)  Communities can also be used internally to identify routes. For example, you can assign all routes that came from ISP#1 with a community and routes that came from ISP#2 with a different community. That community identifier can then be used by your company to assign preferences to routes advertised internally via iBGP. For example, I want all traffic destined for YouTube’s /16 IP Block to use ISP#2, even though ISP#1 has a shorter AS-Path for the YouTube subnet (perhaps bandwidth is greater to ISP#2). So use the community to set a better metric on that route when it comes in from ISP#2. Remember, weight and local pref take precedence over AS-path length. – Prefix-splitting  ie /192x/20 subnets. Advertise one to each ISP, both also advertise complete /19 aggregate as a safety-net to cover failure of one ISP. Remember: most specific advertisement always wins!  Works best when you own your IP Space (splits still >=/24)  Use a BGP Looking Glass or Route Server to see how to get to your Corp AS’s prefixes
  • 24. Thank You! SDCUG Sept 10, 2014 Meredith Rose, CCIE#4617
  • 25. Redundant Internet Connections ISP#1 Router Copyright © SIGMAnet ® 2012. All rights reserved. Proprietary & Confidential. 25 InternetConnection#1 Corporate LAN Corp Router#1 ISP#1 Global Internet ISP#2 Router InternetConnection#2 Corp Router#2 ISP#2 eBGP eBGP iBGP L3 FHRP/OSPF/etc