setup and save vlans on ethernet (GNS3, Ubuntu)

First you must install

   sudo apt-get install vlan

load kernel module

   sudo modprobe 8021q

Create a new interface that is a member of a specific VLAN, VLAN id 100

We use the physical interface eth0 in this example. This command will add an additional interface next to the interfaces which have been configured already

   sudo vconfig add eth0 100

Assign an address to the new interface.

   sudo ip addr add dev eth0.100

To make this setup permanent. Add the module to the kernel on boot

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

Create the interface and make it available when the system boots. Add the following lines to /etc/network/interfaces

auto eth0.100
iface eth0.100 inet dhcp
    vlan-raw-device eth0

Leave a Reply

Your email address will not be published. Required fields are marked *