leaseweb knowledge base logo - white color on the orange background

How to configure Multiple VLANs (QinQ) in Private Network

How to configure Multiple VLANs (QinQ) in Private Network

Description

How to activate the Multiple VLAN’s feature in the Private Network by configuring QinQ in your operating system

Visit the Private Network page to learn more about the Multiple VLAN’s feature.

Information

Pour la version française, cliquez ici

Contents

Operating systems support matrix

Operating System Version Style Supports QinQ
Alma Linux 8 /etc/sysconfig/network-scripts/ifcfg-* Yes
CentOS 7 /etc/sysconfig/network-scripts/ifcfg-* Yes
Rocky Linux 8 /etc/sysconfig/network-scripts/ifcfg-* Yes
Debian 9-11 /etc/network/interfaces Yes
FreeBSD 12-13 /etc/rc.conf Yes
Ubuntu 18 – 22 /etc/netplan/01-netcfg.yaml Yes

Windows Server

2012 – 2022 Windows style Yes

ESXi

6.5 – 7.0 ESXI style Yes
ESXi 6.0 ESXI style No
Rescue mode (GRML and Centos) Using ip command line tool Yes
Rescue mode (FreeBSD) Using ifconfig command line tool Yes

Ubuntu

Configuration

Step1: Edit Netplan and add the following configuration for your QinQ VLAN. In our case it’s VLAN 100.

vi /etc/netplan/01-netcfg.yaml
vlans:
 vlan.100:
   id: 100
   link: eno2
   addresses: [192.168.1.100/24]

61472770

Run “netplan apply” command to apply the config changes. If necessary reboot the server

netplan apply

61472771

Important: To confirm that the QinQ VLAN works across the private network, you need to configure another server and do a simple ping test to verify.

Removal

Step 1: Remove the existing persistent configuration from Netplan

vi /etc/netplan/01-netcfg.yaml
vlans:
 vlan.100:
   id: 100
   link: eno2
   addresses: [192.168.1.100/24]

Step 2: Apply the config. If necessary reboot the server

netplan apply

Debian

Configuration

Step 1: Install the VLAN package

sudo apt update && sudo apt install vlan

Important: Only for Debian 9

modprobe 8021q

Step 2: Edit the interfaces file and add the following configuration for your QinQ VLAN. In our case it’s VLAN 100.

vi /etc/network/interfaces
auto vlan100
iface vlan100 inet static
       address 192.168.1.100/24
       vlan-raw-device eno2

Step 3: Save and apply the config by bringing the QinQ interface online using the ifup/ifdown command or by restaring the system Network service

ifup vlan100

61472772

Important: To confirm that the QinQ VLAN works across the private network, you need to configure another server and do a simple ping test to verify.

Removal

Step 1: Remove the existing persistent configuration from the “interfaces” file

Step 2: Apply and restart the Networking service if necessary

ifdown vlan100

CentOS / RockyLinux / AlmaLinux

Configuration

Step 1: Disable the NetworkManager service

Check the status of the NetworkManager.

sudo systemctl status NetworkManager

If NetworkManager is not running and you see Active: inactive (dead) you can proceed with step 2

If the NetworkManager service is active, it needs to be disabled

sudo systemctl stop NetworkManager

Step 2: Load kernel module

Check if kernel module 8021q is loaded.

sudo lsmod | grep 8021q

If it’s loaded, you will see an output similar to this:

61472773

If you do not, then it means that the module is not loaded. Load the kernel module.

sudo modprobe 8021q

To ensure that the kernel module 8021q is loaded during boot, we have to add the module into the modules configuration file.

sudo su -c 'echo "8021q" >> /etc/modules'

Step 3: Create a VLAN

Create a new configuration file for your QinQ VLAN. In our case it’s VLAN 100.

vi /etc/sysconfig/network-scripts/ifcfg-vlan100

Config:

DEVICE=vlan100
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.100
PREFIX=24
PHYSDEV=eno2
VLAN=yes

