Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the correct way of configuring virtual LAN interfaces (hopefully without messing up Network Manager) on Ubuntu 12.04 Desktop?

Simply adding the interface to /etc/network/interfaces seems to cause Network Manager some confusion:

auto vlan500
iface vlan500 inet static
vlan_raw_device eth1

Is there a better way of doing it?


I updated /etc/NetworkManager/NetworkManager.conf with a no-auto-default clause, and set managed=false in the [ifupdown] section:




This keeps NetworkManager from firing up eth0, and makes it stay away from eth1 and it's VLAN interfaces. Previously it would only let a single VLAN interface be up, and it would put the static IP of that VLAN interface directly on the eth1 physical interface.

Still, there is a 2 minute delay during boot as (I presume) NetworkManager is trying to work out the network configuration.


Solved by creating keyfiles as described in my answer below. My desktop now boots with all VLAN interfaces up and running, and without any delays during boot.

share|improve this question
  1. Install VLAN package on your computer:

    sudo apt-get install vlan

  2. Edit your /etc/network/interfaces file so it would contain the following:

#The loopback network interface

auto lo
iface lo inet loopback
#This is a list of hotpluggable network interfaces.
#They will be activated automatically by the hotplug subsystem.
auto vlan500

# VLAN 500

iface vlan500 inet static
mtu 1500
vlan_raw_device eth0

Note: You have to replace my IP addresses, network masks and gateway IP address with your own.

3.Make sure that switch interface you are connected to configured with respective VLANs.

4.Restart your network interface:

sudo /etc/init.d/networking restart

You should see something like:

Set name-type for VLAN subsystem. Should be visible in /proc/net/vlan/config
Added VLAN with VID == 500 to IF -:eth0:-
share|improve this answer
That looks to be exactly how I've done it, but it seems to have the side effect of confusing NetworkManager and causing a two minute delay when booting. – Roy Oct 12 '12 at 15:29
up vote 1 down vote accepted

Turns out there is no VLAN support in the ifupdown plugin that lets Network Manager work with /etc/network/interfaces, so instead we will have to manually add a keyfile for Network Manager.

First generate an UUID for the VLAN interface

root@kayna:~# uuidgen -r

Then create the keyfile, here is an example for vlan id 200 on physical interface eth1

root@kayna:~# vi /etc/NetworkManager/system-connections/vlan200





The interface will not show up in the GUI, but can be seen and managed with nmcli

root@kayna:~# nmcli dev
DEVICE     TYPE              STATE        
eth1.200   vlan              connected    
eth0       802-3-ethernet    disconnected 
eth1       802-3-ethernet    connected    

Stop and start the interface with

root@kayna:~# nmcli con down id vlan200

root@kayna:~# nmcli con up id vlan200

Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/12
state: activated
Connection activated

The interface is created using the eth1.200 format, not the vlan200 format typically used in /etc/network/interfaces

root@kayna:~# ifconfig eth1.200
eth1.200  Link encap:Ethernet  HWaddr c8:60:00:00:00:56  
          inet addr:  Bcast:  Mask:
          RX packets:185 errors:0 dropped:0 overruns:0 frame:0
          TX packets:55 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:29811 (29.8 KB)  TX bytes:9549 (9.5 KB)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.