Setting a Native VLAN¶
The Equinix Metalâ„¢ native VLAN feature enables support for untagged packets when multiple VLANs are configured on the server port.
When multiple VLANs are configured on the server port, the native VLAN feature allows assigning one of the VLANs as native VLAN, so the packets destined for the native VLAN will always go out as untagged packets. Similarly, when the server port receives packets that are untagged, it will automatically be construed as belonging to native VLAN.
Support for Different Networking Modes¶
Native VLANs are supported on servers with the 2-port NIC, and only on unbonded interfaces. This means you can set a native VLAN when your servers are in Hybrid or Layer 2 Unbonded modes.
-
Hybrid Unbonded mode - In Hybrid Unbonded mode, VLANs can be assigned to only the
eth1
interface since it is outside of thebond0
interface. You can set any of the VLANs attached toeth1
as the native VLAN. -
Layer 2 Unbonded Mode - In the Layer-2 Unbonded mode, VLANs can be assigned to either of the interfaces, and each can have one of the VLANs set as the native VLAN.
Note: Assigning a native VLAN is not supported on the 4-port NIC servers. Support for this feature on 4-port NIC servers such as n2.xlarge.x86 is planned.
Setting a Native VLAN - Console¶
VLANs can be managed from the server's Network page, in the Layer 2 section. If you have this server attached to a VLAN or multiple VLANs, they will be listed here.
Click Manage next to the VLAN you would like to set as the native VLAN for this server. You will then see the option to Set Native VLAN.
Native VLAN API Endpoints¶
Native VLANs are mainly managed by /ports
endpoints, but there are many other endpoints that play supporting roles.
To list the VLANs in a project, send a GET
request to the /projects/{id}/virtual-networks
endpoint.
curl -X GET -H 'X-Auth-Token: <API_TOKEN>' https://api.equinix.com/metal/v1/projects/{id}/virtual-networks
The response will contain some handy information like the UUID and the vxlan ID of all the VLANS in a project, which are used in the requests to set or unset native VLANs.
To list the all ports on a server, send a GET
request to the /devices/{id} endpoint. In this context, filtering down the response to just the network_ports
array is useful.
curl -X GET -H 'X-Auth-Token: <API_TOKEN>' https://api.equinix.com/metal/v1/devices/{id} | jq '.network_ports'
The response will contain the UUID of all the ports on a server, which is used in the request to set and unset native VLANs.
To assign a native VLAN, send a POST
request to the /ports/{id}/native-vlan
endpoint. You have to specify the port ID the VLAN is attached to in the path, and it needs to be the UUID for that port as returned by the /devices/{id}
endpoint. The ID of the VLAN is sent in the body of the request, and it can be either the VLAN's UUID as returned by the /projects/{id}/virtual-networks
endpoint or the vxlan
ID that is in the console.
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN> " \
"https://api.equinix.com/metal/v1/ports/{id}/native-vlan" \
-d '{
"vnid": "c4032b18-5494-451b-a779-a7d3c536bfd7"
}'
Unsetting a Native VLAN¶
Similarly to setting a native VLAN, you can unset one from the console from the server's Network page, in the Layer 2 section.
Click Manage next to the VLAN you would like to unset as the native VLAN for this server. You will then see the option to Unset Native VLAN.
In the API, a DELETE
request to the /ports/{id}/native-vlan
endpoint will unset the native VLAN.
curl -X DELETE -H 'X-Auth-Token: <API_TOKEN>' https://api.equinix.com/metal/v1/ports/{id}/native-vlan