epcim
9/16/2016 - 5:53 PM

bond0 bonding network interfaces

bond0 bonding network interfaces


sudo apt-get install ifenslave

cat > /etc/modules <<-EOF
loop
lp
rtc
bonding
EOF

sudo stop networking
sudo modprobe bonding

#eth0 is manually configured, and slave to the "bond0" bonded NIC
auto eth0
iface eth0 inet manual
bond-master bond0
bond-primary eth0

#eth1 ditto, thus creating a 2-link bond.
auto eth1
iface eth1 inet manual
bond-master bond0

cat > /etc/network/interfaces <<-EOF

  auto eth0
  iface eth0 inet manual
  bond-master bond0
  bond-primary eth0
  
  auto eth1
  iface eth1 inet manual
  bond-master bond0

  auto bond0
  iface bond0 inet static
  address 192.168.1.10
  gateway 192.168.1.1
  netmask 255.255.255.0
  bond-mode active-backup
  bond-miimon 100
  bond-slaves none
EOF

sudo start networking
ifup eth1
ifup eth2
ifup bond0