[Bug 1015199] Re: ifup does not work as documented with bonding interfaces

Ewen McNeill 1015199 at bugs.launchpad.net
Wed Feb 17 02:05:39 UTC 2016


Even with the apparently fixed version, this "does not work after ifdown
bond0/ifup bond0 cycle" appears to persist:

-=- cut here -=-
ewen at nas06:~$ cat /etc/issue
Ubuntu 14.04.4 LTS \n \l

ewen at nas06:~$ dpkg -l | grep ifenslave
ii  ifenslave                            2.4ubuntu1.2                     all          configure network interfaces for parallel routing (bonding)
ewen at nas06:~$ 
-=- cut here -=-

-=- cut here -=-
root at nas06:~# ifdown bond0
em1=em1
em2=em2
root at nas06:~# ifup bond0
Waiting for a slave to join bond0 (will timeout after 60s)
No slave joined bond0, continuing anyway
root at nas06:~# ifup em1
root at nas06:~# ifup em2
root at nas06:~#
-=- cut here -=-

After "ifdown bond0" the link does not work properly again until "ifup
bond0" is done, followed by "ifup" on the individual interfaces.  Which
appears to be because "ifdown bond0" disables much more than "ifup
bond0" is willing to enable.  In particular it appears that "ifup bond0"
does not make any attempt to start the slave interfaces -- it seems to
solely rely on them being auto-started, which happens only on discover
on boot.

The only way I seem to be able to get semi-sane behaviour is to add:

-=- cut here -=-
        pre-up (sleep 2 && ifup em1) &
        pre-up (sleep 2 && ifup em2) &
-=- cut here -=-

to the bond0 interface stanza.   It has to:
(a) be pre-up, because post-up is called only after the 60 second up delay; and
(b) be delayed, because bond0 won't exist without an modprobe.d alias, until "ifup bond0" has mostly completed.

Which feels very fragile.

Surely the network scripts for ifenslave could iterate over bond-slaves
and do  the equivalent of "ifup" on those slave interfaces (or just
enslave them directly)?   Or have some other way to indicate the
interfaces to auto-start.  Given that the scripts are already auto-
stopping them.

BTW, the documentation in README.Debian.gz is clearly wrong:

-=- cut here -=-
A bonding master is defined like this:

iface bond0 inet static
        address 208.77.188.166
        ...
        bond-primary eth0 eth1

The bonding slaves should then be defined like this:
[...]
-=- cut here -=-

as the whole bonding configuration in bond0 will be ignored if it does
not contain "bond-slaves" (as noted later in the file).

My current configuration (works with the "pre-up" lines; fails "ifdown
bond0; sleep 5; ifup bond0" cycle without):

-=- cut here -=-
auto em1
allow-bond0 em1
iface em1 inet manual
	bond-master bond0
 
auto em2
allow-bond0 em2
iface em2 inet manual
	bond-master bond0

auto bond0
iface bond0 inet static
	address [...]
        bond-mode 802.3ad
        bond-primary em1 em2
        bond-slaves em1 em2
        bond-downdelay 200
        bond-updelay 200
        bond-miimon 100
        bond-lacp-rate 1
        pre-up (sleep 2 && ifup em1) &
        pre-up (sleep 2 && ifup em2) &
-=- cut here -=-

(I've not yet rebooted to see what happens then, but I'm hopeful worst
case I get some warnings about interfaces already being up.)

Ewen

PS: Ironically the referenced bug
(https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1337873) says
in a comment:

-=- cut here -=-
In your case ifupdown will be responsible for bringing eth2 and eth3 devices while setting up bond0, so you don't need to undertake any additional actions in the bond0 section - please depend on this.
-=- cut here -=-

which does not appear to be something that one can depend on :-(

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ifenslave-2.6 in Ubuntu.
https://bugs.launchpad.net/bugs/1015199

Title:
  ifup does not work as documented with bonding interfaces

Status in ifenslave-2.6 package in Ubuntu:
  Fix Released

Bug description:
  The file /usr/share/doc/ifenslave-2.6/README.Debian.gz states:

  "Using ifup on a master interface will call ifup for all slaves that are
  flagged with allow-bondX. (bondX being replaced by the master interface
  name). This will allow for extra setup for special slave interfaces."

  However I'm using this /etc/network/interfaces file:

  # The bound interface 
  auto eth3
  allow-bond0 eth3
  iface eth3 inet manual
    bond-master bond0
    bond-primary eth3 eth4 eth5

  auto eth4
  allow-bond0 eth4
  iface eth4 inet manual
    bond-master bond0
    bond-primary eth3 eth4 eth5

  auto eth5
  allow-bond0 eth5
  iface eth5 inet manual
    bond-master bond0
    bond-primary eth3 eth4 eth5

  auto bond0 
  iface bond0 inet static
    address 10.1.1.125
    network 10.1.0.0
    netmask 255.255.0.0
    broadcast 10.1.255.255
    bond-mode balance-rr
    bond-slaves eth3 eth4 eth5
    bond-miimon 100
    bond-downdelay 200
    bond-updelay 200

  and issuing the 'ifup bond0' command I get:

  root@:~# ifup bond0
  Waiting for a slave to join bond0 (will timeout after 60s)
  No slave joined bond0, continuing anyway
  ssh stop/waiting
  ssh start/running, process 9610

  As you can see no slave interface has been started.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ifenslave-2.6/+bug/1015199/+subscriptions



More information about the foundations-bugs mailing list