Step 4: Restart the NetworkManager service so the interface is created and in ‘up’ state

systemctl status NetworkManager

The alternative is to use the ifdown or ifup commands

ifdown vlan100
ifup vlan100

61472774

Important: To confirm that the QinQ VLAN works across the private network, you need to configure another server and do a simple ping test to verify.

Removal

Remove the existing persistent configuration by reversing the steps from the Configuration part.

FreeBSD

Configuration

Edit the rc.conf file and add the following persistent configuration for your QinQ VLAN. In our case it’s VLAN 100.

vi /etc/rc.conf
vlans_bge1="100"
ifconfig_bge1_100="inet 192.168.1.100/24"

With the  “ifconfig” command you should see an ouput similar to this to confirm the creation of the interface:

61472775

Important: To confirm that the QinQ VLAN works across the private network, you need to configure another server and do a simple ping test to verify.

Removal

Remove the existing persistent configuration by reversing the steps from the Configuration part.

Windows

Configuration

Step 1: Check before creating VLAN

Go to “Control Panel\Network and Internet\Network Connections” and right-click on “Embedded LOM 1 Port 2”.

61472776

Select “Properties“, then click “Configure” button and select “Advanced” tab.

Make sure that no VLAN ID is set in the network adapter advanced settings (VLAN ID value= 0).
61472777

Step 2:  Create NIC Teaming

Go to StartServer Manager → Select Local Server tab and enable the NIC Teaming by clicking on the link.

61472778

After enabling you get a “NIC Teaming” window. Under Teams section click Task →  New Team.

61472779

Specify the Team name (VLAN ID) as “100” – This is your QinQ VLAN Id and select Member adapters as “Embedded LOM 1 Port 2″.

61472780

Step 3: Create an interface

In the “Adapter and Interfaces” section add virtual network interfaces. Click Tasks -> Add Interface

61472781

You need to create 2 interfaces to make sure it’s hybrid (one with Default VLAN for the Private Network overall traffic and another with 100, for the QInQ VLAN).

  • Default  VLAN (Private Network)

Add an interface with “VLAN 100” and select Default as VLAN Membership.

61472782

  • QinQ VLAN

Click on the Add Interface again with Specific VLAN number.

61472783

After configuring you will see 2 new network connections under  “Control Panel\Network and Internet\Network Connections”:

61472785

Step 4: Assigning IP Address

Go to “Control Panel\Network and Internet\Network Connections”.

Right-click on the newly created connection “VLAN 100” and Select Properties. Afterwards select Internet Protocol Version 4 (TCP/IPv4) and click the Properties button.

61472787

Make sure “Obtain IP address automatically” is selected.

61472788

Right-click on the another newly created connection “VLAN100 – VLAN 100” and select Properties. Afterwards, select Internet Protocol Version 4 (TCP/IPv4) and click the Properties button.

Assign 192.168.1.100/24

Subnet Mask: 255.255.255.0

61472789

Important: To confirm that the QinQ VLAN works across the private network, you need to configure another server and do a simple ping test to verify.

An example, where we had another servers configured with 192.168.1.1 to verify that connectivity works.

61472790

Removal

Step 1: Delete Interfaces

In the “Adapter and Interfaces” section, select the two virtual network interfaces created for QinQ (one with Default Vlan & another with VLAN 100) and delete them.

Step 2: Disable Teaming

Go to Start → Server Manager → Select “Local Server” tab and Disable the NIC Teaming by clicking on the link “Enabled”.

61472791

VMware ESXi

Configuration

  • Virtual switch has to be created on the ESXi. In our case we’ve named it “Internal” followed by two port groups:
    1. Port group Internal access for untagged Private Network traffic
    2. Port group Internal VLAN 100 for the tagged QinQ VLAN 100 traffic

61472792

61472793

61472794

61472795

