-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[MWAN/MT/CNI] BGP #18811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[MWAN/MT/CNI] BGP #18811
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
f0ecd4c
added bgp peering ingo
marciocloudflare 4308395
created bgp partial
marciocloudflare 52a7d4d
added vars
marciocloudflare c61d69a
corrected var
marciocloudflare f4870a4
added bgp mwan
marciocloudflare 313da89
corrected vars
marciocloudflare 0ad15ce
refined direct cni text
marciocloudflare aa83fb8
added link
marciocloudflare deaf0e1
corrected title
marciocloudflare f9f197d
corrected page order
marciocloudflare 56b4b36
corrected url code
marciocloudflare 470ace7
corrected var name
marciocloudflare 45b97b1
typo
marciocloudflare 092deae
changed from static routes to routes
marciocloudflare c2d7716
Merge branch 'production' into marcio/pcx11400-bgp
marciocloudflare 5820a84
refined language
marciocloudflare e9ec77d
updated config steps
marciocloudflare 3a65722
updated titles
marciocloudflare 0109d7b
refined text
marciocloudflare ad68573
refined language
marciocloudflare 7467144
added changelog
marciocloudflare bda1f3c
Merge branch 'production' into marcio/pcx11400-bgp
marciocloudflare d8d30da
added edits from steve
marciocloudflare df3d5bc
added legacy hc
marciocloudflare b980c2f
refined code
marciocloudflare 73edf14
Update src/content/partials/network-interconnect/bgp-peering.mdx
marciocloudflare efa136e
Apply suggestions from code review
marciocloudflare File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| pcx_content_type: how-to | ||
| title: Configure BGP peering | ||
| sidebar: | ||
| order: 4 | ||
| --- | ||
|
|
||
| import { Render } from "~/components" | ||
|
|
||
| <Render | ||
| file="bgp-peering" | ||
| product="network-interconnect" | ||
| params={{ | ||
| productName: "Magic Transit", | ||
| productPath: "/magic-transit/reference/tunnel-health-checks/", | ||
| legacyHCs: "/magic-transit/reference/tunnel-health-checks/#legacy-health-checks-system", | ||
| }} | ||
| /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| pcx_content_type: how-to | ||
| title: Run endpoint health checks | ||
| sidebar: | ||
| order: 4 | ||
| order: 5 | ||
|
|
||
| --- | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,7 @@ When working with Magic Transit and CNI, there are a few guidelines you should f | |||||
|
|
||||||
| With [Direct CNI](/network-interconnect/express-cni/) you can use the Cloudflare dashboard to provision a connection to Cloudflare in three minutes or less. This type of connection supports IP packets with 1,500 bytes, both for ingress and egress traffic. | ||||||
|
|
||||||
| For the time being, Direct CNI does not support BGP. If your use case calls for BGP anycast prefix withdrawal or BGP based connection failover, you need to use [Classic CNI](/network-interconnect/classic-cni/) with a Magic Transit GRE tunnel. | ||||||
| With Direct CNI you can also setup BGP peering between your network and Cloudflare. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might sound better?
Suggested change
|
||||||
|
|
||||||
| ### Classic CNI | ||||||
|
|
||||||
|
|
||||||
18 changes: 18 additions & 0 deletions
18
src/content/docs/magic-wan/configuration/manually/how-to/bgp-peering.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| pcx_content_type: how-to | ||
| title: Configure BGP peering | ||
| sidebar: | ||
| order: 3 | ||
| --- | ||
|
|
||
| import { Render } from "~/components" | ||
|
|
||
| <Render | ||
| file="bgp-peering" | ||
| product="network-interconnect" | ||
| params={{ | ||
| productName: "Magic WAN", | ||
| productPath: "/magic-wan/reference/tunnel-health-checks/", | ||
| legacyHCs: "/magic-wan/reference/tunnel-health-checks/#legacy-health-checks-system", | ||
| }} | ||
| /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,7 +18,7 @@ When working with Magic WAN and Cloudflare Network Interconnect (CNI), there are | |||||
|
|
||||||
| With [Direct CNI](/network-interconnect/express-cni/) you can use the Cloudflare dashboard to provision a connection to Cloudflare in three minutes or less. This type of connection supports IP packets with 1,500 bytes, both for ingress and egress traffic. | ||||||
|
|
||||||
| For the time being, Direct CNI does not support BGP. You need to create policy-based routes to ensure traffic is routed correctly. You also need to implement tracking of network traffic to ensure that the CNI and Cloudflare data center is functioning properly. | ||||||
| With Direct CNI you can also setup BGP peering between your network and Cloudflare. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above
Suggested change
|
||||||
|
|
||||||
| ### Bidirectional health checks | ||||||
|
|
||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| --- | ||
| params: | ||
| - productName | ||
| - productPath | ||
| - legacyHCs | ||
| --- | ||
|
|
||
| import { Markdown } from "~/components"; | ||
|
|
||
| {props.productName} customers can use the Cloudflare dashboard to configure and manage BGP peering between their networks and their Magic routing table when using a Direct CNI on-ramp. | ||
|
|
||
| Using BGP peering with a CNI allows customers to: | ||
| - Automate the process of adding or removing networks and subnets | ||
| - Take advantage of failure detection and session recovery features | ||
marciocloudflare marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| With this functionality, customers can: | ||
| - Establish an eBGP session between their devices and the {props.productName} service when connected via CNI | ||
| - Secure the session by MD5 authentication to prevent misconfigurations. | ||
| - Exchange routes dynamically between their devices and their Magic routing table. | ||
|
|
||
| ## Route distribution and convergence | ||
|
|
||
| Routes received from the customer device will be redistributed into the Magic routing table, which is used by both Magic WAN and Magic Transit. | ||
|
|
||
| All routes in the Magic routing table are advertised to BGP peers. Each BGP peer will receive each prefix route along with the full `AS_PATH`, with the selected Cloudflare side ASN prepended. This is so that the peer can accurately perform [loop prevention](https://datatracker.ietf.org/doc/html/rfc4271#section-9.1.2). | ||
|
|
||
| BGP peering sessions can advertise reachable prefixes to a peer and withdraw previously advertised prefixes. This should not take more than a few minutes to propagate. | ||
|
|
||
| ## Limitations | ||
|
|
||
| BGP multipath is supported. If the same prefix is learned on two different interconnects then traffic destined for that prefix will be distributed across each interconnect according to the usual ECMP behavior. | ||
|
|
||
| BGP support currently has the following limitations: | ||
| - The Cloudflare account ASN and the customer device ASN must be different. Only eBGP is supported. | ||
| - Routes are always injected with a priority of 100 | ||
| - Bidirectional Forwarding Detection (BFD) is not supported | ||
| - 4-byte ASNs are not supported | ||
marciocloudflare marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Tunnel health checks | ||
|
|
||
| You need to enable <a href={props.productPath}>tunnel health checks</a> alongside BGP. This is essential to determine if a specific Cloudflare datacenter is reachable from a customer router or not. Tunnel health checks will modify the route's priorities for dynamically learned BGP routes. | ||
|
|
||
| {props.productName} customers should configure legacy <a href={props.legacyHCs}>bidirectional health checks</a>. | ||
|
|
||
| ## How to choose an ASN for BGP peering | ||
|
|
||
| The Magic routing table is under the control of the customer, and the customer is able to choose both the Cloudflare side ASN and their customer device side ASN. | ||
|
|
||
| By default each BGP peering session will use the same Cloudflare side ASN to represent peering with the Magic WAN/Transit routing table. This default ASN is called the **CF Account ASN** and should be configured to a private 2-byte ASN (64512 and 65534). To set this ASN: | ||
|
|
||
| 1. Log in to the Cloudflare dashboard, and select your account. | ||
marciocloudflare marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 2. Go to Magic WAN / Transit > Configuration > BGP. | ||
marciocloudflare marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 3. In CF Account ASN, enter Cloudflare's ASN. | ||
|
|
||
| ### For Magic WAN customers | ||
| - The Cloudflare side ASN will be included in the `AS PATH` of announced routes to any BGP enabled interconnect. | ||
| - The customer device ASN can be chosen by the customer, and should be different to the Cloudflare side ASN. | ||
|
|
||
| ### For Magic Transit customers | ||
| - The Cloudflare side ASN will never be exposed in `AS PATH` of anycast announcements from the Cloudflare edge. In those announcements, Cloudflare will always use the Cloudflare ASN of `13335` optionally prepended with a bring-your-own ASN as described in [Cloudflare ASN vs. your own ASN](/magic-transit/how-to/advertise-prefixes/#cloudflare-asn-vs-your-own-asn) | ||
| - The customer device ASN can be a private ASN, or the ASN they are using for Magic Transit anycast announcements at the edge: this has no impact on the ASN for the Anycast announced prefix at the edge of the Cloudflare global network. | ||
marciocloudflare marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## How to set up BGP peering | ||
|
|
||
| :::caution | ||
| BGP peering is only available to {props.productName} customers with Direct CNI as an on-ramp. If your network is set up with GRE or IPsec tunnels, you cannot use BGP peering. | ||
| ::: | ||
|
|
||
| You need to configure two ASNs: | ||
| - The Cloudflare [account-scoped ASN](#how-to-choose-an-asn-for-bgp-peering). | ||
| - One ASN for each Interconnect you want to configure with BGP. | ||
|
|
||
| If you already have set up your Cloudflare account ASN, you can skip steps two and three below. | ||
|
|
||
| 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account. | ||
| 2. Go to **{props.productName}** > **Configuration** > **BGP**. | ||
| 3. In **CF Account ASN**, enter Cloudflare's ASN. | ||
| 4. Go to **Interconnects**. | ||
| 5. Find the Direct CNI interconnect you want to configure with BGP > select the **three dots** next to it > **Configure BGP**. | ||
| 6. In **Customer device ASN**, enter the ASN for your network. | ||
| 7. In **MD5 key**, you can optionally enter the key for your network. Note that this is meant to prevent accidental misconfigurations, and is not a security mechanism. | ||
| 8. (Optional) In **Advertised prefix list**, input the additional static prefixes automatically assigned by Cloudflare during the creation of the CNI interconnect, to advertise alongside your existing routes. Leave blank if you do not want to advertise extra routes. | ||
| 9. Select **Enable BGP**. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.