VLANs
Hivelocity provides Layer 2 virtual networks to connect your servers and other infrastructure. Here are some things to know about our VLANs:
- VLANs are available in all Facilities.
- VLANs are a client account level entity.
- VLANs have no additional costs.
- The initial limit is 10 VLANs per client account across all facilities. The limit can be increased by contacting [email protected]
- Self-serve VLANs are local to a facility. Cross-facility VLANs can be requested by contacting [email protected]
Creating a VLAN
Via the Portal
In Development
This feature is not yet supported in the Portal. It is expected to become available late 2022.
You manage VLANs on the networking page. From the client account's Networks tab and click Layer 2. To provision a new VLAN, click Add VLAN.
Via the API
In Development
This feature is not yet supported in the API. It is expected to become available mid 2022.
Using a VLAN
Once created, you can add any of your device's ports or bonds into the VLAN. By default, any interface added into the VLAN will be added in trunked mode and tagged. This tag will need to be added to your server in order for it to communicate over the VLAN. You may specify a Native VLAN as described later on this page.
Adding a Port to a VLAN
In Development
This feature is not yet available. It is expected to become available mid 2022.
In general, you assign VLANs from the server's Network page in the portal. In the API, you assign ports as members of a VLAN by sending a PUT
to the /vlans/{VLAN_ID}
endpoint.
curl -X POST \
-H "Content-Type: application/json" \
-H 'X-API-KEY: <API_KEY>' \
-d '{ \
"port_ids": [PORT_ID],
}' \
https://core.hivelocity.net/api/v2/vlan/{VLAN_ID}
Adding a Bond to a VLAN
In Development
This feature is not yet available. It is expected to become available mid 2022.
In general, you assign VLANs from the server's Network page in the portal. In the API, you assign bonds as members of a VLAN by sending a PUT
to the /vlans/{VLAN_ID}
endpoint.
curl -X POST \
-H "Content-Type: application/json" \
-H 'X-API-KEY: <API_KEY>' \
-d '{ \
"bond_ids": [BOND_ID],
}' \
https://core.hivelocity.net/api/v2/vlan/{VLAN_ID}
Configuring a Port/Bond to Use a Tagged VLAN
Once your port/bond is in the VLAN you will need to modify the interface on your server in order to make used of the tagged VLAN.
AlmaLinux
Before doing any configuration, ensure 8021q module is loaded.
sudo modprobe --first-time 8021q
modinfo 8021q
In this example, weβll configure an enp6s0
interface on the server. You can target any interface, including any bonds.
$ ip link show dev enp6s0
2: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 38:90:a5:14:96:54 brd ff:ff:ff:ff:ff:ff
Make sure the NetworkManager service is running.
$ systemctl status NetworkManager
Now you can use nmcli
to create VLAN interface for enp6s0
. Get the VLAN Tag ID from the Hivelocity API of your targeted VLAN. In this example we will use the id 21
. Run the following command to create an 802.1Q VLAN interface on Ethernet interface enp6s0
:
$ nmcli con add type vlan con-name VLAN21 ifname VLAN21 dev enp6s0 id 21
If you have added IPs to a Routed VLAN Interface, you can then assign an IP address to the Ethernet's VLAN Interface:
$ nmcli connection modify VLAN21 ipv4.addresses 172.10.10.11/24 \
ipv4.method manual ipv4.gateway 172.10.10.1 \
ipv4.dns 172.10.10.1 +ipv4.dns 8.8.8.8
To check your work run:
$ nmcli connection show VLAN21
That's it! You have successfully configured VLAN tagging for your ethernet or bonded interface.
Ubuntu 20
To enable interface communication over a tagged VLAN open the Netplan configuration file:
sudo nano /etc/netplan/01-netcfg.yaml
Your netplan filename may be slightly different, but it will always be in the /etc/netplan
directory.
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: yes
Pick the interface you wish to use. Either your port or your bond. In this example we use the ens3
interface. Edit the netplan file as follows:
- Set the
set-name
field to a name of your choice - Create a
vlans
section and name your vlan. In this examplevlan15
- Set the
id
of the VLAN to the tag id returned in the VLAN api request to the Hivelocity API. - Set the
link
value to the name of used forset-name
of theens3
interface.
network:
version: 2
renderer: networkd
ethernets:
ens3:
set-name: mainif
vlans:
vlan15:
id: 15
link: mainif
Once done, save the file and apply the changes by running the following command:
sudo netplan apply
Thatβs it! You have assigned a static IP to your Ubuntu server. If you'd like to do something more complicated, netplan is well documented in the ubuntu docs.
Windows
To enable communication over tagged VLAN you must first put your target interface into a NIC Team. If you are targeting a bond you can skip this step, since your bond is already a NIC team.
In this example we are targeting interface Ethernet1
. Using powershell:
New-NetLbfoTeam -Name vTeam -TeamMembers "Ethernet1" -TeamingMode SwitchIndependent -LoadBalancingAlgorithm Dynamic
Next add the VLAN Tag ID returned by the Hivelocity API when you created the VLAN and add it to the NIC Team. In this example the tag id is 24
:
Add-NetLbfoTeamNic -Team vTeam -VlanID 24 -Name VLAN24
Thats it!
Adding IPs to a VLAN
A Routed VLAN interface with a public IP Subnet is a common setup for hypervisor-like environments, such as k8s deployments. See Routed VLAN Interfaces for instructions on how to make IP Subnets available to interfaces on your VLAN.
Managing VLANs
Via the Portal
You manage VLANs on the client account's Network page. From the Network page click VLANs. Each VLAN is listed with its ID, description, location, number of connections, and VLAN Tag.
In Development
This feature is not yet supported. It is expected late 2022.
If the VLAN is in use, you are able to see how many devices are connected to the VLAN in the Devices column, and clicking on the number will bring up a list of those devices.
Via the API
Make a GET
request to /vlan to get a list of all your active VLANs.
curl -X GET \
-H "Content-Type: application/json" \
-H 'X-API-KEY: <API_KEY>' \
https://core.hivelocity.net/api/v2/vlan
Deleting a VLAN
A VLAN cannot be deleted until all its assignments - bonds, ports, and IPs - are removed.
Via the Portal
From the Network tab and click VLANs. Click Delete next to the VLAN you are deleting.
In Development
This feature is not yet supported. It is expected late 2022.
Via the API
In Development
This feature is not yet supported. It is expected mid 2022.
Pass a DELETE
request to /vlans/{VLAN_ID}.
curl -X DELETE \
-H "Content-Type: application/json" \
-H 'X-API-KEY: <API_KEY>' \
https://core.hivelocity.net/api/v2/vlan
Setting a Native VLAN
The Hivelocity Bare Metal Cloud native VLAN feature enables support for untagged packets when multiple VLANs are configured on an interface. Packets destined for the native VLAN will always go out as untagged packets. When the interface receives packets that are untagged, it will automatically belong to the native VLAN.
Via the Portal
In Development
This feature is not yet supported. It is expected late 2022.
Via the API
In Development
This feature is not yet supported. It is expected mid 2022.
Setting MTU
In Development
This feature is not yet supported. It is expected late 2022.
Updated 15 days ago