61472796

  • Once we have the vSwitch and port-groups set, now we have to attach a NIC to the port-groups.
    • For this example, we’ve created a virtual machine that will have hybrid access to the Private Network by adding two Network Adapters to it.
      • Untagged Private Network
      • Tagged QinQ

61472797

Important: To confirm that the QinQ VLAN works across the private network, you need to configure another server and do a simple ping test to verify.

An example, where we had another server configured with 192.168.1.1 to verify that QinQ connectivity works.

61472798

Removal

Step 1: Delete Virtual switches if necessary

Go to “Host” -> “Networking” & select “Virtual switches” tab. From there, Delete the pre-created virtual switch “Internal”.

Step 2: Delete the Port groups

Go to “Host” -> “Networking” & select “Port groups” tab. From there, Delete the pre-created Port group “Internal Vlan 100” that relates to the QinQ VLAN.

Leaseweb Rescue Mode (GRML)

Configuration

An example how to create QinQ VLAN interface using the “ifconfig” command

ip link add link eno2 name eno2.100 type vlan id 100
ip addr add 192.168.1.100/24 dev eno2.100
ip link set dev eno2.100 up

Removal

To remove VLAN 100 from the eno2 interface execute the following IP command.

ip link delete eno2.100

Leaseweb Rescue Mode (FreeBSD)

Configuration

An example how to create QinQ VLAN interface using the “ifconfig” command

ifconfig bge1.100 create vlan 100 vlandev bge1 inet 192.168.1.100/24
ifconfig vlan100 create
ifconfig vlan100 name bge1.100
ifconfig bge1.100 vlan 100 vlandev bge1 
ifconfig bge1.100 inet 192.168.1.100/24

Removal

To remove a VLAN interface execute the following command.

ifconfig {vlan-name} destroy

Troubleshooting

First and foremost, you need to have more than one servers configured with the same tagged QinQ VLAN Id within a single subnet to be inspect and troubleshoot any connectivity issues.

Ping

The most basic check is to ping another IP on the private network that has QinQ VLAN interface configured. You could also add the -I vlan100@eno2 (source interface option)

An example:

ping
ping 192.168.1.1

Packet capture

Run tcpdump or other packet capture tool on a server QinQ VLAN interface. An example:

Tcpdump
tcpdump -nnvvi eth0 'vlan and vlan and host 192.168.1.1'

With this sample command you’ll be capturing VLAN and Non-VLAN Traffic within the private network at the same time.

The traffic within the private network is transparent. QinQ (802.1ad) just segments but not isolates the traffic.

Other

Check for existing firewall policies or rules in place that don’t permit any traffic over the private network


Comment configurer plusieurs VLAN (QinQ) dans un réseau privé

Description

Comment activer la fonction VLAN multiple dans le réseau privé en configurant QinQ dans votre système d’exploitation.

Visitez la page Réseau privé pour en savoir plus sur la fonction VLAN multiple.

Matrice de prise en charge des systèmes d’exploitation

Système d’exploitation Version Style QinQ supporté
Alma Linux 8 /etc/sysconfig/network-scripts/ifcfg-* Oui
Centos 7 /etc/sysconfig/network-scripts/ifcfg-* Oui
Rocky Linux 8 /etc/sysconfig/network-scripts/ifcfg-* Oui
Debian 9-11 /etc/network/interfaces Oui
FreeBSD 12-13 /etc/rc.conf Oui
Ubuntu 18-22 /etc/netplan/01-netcfg.yaml Oui
Serveur Windows 2012-2022 Style Windows Oui
ESXi 6.5-7.0 Style ESXi Oui
ESXi 6.0 Style ESXi Non
Mode rescue (GRML et Centos) Utilisation de l’outil de ligne de commande ip Oui
Mode rescue (FreeBSD) Utilisation de l’outil de ligne de commande ifconfig Oui

Ubuntu

Configuration

Etape 1 : Editez Netplan et ajoutez la configuration suivante pour votre VLAN QinQ. Dans notre cas, il s’agit du VLAN 100.

