I'm trying to use bonding in active-passive mode, with 2 ethernet interfaces. I'd like the system to be always connected to the network, while there is at least one cable connected. I must be able to use this system with a DHCP server.

For now, I didn't find any working answer on the internet, so now I'm asking you guys :)



From the kernel documentation, this configuration has worked for me in the past (/etc/network/interfaces):

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# Define primary network interface
auto eth0
iface eth0 inet manual
    bond-master bond0
    bond-primary eth0 eth1

# Define secondary network interface
auto eth1
iface eth1 inet manual
    # delay ifup to allow eth0 to come up first in the bond
    pre-up sleep 2
    bond-master bond0
    bond-primary eth0 eth1

# Define master bond interface with link local address.
auto bond0
iface bond0 inet dhcp
    bond-slaves none
    bond-mode active-backup
    bond-miimon 100

You should try this :


alias bond0 bonding   
options bonding mode=1 arp_interval=1000 


auto bond0  
iface bond0 inet manual  
   up ifconfig bond0 up    
   up ifenslave bond0 eth0 eth1  
   up dhclient3 -e IF_METRIC=100 -pf /var/run/dhclient.bond0.pid -lf /var/lib/dhcp3/dhclient.bond0.leases bond0  
   down ifenslave -d bond0 eth0 eth1  

Let me know if it works.

  • I don't have dhclient3. I have dhclient, which is in version 4.3.1, and has no option -e. What would be the equivalent for dhclient ? – PinkPR Nov 29 '16 at 10:31
  • Hello , on isc-dhclient 4.3.3 there is option e : – Begoul Nov 29 '16 at 15:23
  • -e VAR=value Define additional environment variables for the environment where dhclient-script executes. You may specify multiple -e options on the command line. – Begoul Nov 29 '16 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.