Back

Configuring tagged trunks

Please note that VLAN, VXLAN, and VLAN tagging are complex concepts. This article is not intended to be used as an introduction to those concepts.

The L2 segments service on the Servers.com platform allows for the creation of virtualized Layer 2 subnets or segments over an underlying Layer 3 network. From the technical standpoint, a single L2 segment is a set of VLANs interconnected using the VXLAN protocol. VLANs are provisioned per L2 segment per server rack.

Example 1: All member servers of the L2 segment are located in the same server rack.

A single VLAN is provisioned for the L2 segment.

Example 2: Member servers of the L2 segment are located in three different server racks.

A separate VLAN is provisioned for the L2 segment in each rack, totalling three VLANs. A VXLAN is configured to interconnect all three VLANs. Different VLAN IDs are mapped to the same VXLAN VNI.

VLANs and VXLANs are provisioned automatically after adding or removing servers to or from an L2 segment in the customer portal. The clients only need to configure IEEE 802.1Q tagging on their servers when using tagged trunk ('Trunk' ) links. Please see the sections below for details.

Types of links used to connect a server to an L2 segment

When you're connecting (adding) a server to the previously created L2 segment in the customer portal, you have to choose if you would like to connect the server using a 'Trunk' link or a 'Native' link. A single Ethernet interface can host a single native link (Ethernet frames are untagged) and multiple trunks (Ethernet frames are tagged) simultaneously.

The differences between the link types are shown in the table below:

Link type Description Requires OS configuration Number of VLANs per Ethernet interface
Native 'Native' link is used to transport data for a single VLAN. It does not require additional configuration on the server. A server may have only one native link per Ethernet interface. The network switch treats all untagged traffic on a native link as being tagged with the default VLAN ID. NO One
Trunk 'Trunk' is the type of link that may be used to transport data for multiple VLANs. Using a trunk link requires IEEE 802.1Q VLAN tagging to be configured in the server's operating system. A server may have multiple trunks per Ethernet interface. The network switch stripes the VLAN tag with the default VLAN ID from Ethernet frames before sending them via a native link. YES Multiple

Example 1: Four servers in the L2 segment. All with native links to the segment in the customer portal.

No additional configuration is needed on the servers. Servers can communicate on layer 2.

Example 2: Four servers in the L2 segment. First three with native links to the segment in the customer portal. The fourth server is connected with a trunk.

No additional configuration is needed on the first three servers. On the fourth, 802.1Q tagging has to be set up. Servers can communicate on layer 2.

Getting VLAN ID for a server

You will need to set up IEEE 802.1Q tagging in the server's operating system if you chose 'Trunk' while adding the server to an L2 segment in the customer portal. You will need the VLAN ID number to set up IEEE 802.1Q tagging. Please note that VLAN ID numbers for different servers in the same L2 segment may differ from rack to rack. That is why you should retrieve the VLAN ID for each server individually.

You can find the VLAN ID of a server in two places. On the server's details page:

Dedicated server details interface with VLAN configuration

On the L2 segment details page:

GNU GRUB bootloader with Ubuntu as default selection

On the screenshots above, the VLAN id of the omy-l2-1-20.08.2021 server in the L2-example-trunk segment is 2005.

Configuring tagged trunks using the ip utility

The ip utility comes with most of the Linux distributions. To enable 802.1Q tagging on the agge interface with VLAN ID 2005 and static IP address, run:

ip link add link aggi name vlan2005 type vlan id 2005
ip address add 172.16.0.1/16 dev vlan2005
ip link set vlan2005 up

Please note that this configuration will not persist a reboot.

Configuring tagged trunks using interface configuration files in CentOS

To create a subinterface with 802.1Q tagging enabled, VLAN ID 2005 and static IP address on the agge Ethernet interface:

1. Add a new configuration file. Please note that the fine name should be in accordance with Naming Scheme for VLAN Interfaces.

/etc/sysconfig/network-scripts/ifcfg-agge.2005

2. Edit the file to add the following configuration:

ONBOOT=yes
TYPE=Ethernet
VLAN=yes
DEVICE=agge.2005
BOOTPROTO=static
IPADDR=172.16.0.1
NETMASK=255.240.0.0

3. Restart the network service:

systemctl restart network

Configuring tagged trunks using interface configuration files in Ubuntu

To create a subinterface with 802.1Q tagging enabled, VLAN ID 2005 and static IP address on the agge Ethernet interface:

1. Install the vlan package:

apt update && apt install vlan

2. Add configuration to the /etc/network/interfaces file:

auto agge.2005
iface agge.2005 inet static
        address 172.16.0.1
        netmask 255.240.0.0
        vlan_raw_device agge

IP addressing

You can order IP aliases and additional IP networks for a server in the customer portal and use them within an L2 segment of your choice. But only on the condition that IP aliases and networks are ordered for a server that is connected to the chosen L2 segment via a 'Native' link. This is because IP aliases and additional IP networks provisioned by Servers.com are always configured for a default (ie 'Native') VLAN on the network switch port. And when a server is connected to an L2 segment via a 'Native' link, the default VLAN ID for that server is the VLAN ID of the L2 segment.

Additional IPs ordered for the server connected via a 'Native' link can be used by all other members of the L2 segment relying on the ARP protocol within the L2 segment.

Share

Suggested Articles