vi /etc/netplan/01-netcfg.yaml
vlans:
 vlan.100:
   id: 100
   link: eno2
   addresses: [192.168.1.100/24]

61472770

Exécutez la commande “netplan apply” pour appliquer les changements de configuration. Si nécessaire, redémarrez le serveur.

netplan apply

102498323

Important : pour confirmer que le VLAN QinQ fonctionne sur le réseau privé, vous devez configurer un autre serveur et effectuer un simple test ping.

Suppression

Étape 1 : Supprimez la configuration persistante existante de Netplan.

vi /etc/netplan/01-netcfg.yaml
vlans:
 vlan.100:
   id: 100
   link: eno2
   addresses: [192.168.1.100/24]

Étape 2 : Appliquez la configuration. Si nécessaire, redémarrez le serveur.

netplan apply

Debian

Configuration

Étape 1 : Installez le paquet VLAN

sudo apt update && sudo apt install vlan

Important: Seulement pour Debian 9

modprobe 8021q

Étape 2 : Modifiez le fichier des interfaces et ajoutez la configuration suivante pour votre VLAN QinQ. Dans notre cas, il s’agit du VLAN 100.

vi /etc/network/interfaces
auto vlan100
iface vlan100 inet static
       address 192.168.1.100/24
       vlan-raw-device eno2

Étape 3 : Enregistrez et appliquez la configuration en mettant l’interface QinQ en ligne à l’aide de la commande ifup/ifdown ou en redémarrant le service réseau du système.

ifup vlan100

102498324

Important : pour confirmer que le VLAN QinQ fonctionne sur le réseau privé, vous devez configurer un autre serveur et effectuer un simple test ping.

Suppression

Étape 1 : Supprimez la configuration persistante existante du fichier “interfaces”.

Étape 2 : Appliquez et redémarrez le service de mise en réseau si nécessaire.

ifdown vlan100

CentOS / RockyLinux / AlmaLinux

Configuration

Étape 1 : Désactivez le service NetworkManager

Vérifiez l’état du NetworkManager.

sudo systemctl status NetworkManager

Si NetworkManager ne fonctionne pas et que vous voyez Active : inactive (dead), vous pouvez passer à l’étape 2.

Si le service NetworkManager est actif, il doit être désactivé.

sudo systemctl stop NetworkManager

Étape 2 : Chargez le module du noyau.

Vérifiez que le module 8021q du noyau est chargé.

sudo lsmod | grep 8021q

S’il est chargé, vous obtiendrez un résultat similaire à celui-ci :

102498325

Si ce n’est pas le cas, cela signifie que le module n’est pas chargé. Chargez le module du noyau.

sudo modprobe 8021q

Pour s’assurer que le module 8021q du noyau est chargé au démarrage, nous devons ajouter le module dans le fichier de configuration des modules.

sudo su -c 'echo "8021q" >> /etc/modules'

Étape 3 : Créez un VLAN

Créez un nouveau fichier de configuration pour votre VLAN QinQ. Dans notre cas, il s’agit du VLAN 100.

Config :

DEVICE=vlan100
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.100
PREFIX=24
PHYSDEV=eno2
VLAN=yes

Étape 4 : Redémarrez le service NetworkManager pour que l’interface soit créée et en état de fonctionnement.

systemctl status NetworkManager

L’autre solution consiste à utiliser les commandes ifdown ou ifup

ifdown vlan100
ifup vlan100

102498326

Important : pour confirmer que le VLAN QinQ fonctionne sur le réseau privé, vous devez configurer un autre serveur et effectuer un simple test ping.

Suppression

Supprimez la configuration persistante existante en inversant les étapes de la partie Configuration.

FreeBSD

Configuration  

vi /etc/rc.conf
vlans_bge1="100"
ifconfig_bge1_100="inet 192.168.1.100/24"

