使用 VRF 进行互连
Equinix Metal™ 虚拟路由和转发 (VRF) 为 Metal Gateway 二层专用网络与 Fabric 或 Equinix IBX 上的远程目标之间的三层网络连接提供虚拟路由器。VRF 支持 Metal-billed Fabric VC、Fabric-billed Fabric VC 和 Dedicated Ports。
要将 VRF 与互连一起使用,您首先需要按照 VRF 文档 中的说明配置 VRF、金属网关和 IP 预留。
使用 VRF 请求 Fabric VC
要将 VRF 与 Fabric VC 配合使用,您必须在创建 VRF 之后再请求 Fabric VC。您不能将 VRF 与现有的 Fabric VC 关联。
申请 Metal-billed 或 Fabric-billed Fabric VC 的过程与申请非 VRF Fabric VC 的过程类似。
- Console
- API
要申请 Fabric 虚拟连接,请打开项目的“互连”页面。单击“+ 申请新互连”。在“互连类型”部分,单击“Fabric VC”下的下拉菜单,然后选择“金属计费”或“Fabric 计费”。

- 从下拉菜单中选择新连接的位置。您需要选择Equinix Metal基础设施所在的城市,以及您在 Fabric 上连接的 CSP 所在的城市:这些互连都受限于城市。
- 为您的连接命名。
- 选择是否需要一组冗余端口。强烈建议使用冗余端口。选择单个端口可能会因计划内和计划外中断而导致长时间停机。
- 从下拉菜单中选择连接速度进行设置。注意:服务令牌签发后,速度将无法更改。更改速度需要新的请求和服务令牌。
接下来,选择VRF将虚拟路由器与Fabric VC关联。如果选择冗余端口,则会有一个下拉菜单,用于选择主端口和辅助端口的虚拟路由器。

请查看您的请求摘要。点击提交请求以获取您的服务令牌。然后,您需要在 Fabric 门户中完成服务令牌兑换和连接设置流程。
Fabric 和 Equinix Metal 之间的互连建立后,它将出现在您项目的“互连”页面的“Fabric VC”部分。点击 Fabric VC 可查看其“概览”页面,其中包含详细信息以及主端口和辅助端口配置的摘要。
点击“主端口”或“辅助端口”即可查看端口的状态和配置。您的 VRF 会列在端口页面的“虚拟电路 - VRF”部分,状态显示为“等待对等连接详情”。

点击三横线菜单打开“管理对等连接详细信息”窗格。您可以在此处指定 VRF IP 地址范围内的子网,该子网将用于寻址 VRF 和虚拟电路的远端。系统将自动为此子网创建 IP 地址预留。

