#757925 vlan if-preup scripts conflics with ifup : ERROR: trying to add VLAN #42 to IF -:eth3:- error: File exists

#757925#5
Date:
2014-08-12 13:24:36 UTC
From:
To:
On Wheezy with, ifupdown version : 0.7.8
Kernel : 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux

When configuring a vlan in /etc/network/interfaces like so :

iface eth3.42 inet static
address 192.168.4.1
netmask 255.255.255.0
vlan-raw-device eth3

And running : ifup eth3.42 you will get :

ERROR: trying to add VLAN #42 to IF -:eth3:-  error: File exists

And the interface will fail to configure.

This is due to ifup already adding the interface before the vlan ifup scripts are run see the strace for ifup eth3.42 :

write(2, "if test -d /sys/class/net/eth3 -"..., 185if test -d /sys/class/net/eth3 -a             ! -d /sys/class/net/eth3.42 ;     then         ip link set up dev eth3;         ip link add link eth3 name eth3.42 type vlan id 42;     fi
) = 185
setpgid(0, 0)                           = 0
clone(Process 15556 attached
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fb3e29dd9d0) = 15556
[pid 15555] wait4(15556, Process 15555 suspended
 <unfinished ...>
[pid 15556] execve("/bin/sh", ["/bin/sh", "-c", "if test -d /sys/class/net/eth3 -"...], [/* 0 vars */]) = 0


So before the running the preup scripts ifup already had the interface in /proc/net/vlan/ thus the vconfig call in if-pre-up.d/vlan fails and the interfaces does not configure itself.

I've added this as a bug in vlan since it seems the scripts are now deprecated by ifup functionality ?

Removing the vlan pre-up/down scripts fixes the issue.

Thank you,
---
Antoine Tremblay <hexa@kayaksoft.com>
GPG 0xCABC89C4 C62F 968F 5A59 8BA4 1F25  CE63 056D DA28 CABC 89C4