Vlan Tagging for Network Configuration

VLAN Tagging allows an individual IP Address to be configured as part of multiple VLANs.

The steps below tag VLAN ID 1002 on the eth0 interface. Replace eth0 with the name of your own network interface (you can list the interfaces with ip a) and 1002 with your VLAN ID.

1- Firstly, install the vlan package on Ubuntu with the command below.

apt-get install vlan

2- Then load the 802.1Q kernel module.

sudo modprobe 8021q

3- Make the module load automatically after a reboot by running the following command.

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

4- Add the VLAN 1002 interface to /etc/network/interfaces and add the line “vlan-raw-device eth0” at the bottom, as in the example below.

auto eth0.1002
iface eth0.1002 inet static
        address <VLAN IP address>
        netmask <VLAN netmask>
        vlan-raw-device eth0

11.png

Note: Logsign manages the network configuration with ifupdown (the networking service). Netplan is removed during the installation, so the configuration file is always /etc/network/interfaces. This file also includes /etc/network/interfaces.d/*, so you can put the VLAN definition into a separate file under that directory if you prefer.

5- Bring up the new VLAN interface to complete the process.

sudo ifup eth0.1002
Was this article helpful?
0 out of 0 found this helpful

Articles in this section

Become a Certified Logsign User/Administrator
Sign-up for Logsign Academy and take the courses to learn about Logsign USO Platform in detail. Enjoy the courses, and get your badges and certificates. In these courses, you'll learn how to use Logsign in your work and add value to your career.
Visit Our Blog
Our Logsign USO Platform illustrate our expertise. So do the blog. Through our blog posts, deepen your knowledge on various SecOps topics or get updated about important news & modern approaches for cybersecurity. Get into the habit of reading valuable information provided by Logsign. Be a step ahead.