在字段中填写所需信息。
- 对等 ASN(必填) - 将与 VRF 和虚拟电路连接的远程端一起使用的 ASN。
- 子网(必填)
- 对于 IPv4 子网,
/30或/31子网来自用于寻址 VRF 和虚拟电路远端的 VRF IP 地址块之一。Metal IP 和 Customer IP 是此子网中的 IP 地址,您可以选择性地指定它们。如果未指定,则 Metal IP_ 为子网中最后一个可用的 IP 地址,Customer IP_ 为子网中第一个可用的 IP 地址。对于/30子网,网络 IP 地址和广播 IP 地址不能用作 Metal IP 或 Customer IP。 - 对于 IPv6 子网,
/126或/127子网来自用于寻址 VRF 和虚拟电路远端的 VRF IP 地址块之一。Metal IP 和 Customer IP 是此子网中的 IP 地址,您可以选择性地指定它们。如果未指定,则 Metal IP_ 为子网中最后一个可用的 IP 地址,Customer IP_ 为子网中第一个可用的 IP 地址。对于/126子网,网络 IP 地址和广播 IP 地址不能用作 Metal IP 或 Customer IP。
- 对于 IPv4 子网,
- MD5 密码(可选) - 以明文形式设置 BGP 对等体的可选字符串 MD5 密码。
点击更新虚拟电路。
如果有冗余端口,请在辅助端口上重复此过程。
向 /projects/{project_id}/connections 端点发送 POST 请求,并使用 "vrfs" 对象指定 VRF(或冗余 VC 的 VRF)。
请记住,Fabric VC 必须与 VRF 位于同一 Metro 中。
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/projects/{project_id}/connections" \
-d '{
"name": "<string>",
"description": "<string>",
"contact_email": "<string>",
"metro": "<metro_slug>",
"type": "shared",
"service_token_type": "<string>",
"redundancy": "redundant",
"speed": "<string>",
"vrfs": ["<UUID>", "<UUID>"]
}'
VRF 需要注意的车身参数:
"vrfs"(required) - Array of VRF IDs that will be set automatically on the virtual circuits on creation, and can hold up to two UUIDs. Two IDs are required when requesting redundant Fabric VCs. The first ID will be set on the primary virtual circuit, while the second UUID will be set on the secondary. The two IDs can be the same if both the primary and secondary virtual circuits will be in the same VRF.
然后,您应该完成兑换服务令牌和在 Fabric 门户中设置连接的过程。
当您的 Fabric VC 显示为 Active 且 等待对等连接详细信息 时,您可以使用 VRF 的对等连接详细信息对其进行更新。向 /virtual-circuits/{vrf_virtual_circuit_id} 端点发送 PUT 请求。
您可以在此处从 VRF IP 地址范围中指定一个子网,该子网将用于寻址 VRF 和虚拟电路的远端。系统将自动为该子网创建 IP 地址预留。
如果您使用的是 IPv4 子网,请使用 "subnet"、"metal_ip" 和 "customer_ip" 主体参数。
curl -X PUT \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/virtual-circuits/{vrf_virtual_circuit_id}" \
-d '{
"peer_asn": <integer>,
"subnet": "<subnet>",
"metal_ip": "<ip_address>",
"customer_ip": "<ip_address>”,
"md5": "<string>"
}'
身体参数:
"peer_asn"- The peer ASN that will be used with the VRF on the Virtual Circuit."subnet"- The/30or/31subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit. Themetal_ipandcustomer_ipmust be IP addresses from this subnet. For/30subnets, the network and broadcast IP addresses cannot be used as themetal_iporcustomer_ip."customer_ip"(optional) - An IP address from the subnet that will be used on the remote side of the connection. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as themetal_ip. By default, the last usable IP address in the subnet will be used."metal_ip"(optional) - An IP address from the subnet that will be used for the VRF on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as thecustomer_ip. By default, the first usable IP address in the subnet will be used."md5"- Optional string or null MD5 password for the BGP peering in plaintext.
如果您使用的是 IPv6 子网,请使用 "subnet_ipv6"、"metal_ipv6" 和 "customer_ipv6" 主体参数。
curl -X PUT \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/virtual-circuits/{vrf_virtual_circuit_id}" \
-d '{
"peer_asn": <integer>,
"subnet_ipv6": "<subnet>",
"metal_ipv6": "<ip_address>",
"customer_ipv6": "<ip_address>”,
"md5": "<string>"
}'
身体参数:
"peer_asn"- The peer ASN that will be used with the VRF on the Virtual Circuit."subnet"- The/126or/127IPv6 subnet from a VRF IP Block that will be used with the VRF for the Virtual Circuit. Themetal_ipv6andcustomer_ipv6must be IP addresses from this subnet. For/126subnets, the network and broadcast IP addresses cannot be used as themetal_ipv6orcustomer_ipv6."customer_ipv6"(optional) - An IP address from the subnet that will be used on the remote side of the connection. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as themetal_ipv6. By default, the last usable IP address in the subnet will be used."metal_ipv6"(optional) - An IP address from the subnet that will be used for the VRF on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as thecustomer_ipv6. By default, the first usable IP address in the subnet will be used."md5"- Optional string or null MD5 password for the BGP peering in plaintext.
虚拟电路可更新组件的完整列表可在API 参考中找到。
要检查 Fabric VC 的状态和对等详细信息,请向 /connections/{id} 端点发送 GET 请求。
curl -X GET -H 'X-Auth-Token: <API_TOKEN>' https://api.equinix.com/metal/v1/connections/{id}
使用带有专用端口的 VRF
注意:VRF 与专用隧道模式不兼容。
VRF 可用于新建和现有的专用端口。因此,如果您还没有申请专用端口,可以申请新的专用端口,获取 LOA,并在确认端口设置工单已完成后,即可使用 VRF 创建虚拟电路。
如果您已经有专用端口,则可以使用 VRF 在现有专用端口上创建新的虚拟电路。
- Console
- API
点击专用端口将进入其“概览”页面,其中包含主端口和辅助端口配置的详细信息和摘要。点击“主端口”和“辅助端口”选项卡,即可查看端口的详细信息。