Avec la commande “ifconfig”, vous devriez voir une sortie similaire à celle-ci pour confirmer la création de l’interface :

102498327

Important : pour confirmer que le VLAN QinQ fonctionne sur le réseau privé, vous devez configurer un autre serveur et effectuer un simple test ping.

Suppression

Supprimez la configuration persistante existante en inversant les étapes de la partie Configuration.

Windows

Configuration

Étape 1 : Vérifiez avant de créer un VLAN

Allez dans “Panneau de configuration, Réseau et Internet, Connexions réseau” et faites un clic droit sur “Embedded LOM 1 Port 2“.

102498328

Sélectionnez “Propriétés“, puis cliquez sur le bouton “Configurer” et sélectionnez l’onglet “Avancé“.

Assurez-vous qu’aucun ID VLAN n’est défini dans les paramètres avancés de la carte réseau (valeur ID VLAN = 0).

102498329

Étape 2 : Créez le NIC Teaming.

Allez dans Démarrer Gestionnaire de serveur → Sélectionnez l’onglet Serveur local et activez le NIC Teaming en cliquant sur le lien.

102498330

Après l’activation, vous obtenez une fenêtre “NIC Teaming”. Dans la section Équipes, cliquez sur Tâche Nouvelle équipe.

102498331

Spécifiez le nom de l’équipe (ID VLAN) comme “100” – Il s’agit de votre Id VLAN QinQ et sélectionnez les adaptateurs membres comme “Embedded LOM 1 Port 2“.

102498332

Étape 3 : Créez une interface

Dans la section “Adaptateurs et interfaces“, ajoutez des interfaces de réseau virtuel. Cliquez sur Tâches -> Ajouter une interface.

102498333

Vous devez créer deux interfaces pour vous assurer qu’il s’agit bien d’une interface hybride (une avec le VLAN par défaut pour le trafic global du réseau privé et une autre avec 100, pour le VLAN QInQ).

VLAN par défaut (réseau privé)

Ajoutez une interface avec “VLAN 100” et sélectionnez Default comme VLAN Membership.

102498334

VLAN QinQ

Cliquez à nouveau sur Ajouter une Interface avec un numéro de VLAN spécifique.

102498335

Après la configuration, vous verrez deux nouvelles connexions réseau sous “Panneau de configuration – Réseau et Internet – Connexions réseau” :

102498336

Étape 4 : Attribution de l’adresse IP

Allez dans “Panneau de configuration, réseau et Internet, connexions réseau“.

Cliquez avec le bouton droit de la souris sur la connexion nouvellement créée “VLAN 100” et sélectionnez Propriétés. Sélectionnez ensuite Protocol Internet Version 4 (TCP/IPv4) et cliquez sur le bouton Propriétés.

102498337

Assurez-vous que l’option “Obtenir l’adresse IP automatiquement” est sélectionnée.

102498338

Cliquez avec le bouton droit de la souris sur l’autre connexion nouvellement créée “VLAN100 – VLAN 100” et sélectionnez Propriétés. Sélectionnez ensuite Protocol Internet Version 4 (TCP/IPv4) et cliquez sur le bouton Propriétés.

Attribuez 192.168.1.100/24

Masque de sous-réseau : 255.255.255.0

102498339

Important : pour confirmer que le VLAN QinQ fonctionne sur le réseau privé, vous devez configurer un autre serveur et effectuer un simple test ping.

Par exemple, nous avons configuré un autre serveur avec 192.168.1.1 pour vérifier que la connectivité fonctionne.

102498340

Suppression

Étape 1 : Supprimez les interfaces

Dans la section “Adapter and Interfaces“, sélectionnez les deux interfaces réseau virtuelles créées pour QinQ (une avec le Vlan par défaut et une autre avec le VLAN 100) et supprimez-les.

Étape 2 : Désactivez le Teaming

