Configuring Local BGP¶
Equinix Metal™ supports Local BGP for advertising routes to your Equinix Metal servers in a local environment. Local BGP uses an internal Autonomous System Number (ASN) to control routes within an Equinix Metal data center. If you are interested in bringing-your-own-IP addresses using your own ASN, see the BYOIP with Global BGP page.
IP Addresses for Local BGP¶
Your Project IP Addresses are listed on the IPs page from the Project's IPs & Networks tab. You can announce private IPv4 addresses, Elastic IPv4 addresses, Global Anycast IP addresses, and IPv6 addresses using Local BGP.
For private IPv4 addresses and IPv6 addresses, you can use any IP address from a Management block that is in the same Metro as the server you want to announce it from. For elastic IPv4 addresses, you can use any IP address that is in the same metro as the server. Global Anycast addresses are not limited to a Metro.
Click Update Block to see the details of the IP address block, including any subnets from that block that are currently statically assigned to servers in the project. Be sure to choose addresses that are not already in the used subnets.
Please keep in mind that:
-
For any of the IP addresses that you plan to announce with BGP, do not also assign them to a server in the Equinix Metal console. Assigning them in the console will create a static route, causing issues with the BGP setup.
-
Metal Gateways and private IPv4 address blocks provisioned with Metal Gateways are not compatible with BGP.
Enabling BGP on the Project¶
The first step to setting up Local BGP is to enable it on the Project.
In the console, navigate to the Projects Networks section and select BGP. Click Activate BGP, which brings up the Activate BGP pane.
Select Local BGP. The field for ASN is automatically set to 65000
. If you want to enable and require authentication between neighbors, enter a password in the MD5 Password field.
The Use Case field is not required for enabling Local BGP.
You can enable BGP on a Project in the CLI with the metal project bgp-enable
command.
metal project bgp-enable --project-id <project_id> --deployment-type local --asn 65000
Options:
--deployment_type
(required) - Uselocal
to enable Local BGP,--asn
(required) - When using Local BGP on Equinix Metal the ASN is always65000
.
In the API, send a POST
request to the /projects/{id}/bgp-configs
endpoint. The project ID that you want BGP enabled on is specified in the path.
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN> " \
"https://api.equinix.com/metal/v1/projects/{id}/bgp-configs" \
-d '{
"deployment_type": "local",
"asn": 65000,
"md5": "string",
"use_case": "string"
}'
Body Parameters:
"deployment_type"
(required) - The options are"local"
or"global"
. For enabling Local BGP, use"local"
."asn"
(required) - The local ASN; when using Local BGP on Equinix Metal the ASN is always65000
."md5"
(optional) - If you want to enable and require authentication between neighbors, enter a password. If omitted no password verification will be required."use_case"
(optional) - A use case description is not required for Local BGP.
Creating Local BGP Sessions¶
The second step to setting up BGP is to create BGP sessions on the Server.
After enabling Local BGP for your Project, the server's BGP page will have options for managing and tracking Local BGP sessions for both IPv4 and IPv6 addresses.
Click Manage to open the Activate BGP panel. To enable BGP and initiate a BGP session, toggle Enable BGP. Use the Default Route toggle to set this as the default route. Note: the Default Route toggle may not appear until after enabling the BGP session.
In the API, send a POST
request to the /devices/{id}/bgp/sessions endpoint. The server ID is specified in the path.
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN> " \
"https://api.equinix.com/metal/v1/devices/{id}/bgp/sessions" \
-d '{
"address_family": "string",
"default_route": "boolean"
}'
Body Parameters:
"address_family"
(required) - Your options are either"ipv4"
or"ipv6"
indicating whether the BGP session will be announcing IPv4 or IPv6 addresses."default_route"
(optional) - Sets the default route status. Defaults tofalse
if omitted.
Local BGP Session Host Configuration¶
Once you have enabled BGP on both the project and your server on Equinix Metal, the final step is to configure your server's operating system to use BGP sessions, announce the IP addresses, and advertise routes.
You will need to install and configure a a BGP-speaking routing client on the server, such as BIRD, FRR, or ExaBGP. All the information that you need to configure your routing client is available from your server's metadata endpoint after you have enabled BGP.
A quick overview is available on the BGP on Equinix Metal page. Some example routing client configurations are on the Route BGP with BIRD and Route BGP with FRR pages.
Disabling Local BGP¶
You can disable a BGP session on Equinix Metal to stop announcing the IP address and publishing your routes. This will remove learned routes, reset any open connections, and is potentially a disruptive action. Use care before disabling the session.
Disabling BGP does not remove any of the BGP configuration on the server; if you need to, you can re-enable the session, and go back to publishing routes without changing the server's configuration. If you do re-enable, it may take 5-10 minutes for the session to be established.
On the server's BGP page, click the arrow to bring up the options for which BGP session you would like to disable. In the Activate BGP pane, use the toggle disable BGP.
To disable a Local BGP session in the API, send a DELETE
request to the /bgp/sessions/{id} endpoint.
curl -X DELETE -H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/bgp/sessions/{id}"