Skip to main content
Customize Q-in-Q
Last update:

Customize Q-in-Q

Q-in-Q is a technology that allows you to create multiple isolated network segments within a single VLAN. It is realized by adding an additional tag to the Ethernet packet header.

  1. Enable Q-in-Q on the switch port. To do this, create a ticket to technical support and specify the UUIDs of the servers for which you want to enable Q-in-Q. Q-in-Q can only be enabled for the private network.
  2. Select a new unoccupied private subnet, the IP addresses from which will be used to configure network connectivity.
  3. Configure network interfaces-on-server: assign a Q-in-Q tag to the network interface and specify an IP address from a new private subnet.

Configure network interfaces on the server

  1. Connect to the server via SSH or via KVM-console.

  2. Open the netplan utility configuration file with the vi text editor:

    vi /etc/netplan/01-netcfg.yaml
  3. Add Q-in-Q settings for the network interface of the private network:

    ...
    vlans:
    <eth_name>.<id>:
    id: <id>
    link: <eth_name>
    mtu: 1400
    addresses:
    - <ip_address>/<mask>

    Specify:

    • <eth_name> is the name of the network interface of the private network;
    • <id> — Q-in-Q tag, a number from 2 to 4094;
    • <ip_address>/<mask> — IP address from the new private subnet (for example: 10.10.10.10.10/24).
    Example configuration file of the netplan utility
    network:
    version: 2
    renderer: networkd
    ethernets:
    eth0:
    addresses: [82.202.247.218/24]
    gateway4: 82.202.247.1
    nameservers:
    addresses: [188.93.16.19,188.93.17.19]
    eth1:
    addresses: [192.168.0.2.2/24]
    ...
    vlans:
    eth1.40:
    id: 40
    link: eth1
    mtu: 1400
    addresses:
    - [10.0.0.0.15/24]
  4. Press the ESC key.

  5. Exit the vi text editor with your changes saved:

    :wq
  6. Apply the configuration:

    netplan apply
  7. Optional: reboot the server.