Allez dans Démarrer Gestionnaire de serveur → Sélectionnez l’onglet “Serveur local” et désactivez le NIC Teaming en cliquant sur le lien “Activé“.

102498341

VMware ESXi

Configuration

Étape 1 : Le commutateur virtuel doit être créé sur l’ESXi. Dans notre cas, nous l’avons nommé “Internal” suivi de deux groupes de ports :

    Groupe de ports Accès interne pour le trafic non balisé du réseau privé
    Groupe de ports Internal VLAN 100 pour le trafic QinQ VLAN 100 balisé.

102498342

102498343

102498344

102498345

102498346

Une fois le vSwitch et les groupes de ports définis, nous devons maintenant attacher un NIC aux groupes de ports.

    Pour cet exemple, nous avons créé une machine virtuelle qui aura un accès hybride au réseau privé en lui ajoutant deux adaptateurs réseau.
        Réseau privé non balisé
        QinQ balisé

102498347

Important : pour confirmer que le VLAN QinQ fonctionne sur le réseau privé, vous devez configurer un autre serveur et effectuer un simple test ping.

Voici un exemple où nous avons configuré un autre serveur avec 192.168.1.1 pour vérifier que la connectivité QinQ fonctionne.

102498348

Suppression

Étape 1 : Supprimez les commutateurs virtuels si nécessaire

Allez dans “Host” -> “Réseau” et sélectionnez l’onglet “Commutateur virtuel”. A partir de là, supprimez le commutateur virtuel pré-créé “Interne”.

Étape 2 : Supprimez les groupes de ports

Allez dans “Host” -> “Réseau” & sélectionnez l’onglet “Groupe de port”. À partir de là, supprimez le groupe de ports pré-créé “Vlan 100 interne” qui se rapporte au VLAN QinQ.

Mode sauvetage de Leaseweb (GRML)

Configuration

Exemple de création d’une interface VLAN QinQ à l’aide de la commande “ifconfig”.

ip link add link eno2 name eno2.100 type vlan id 100
ip addr add 192.168.1.100/24 dev eno2.100
ip link set dev eno2.100 up

Suppression

Pour supprimer le VLAN 100 de l’interface eno2, exécutez la commande IP suivante.

ip link delete eno2.100

Mode sauvetage de Leaseweb (FreeBSD)

Configuration

Exemple de création d’une interface VLAN QinQ à l’aide de la commande “ifconfig”.

ifconfig bge1.100 create vlan 100 vlandev bge1 inet 192.168.1.100/24
ifconfig vlan100 create
ifconfig vlan100 name bge1.100
ifconfig bge1.100 vlan 100 vlandev bge1
ifconfig bge1.100 inet 192.168.1.100/24

Suppression

Pour supprimer une interface VLAN, exécutez la commande suivante.

ifconfig {vlan-name} destroy

Dépannage

Tout d’abord, plusieurs serveurs doivent être configurés avec le même identifiant de VLAN QinQ étiqueté au sein d’un même sous-réseau afin de pouvoir inspecter et résoudre les problèmes de connectivité.

Ping

La vérification la plus élémentaire consiste à envoyer un ping à une autre adresse IP sur le réseau privé dont l’interface VLAN QinQ est configurée. Vous pouvez également ajouter l’option -I vlan100@eno2 (interface source).

Voici un exemple :
ping

ping 192.168.1.1

Capture de packet

Exécutez tcpdump ou un autre outil de capture de paquets sur une interface VLAN QinQ du serveur. Un exemple :

Tcpdump

tcpdump -nnvvi eth0 'vlan and vlan and host 192.168.1.1'

Avec cet exemple de commande, vous capturerez simultanément le trafic VLAN et non VLAN au sein du réseau privé.

Le trafic au sein du réseau privé est transparent. QinQ (802.1ad) ne fait que segmenter le trafic sans l’isoler.

Autre

Vérifiez s’il existe des politiques ou des règles de pare-feu en place qui n’autorisent aucun trafic sur le réseau privé.