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¶
-
Layer 2 Bonded mode - In Layer 2 Bonded mode, VLANs are assigned to the
bond0
interface. If you have more than one VLAN assigned tobond0
, then one of those VLANs can be set as the native VLAN. -
Hybrid Unbonded mode - In Hybrid Unbonded mode, VLANs can be assigned to the
eth1
interface or thebond0
interface, but onlyeth0
supports assigning a 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.
Native VLAN assignment is not supported in Hybrid Bonded mode.
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¶
VLANs can be managed from the server's Network tab, in the Layer 2 section. If you have this server attached to multiple VLANs, they will be listed here. You will then see the option Set Native VLAN.
Set a native VLAN with the metal port vlan
command. Specify the port ID that the VLAN is attached to with --port-id
and the VLAN to --native=
.
metal port vlans --port-id <port_uuid> --native=<vlan>
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 tab, in the Layer 2 section. You will then see the option to Unset Native VLAN.
If you want to unset a native VLAN in the CLI, use the metal port vlan
command and omit the --native=
flag.
metal port vlan --port-id <port_id> --assign <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