interface bond sem link na inicialização

interface bond sem link na inicialização

Após uma reinicialização do servidor, bond0não foi iniciado pois uma de suas ethernets escravas ( eth2) não tinha link, tive que configurá-lo manualmente com:

ip link set dev eth2 up

O servidor possui um vínculo com a LAN (com ponte para KVM) e outro vínculo para drbd com outro servidor:

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

ambos os servidores rodam Debian Wheezy, isto é /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

o outro servidor inicializou corretamente e a única diferença entre ambos interfacesé staticem vez de manualna bond0declaração

iface bond0 inet static

Como posso evitar que isso aconteça novamente?

ip link setadicionar interfaces é uma boa ideia?

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

qual é a diferença entre statice manual? ou melhor, onde posso encontrar a documentação completa do arquivo de interfaces? ( man interfacesnão fala sobre bond, bridge, wireless.. opções)

Responder1

Basta adicionar:

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

A diferença entre statice manualé que o estático é configurado por parâmetros (como endereço, máscara de rede, escravos, ...) e o manual é definido pela sequência de comandos (pré-up, up, down, post-down)

informação relacionada