0

After a server reboot, bond0 has not been started since one of its slave ethernets (eth2) had no link, I had to manually set it with:

ip link set dev eth2 up

Server has one bond to the LAN (with bridge for KVM) and another bond for drbd to another server:

    kvm + lan                       drbd
 ##############################################
 +------------------------+
 |           br0          |
 +------------------------+
 +---------------+ +------+   +---------------+
 |     bond0     | | vnet |   |     bond1     |
 +---------------+ +------+   +---------------+
 +------+ +------+            +------+ +------+
 | eth0 | | eth2 |            | eth1 | | eth3 |
 +------+ +------+            +------+ +------+

both servers run Debian Wheezy, this is /etc/network/interfaces:

# The loopback network interface
auto lo
iface lo inet loopback

# to the switch
auto bond0
iface bond0 inet manual
  slaves eth0 eth2
  bond-mode 802.3ad
  bond-miimon 100
  bond-downdelay 200
  bond-updelay 200

# bridge for KVM
auto br0
iface br0 inet static
  address 192.168.0.92
  netmask 255.255.255.0
  network 192.168.0.0
  broadcast 192.168.0.255
  gateway 192.168.0.101
  bridge_ports bond0
  bridge_stp off
  bridge_fd 0
  bridge_maxwait 0

# bond for drbd
auto bond1
iface bond1 inet static
  address 10.200.200.2
  netmask 255.255.255.0
  network 10.200.200.0
  broadcast 10.200.200.255
  slaves eth1 eth3
  bond-mode balance-rr
  bond-miimon 100
  bond-downdelay 200
  bond-updelay 200

the other server booted correctly and the only difference between both interfaces is static instead of manual on bond0 declaration

iface bond0 inet static

How can I prevent this from happening again?

is adding ip link set to interfaces a good idea?

auto bond0
iface bond0 inet manual
    pre-up ip link set eth0 up
    pre-up ip link set eth2 up
    (...)

what's the difference between static and manual? or better, where can I find full documentation of interfaces file? (man interfaces does not tell about bond, bridge, wireless.. options)

Lluís
  • 425
  • 1
  • 4
  • 22

1 Answers1

0

Just simply add:

auto eth0
iface eth0 inet manual
    up ip link set eth0 up
    down ip link set eth0 down

auto eth1
iface eth1 inet manual
    up ip link set eth1 up
    down ip link set eth1 down

auto eth2
iface eth2 inet manual
    up ip link set eth2 up
    down ip link set eth2 down

auto eth3
iface eth3 inet manual
    up ip link set eth3 up
    down ip link set eth3 down

Difference between static and manual is that static is configured by parameters (like address, netmask, slaves, ...) and manual is defined by command sequence (pre-up, up, down, post-down)

Lluís
  • 425
  • 1
  • 4
  • 22
Dragonn
  • 41
  • 3
  • I've also found [this bug report](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=697357), last comment says to move slave/master info from bond to eth definitions. I can't reboot this server right now, but I'll accept your answer by now – Lluís Apr 10 '14 at 08:10
  • I have configured `bond0` as manual with `pre-up modprobe bonding ...`, up `ip link set up dev bond0` and `up ifenslave bond0 eth0 eth1` and it's working without any problem. IP address is set on bridge over bond0 – Dragonn Apr 11 '14 at 08:43
  • I tried to reproduce the issue in a virtual environment, but after each reboot, all eth have link up regardless of /etc/network/interfaces, maybe it was caused by a switch reset, race condition, ethernet driver bug... – Lluís Apr 11 '14 at 10:28