监控 BGP
在项目中启用 BGP 并启动会话后,项目的 BGP 页面和服务器的 BGP 页面都会显示有关活动会话和已学习路由的信息。
BGP项目现状
- Console
- CLI
- API
您的项目“网络”部分的“BGP”页面包含以下内容:
- 启用哪种类型的 BGP:本地还是全局。
- ASN:本地 BGP 为 65000,全局 BGP 为您自己的 ASN。
- MD5 密码(如果您设置了)。
- 包含项目中所有服务器的所有 BGP 会话的表。

该表格列出了每台服务器的会话详情,包括会话状态和上次更新时间。会话状态每六小时自动更新一次,但您也可以点击“立即更新”按钮手动更新所有会话的状态。
单击会话条目旁边的箭头,即可从服务器的 BGP 页面查看和管理 BGP 会话。
您可以通过 metal project bgp-config 命令获取项目的 BGP 配置。
metal project bgp-config -p <project_id>
您可以使用 metal project bgp-sessions 命令获取项目中所有服务器上的所有 BGP 会话列表。
metal project bgp-sessions -p <project_id>
在 API 中,通过向 /projects/{id}/bgp-config 端点发送 GET 请求来检索项目的 BGP 配置和会话信息。
curl -X GET -H "Content-Type: application/json" -H "X-Auth-Token: <API_TOKEN>" "https://api.equinix.com/metal/v1/projects/{id}/bgp-config"
如果您只想获取项目中的会话列表及其详细信息,请向 /projects/{id}/bgp/sessions 端点发送 GET 请求。
curl -X GET -H "Content-Type: application/json" -H "X-Auth-Token: <API_TOKEN>" "https://api.equinix.com/metal/v1/projects/{id}/bgp/sessions"
BGP 会话状态
- Console
- API
在服务器的“BGP”选项卡中,表格提供了此服务器上 IPv4 和 IPv6 会话的 BGP 会话信息,包括已学习路由列表、当前会话状态以及上次更新时间。状态每六小时自动更新一次,但您也可以单击“立即更新”按钮手动更新状态。

点击会话条目旁边的“管理”按钮,即可打开“激活 BGP”面板。使用切换开关可以启用或禁用此服务器上的 BGP 会话。使用“默认路由”切换开关可以将其设置为默认路由。

禁用 BGP 会话会删除已学习的路由并重置所有打开的连接。禁用会话前请务必谨慎。禁用 BGP 不会删除服务器上的任何 BGP 配置;如果需要,您可以重新启用会话,并在不更改服务器配置的情况下恢复发布路由。如果重新启用,会话可能需要 5-10 分钟才能建立。
要使服务器上的所有会话都运行,请向 /devices/{id}/bgp/sessions 端点发送 GET 请求。
curl -X GET -H "Content-Type: application/json" -H "X-Auth-Token: <API_TOKEN>" "https://api.equinix.com/metal/v1/devices/{id}/bgp/sessions"
要获取与特定 BGP 会话相关的信息,请向 /bgp/sessions/{id} 端点发送 GET 请求。
curl -X GET -H "Content-Type: application/json" -H "X-Auth-Token: <API_TOKEN>" "https://api.equinix.com/metal/v1/bgp/sessions/{id}"
要获取会话的邻居数据,请向 /devices/{id}/bgp/neighbors 端点发送 GET 请求。
curl -X GET -H "Content-Type: application/json" -H "X-Auth-Token: <API_TOKEN>" "https://api.equinix.com/metal/v1/devices/{id}/bgp/neighbors"
可能的会话状态
每个 BGP 会话都有可能的状态为 Disabled、Up、Down、Partial 或 Unknown。
Disabled- A disabled status will appear on the project's BGP page if you have enabled BGP on your project, but have not yet initiated a BGP session. For example, you may have a session that is announcing an IPv4 address but not a session to IPv6 address. The IPv4 session status isUpand the IPv6 session status isDisabled.Up- The BGP session is up. Equinix Metal routers are picking up the IP addresses you are announcing and learning the routes to your servers. In an Equinix IBX, this status also indicates that the BGP session is active on both routers.Down- The BGP session is down. Either you haven't set up the host configuration yet, or something in the configuration is not working. If you have checked your host configuration, try disabling and re-initiating the BGP session, wait the 5-10 minutes for the session to come up again. If the session is still down, please contact support.Partial- If your server is in an Equinix IBX and the BGP session is up on only one of the two routers, then the status will bePartial. It could indicate that there is maintenance on of the routers. The status should be temporary, but if it persists, please contact support.Unknown- A session will have an unknown status right after you have enabled it, while the session is still being established. It typically takes about 5-10 minutes for the status to update. If the status is unknown for longer, try clicking Update Now to manually update it.