BGP on Equinix Metal¶
Equinix Metal™ supports Border Gateway Protocol (BGP) for advertising routes to your Equinix Metal servers. We support routing for advertising both IPv4 addresses and IPv6 addresses. This doc contains a high-level overview for how to use BGP on Equinix Metal.
Step 1. Enable BGP on the Project¶
The first step is to enable BGP on your Project, which enables BGP sessions and BGP session tracking. When you enable BGP on a project, you choose between using Local BGP and Global BGP.
Local BGP vs Global BGP¶
The top use case for using Local BGP is to perform failover or IP address mobility between a collection of servers. You choose one of the IP addresses available to your Equinix Metal project to announce from one of your servers using BGP. Detailed steps on how to set up and configure Local BGP is on the Using Local BGP page.
Global BGP is for advertising your own IP addresses from subnets that you own, for Bring Your Own IP address to Equinix Metal. This requires you to have a registered ASN and IP address space. Detailed steps on how to set up and configure Global BGP is on the BYOIP Using Global BGP page.
Note: if you want to BYOIP and also use Local BGP, choose to enable Global BGP. If you select Global BGP and use a public AS you can also use the BGP sessions to announce private IPs for internal clustering with Local BGP.
Step 2. Initiate a BGP Session¶
Creates BGP sessions for the hosts and upstream routers.
Routing Overview¶
Equinix Metal routers will learn the routes that you are advertising and appropriately send traffic to your servers.
Note that Equinix metal does not support advertising the full BGP table to customers, our routers do not export routes back to you. We only learn routes that you announce, and push those upstream.
BGP sessions are managed through the private IPv4 10.x.x.x
management network. It is a requirement for BGP that the network and it's assigned IP address exists on your server.
Peering is set up with two top-of-rack routers. For IPv4 peering the router IDs will be local 169.254.255.1/32
and 169.254.255.2/32
addresses. For IPv6 Peering the Router IDs will be fc00::e/128
and fc00::f/128
addresses. Since these are not directly connected to the host, you may need to configure BGP multihop back to the private IPv4 gateway address for your sessions.
Most importantly, all of the routing information you need that is specific to your server is available from your server's metadata endpoint after you have enabled BGP.
Step 3. Configure BGP on the Host¶
Configuring BGP on the host announces the IP addresses and establishes BGP routes.
To complete BGP setup, you need to first add the IP Address to your server's network interface and configure a BGP-speaking routing client on the server, such as BIRD, FRR, or ExaBGP. The routing client will control the IP address announcements in the BGP session to Equinix Metal's upstream routers.
Updating the Host Network Interface¶
Add the IP address that you are announcing to the loopback interface in /etc/network/interfaces
. The example address is 198.51.100.2
.
cat >>/etc/network/interfaces <<EOF
auto lo:0
iface lo:0 inet static
address 198.51.100.2
netmask 255.255.255.255
EOF
Then, bring up loopback interface.
ifup lo:0
BGP Metadata¶
The information that you need to configure BGP is available through Equinix Metal's metadata service once BGP has been enabled on both the Project and a BGP session has been started.
SSH into the server and curl
the metadata endpoint.
curl https://metadata.platformequinix.com/metadata | jq '.bgp_neighbors[0] | { customer_ip: .customer_ip, customer_as: .customer_as, multihop: .multihop, peer_ips: .peer_ips, peer_as: .peer_as }'
In response, you get an object with the BGP info specific to that server for a session to announce IPv4 addresses.
{
"customer_ip": "10.67.50.3",
"customer_as": 65000,
"multihop": true,
"peer_ips": [
"169.254.255.1",
"169.254.255.2"
],
"peer_as": 65530
}
You may also need a gateway IP address for a next hop or multihop configuration for the static routes.
curl https://metadata.platformequinix.com/metadata | jq -r '.network.addresses[] | select(.public == false and .address_family == 4) | { gateway: .gateway }'
In response, you get your server's private IPv4 gateway address.
{
"gateway": "10.67.50.2"
}
curl https://metadata.platformequinix.com/metadata | jq '.bgp_neighbors[1] | { customer_ip: .customer_ip, customer_as: .customer_as, multihop: .multihop, peer_ips: .peer_ips, peer_as: .peer_as }'
In response, you get an object with the BGP info specific to that server for a session to announce IPv6 addresses.
{
"customer_ip": "2001:DB8:1001:100::5",
"customer_as": 65000,
"multihop": true,
"peer_ips": [
"fc00:0000:0000:0000:0000:0000:0000:000e",
"fc00:0000:0000:0000:0000:0000:0000:000f"
],
"peer_as": 65530
}
You may also need a gateway IP address for a next hop or multihop configuration for the static routes.
curl https://metadata.platformequinix.com/metadata | jq -r '.network.addresses[] | select(.public == false and .address_family == 4) | { gateway: .gateway }'
In response, you get your server's private IPv4 gateway address.
{
"gateway": "10.67.50.2"
}
"customer_ip"
- The management private IPv4 address of the server."customer_as"
- The ASN of the session. If you are using Local BGP, the ASN will be the local-to-Equinix-Metal65000
. If you are using Global BGP, the ASN will be your ASN."multihop"
- If true, then you will need to include a multihop parameter along with static routing information in your BGP configuration."peer_ips"
- An array that contains the peering IP addresses of Equinix Metal's upstream routers, these are the neighbors."peer_as"
- The local ASN of the neighbor(s). On Equinix Metal, this will always be65530
. This AS is stripped on export to our global peering/transit providers."gateway"
- Optional information if you need to set up a static route to the upstream routers.
For some examples on how this metadata is used, see the Route BGP with BIRD and Route BGP with FRR.
BGP Prefix Limit¶
Equinix Metal enforces a prefix limit of 10 prefixes per neighbor.
If you exceed the limit you will need to open a support ticket (or email support@equinixmetal.com) to reset the BGP session. You may also reach out to support if you need this limit increased.