Hi,

Steinar H. Gunderson schreef op 2016-05-17 10:49:
I've got an ARM system where eth0 is hotplugged pretty slowly
(it hangs off of USB, and takes a while to initialize), so for
networking to work in general, the system needs to be able to
hotplug it. Thus, I have:
I currently use a few 1000 xu4 ;-)

  allow-hotplug eth0
  iface eth0 inet static
          address 10.1.0.7
          netmask 255.255.255.0
          gateway 10.1.0.1
          up vconfig add eth0 20
          up vconfig add eth0 21
          up vconfig add eth0 22

This shouldn't be necessary, though. Perhaps vlan or ifupdown could
be modified so that when interface “foo” gets hotplugged, it also
takes that as a sign to hotplug every VLAN with “foo” as raw device?

1) This is the only correct solution.
2) After several problems, especially the one you describe, I've noticed that vlan and bridge-utils combined with ifupdown are obsolete.
3) never ever use vconfig, use:
For bridges:
iface br0 inet static...
        pre-up ip link add name $IFACE type bridge
        pre-up ip link set $IFACE address <mac>
<snip>
<for each real device>
allow-hotplug eth1
iface eth1 inet manual
        pre-up ifup br0 || true
        pre-up ip link set $IFACE master br0
        pre-up ip link set up dev $IFACE

For macvlans use:
ip link add link $IFACE name meth0 type macvlan mode bridge
For vlans use:
ip link add link $IFACE name vlan11 type vlan id 11
And for the vlan config itself use:

allow-hotplug vlan11
iface vlan11 inet dhcp

So the raw interface has been moved to the allow-hotplug of the raw interface.

Another note on allow-hotplug and auto:
On our armhf environment, hotplug will usually happen before auto for some interfaces, but after auto for others.

About vconfig and such: around 2010 I had a miscommunication with my sponsor, so the new version without vconfig never got uploaded. So remember: vconfig, mvconfig and brctl are obsolete (and so is the vlan and the bridge-utils package)
The auto keyword also is more or less obsolete.
Ifupdown should be rewritten to accomodate network events (more than just hotplug events), and to allow for reversed dependency traversel and classing of devices and setups.

Anyway: I know your pain, but in the current setup it's a wontfix, because any solution would be a single target solution that probably causes more troubles than it fixes. If you need more info you can find me at #odroid on freenode. On another note: I don't use the vlan package on arm based systems, and if I do use it, it's version 1.9-5 which has never made it to debian (although it is used in several companies).

I will not close this yet, as this gives a lot to think about (the future direction of ifupdown).

Reply via email to