在“主端口”选项卡中,单击“+添加虚拟电路”以创建虚拟电路,并将您的 VRF 连接到该虚拟电路。在“添加虚拟电路”窗格中,首先为其命名,然后指定 NNI VLAN ID。请记住,如果您要连接到 Fabric 上的目标,则 NNI VLAN 必须与 Fabric 侧的 VLAN 匹配。
接下来,选择VRF。

从下拉菜单中选择要连接到此虚拟连接的 VRF,并填写所需的对等信息。
- 对等 ASN(必填) - 将与 VRF 和虚拟电路连接的远程端一起使用的 ASN。
- 子网(必填)
- 对于 IPv4 子网,
/30或/31子网来自用于寻址 VRF 和虚拟电路远端的 VRF IP 地址块之一。Metal IP 和 Customer IP 是此子网中的 IP 地址,您可以选择性地指定它们。如果未指定,则 Metal IP_ 为子网中最后一个可用的 IP 地址,Customer IP_ 为子网中第一个可用的 IP 地址。对于/30子网,网络 IP 地址和广播 IP 地址不能用作 Metal IP 或 Customer IP。 - 对于 IPv6 子网,
/126或/127子网来自用于寻址 VRF 和虚拟电路远端的 VRF IP 地址块之一。Metal IP 和 Customer IP 是此子网中的 IP 地址,您可以选择性地指定它们。如果未指定,则 Metal IP_ 为子网中最后一个可用的 IP 地址,Customer IP_ 为子网中第一个可用的 IP 地址。对于/126子网,网络 IP 地址和广播 IP 地址不能用作 Metal IP 或 Customer IP。
- 对于 IPv4 子网,
- MD5 密码(可选) - 以明文形式设置 BGP 对等体的可选字符串 MD5 密码。
点击添加虚拟电路。
如果有冗余端口,请在辅助端口上重复此过程。
要使用 VRF 创建新的虚拟电路,请向 /connections/{connection_id}/ports/{port_id}/virtual-circuits 端点发送 POST 请求,并在请求正文中指定 VRF。
您可以在此处指定对等连接信息——VRF IP 地址范围中的子网,该子网将用于寻址 VRF 和虚拟电路的远端。此子网的 IP 地址预留将自动创建。
如果您使用的是 IPv4 子网,请使用 "subnet"、"metal_ip" 和 "customer_ip" 参数。
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/connections/{connection_id}/ports/{port_id}/virtual-circuits" \
-d '{
"project_id": "<UUID>",
"name": "<string>",
"description": "<string>",
"subnet": "<subnet>",
"customer_ip": "<ip_address>",
"metal_ip": "<ip_address>",
"nni_vlan": <integer>,
"peer_asn": <integer>,
"md5": "<string>",
"vrf": "<UUID>"
}'
身体参数:
"project_id"(required) - The Project ID where the Dedicated Port and this Virtual Circuit lives."name"- A name for this Virtual Circuit."description"- An optional friendly description of the Virtual Circuit."subnet"(required) - A/30or/31subnet from a VRF IP address range that will be used with the VRF for the Virtual Circuit. If specified,metal_ipandcustomer_ipmust be from this subnet. For/30subnets, the network and broadcast IPs cannot be used as themetal_iporcustomer_ip. The subnet specified must be contained within an already-defined IP Range for the VRF."customer_ip"(optional) - An IP address from the subnet that will be used on the remote side of the connection. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Metal IP. By default, the last usable IP address in the subnet will be used."metal_ip"(optional) - An IP address from the subnet that will be used for the VRF on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as the Customer IP. By default, the first usable IP address in the subnet will be used."nni_vlan"(required) - [ 2 .. 4094 ]. Remember if you are connecting to a destination on Fabric the NNI VLAN has to match the Fabric side."peer_asn"(required) - integer - The peer ASN that will be used with the VRF on the Virtual Circuit."md5"- Optional string or null MD5 password for the BGP peering in plaintext."vrf"(required) - The UUID of the VRF that will be associated with the Virtual Circuit.
如果您使用的是 IPv6 子网,请使用 "subnet_ipv6"、"metal_ipv6" 和 "customer_ipv6" 参数。
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/connections/{connection_id}/ports/{port_id}/virtual-circuits" \
-d '{
"project_id": "<UUID>",
"name": "<string>",
"description": "<string>",
"subnet_ipv6": "<subnet>",
"customer_ipv6": "<ip_address>",
"metal_ipv6": "<ip_address>",
"nni_vlan": <integer>,
"peer_asn": <integer>,
"md5": "<string>",
"vrf": "<UUID>"
}'
身体参数:
"project_id"(required) - The Project ID where the Dedicated Port and this Virtual Circuit lives."name"- A name for this Virtual Circuit."description"- An optional friendly description of the Virtual Circuit."subnet"- The/126or/127IPv6 subnet from a VRF IP Block that will be used with the VRF for the Virtual Circuit. Themetal_ipv6andcustomer_ipv6must be IP addresses from this subnet. For/126subnets, the network and broadcast IP addresses cannot be used as themetal_ipv6orcustomer_ipv6."customer_ipv6"(optional) - An IP address from the subnet that will be used on the remote side of the connection. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as themetal_ipv6. By default, the last usable IP address in the subnet will be used."metal_ipv6"(optional) - An IP address from the subnet that will be used for the VRF on the Metal side. This parameter is optional, but if supplied, we will use the other usable IP address in the subnet as thecustomer_ipv6. By default, the first usable IP address in the subnet will be used."nni_vlan"(required) - [ 2 .. 4094 ]. Remember if you are connecting to a destination on Fabric the NNI VLAN has to match the Fabric side."peer_asn"(required) - integer - The peer ASN that will be used with the VRF on the Virtual Circuit."md5"- Optional string or null MD5 password for the BGP peering in plaintext."vrf"(required) - The UUID of the VRF that will be associated with the Virtual Circuit.
虚拟电路的组件完整列表可在API 参考中找到。
与创建与 VRF 不关联的虚拟电路不同,您不必返回将虚拟网络关联到虚拟电路;连接到 VRF 的Metal Gateway 的网络将自动关联。
虚拟电路配置完成后,虚拟电路的状态变为 Active。
管理互连上的 VRF
- Console
- API
您可以在 Fabric VC 或专用端口 VC 的“主端口”或“辅助端口”选项卡中管理 VRF 的对等连接详细信息。VRF 列在“虚拟电路 - VRF”部分。单击三横线菜单打开“管理对等连接详细信息”窗格。

填写新的对等互联信息,然后单击更新虚拟电路。
要更新 Fabric VC 或专用端口 VC 上 VRF 的对等连接详细信息,请向 /virtual-circuits/{id} 端点发送 PUT 请求。在请求正文中使用要更新的字段。所有字段均为可选字段,因此可以单独更新。
curl -X PUT \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/virtual-circuits/{id}" \
-d '{
"name": "<string>",
"description": "<string>",
"subnet": "<subnet>",
"customer_ip": "<ip_address>",
"metal_ip": "<ip_address>",
"peer_asn": <integer>,
"md5": "<string>"
}'