sudo apt-get install ifenslaveThe following shows a setup for two lacp trunks (bonds), one bonding of four 1Gb ports and one bonding of two 10Gb ports. There are three files of interest for this setup:
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x1010 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:4f:8e:09:48", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x1010 (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:4f:8e:09:49", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x10de:0x0057 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:4f:8e:09:46", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x10de:0x0057 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:14:4f:8e:09:47", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# PCI device 0x8086:0x10fb (ixgbe)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:21:69:7b:b5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"
# PCI device 0x8086:0x10fb (ixgbe)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1b:21:69:7b:b4", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"
#
# Want to define an network interface NAME that we're going to use for
# ifenslave bond interfaces of both the 1 Gb ports and 10 Gb ports.
# We also define our default values for the bond which includes the
# number of bonds being created ("max_bonds" value).
alias bond0 bonding
alias bond1 bonding
options bonding mode=802.3ad miimon=100 downdelay=200 updelay=200 max_bonds=2
# 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
# Note: to use the following network setup for bonding multiple NIC
# connections together.
#
# You will need to "apt-get install ifenslave"
# and append these two lines
# alias bond4x1Gb bonding
# options bonding mode=802.3ad miimon=100 downdelay=200 updelay=200
# to the "/etc/modprobe.d/aliases.conf" file.
#
# Tell the system that all interfaces are being handled manually.
auto eth0
iface eth0 inet manual
auto eth1
iface eth1 inet manual
auto eth2
iface eth2 inet manual
auto eth3
iface eth3 inet manual
auto eth4
iface eth4 inet manual
auto eth5
iface eth5 inet manual
# Setup the desired 802.3ad interface using ifenslave.
auto bond0
iface bond0 inet static
# Networking information
# On switch dc-cs2:trk43
address 129.97.152.203
netmask 255.255.255.0
network 129.97.152.0
broadcast 129.97.152.255
gateway 129.97.152.1
# Now bond the four 1Gb network interfaces together.
# in an active active setup where they are all equal.
bond-primary eth0 eth1 eth2 eth3
# what happens as part of startup/shutdown cycle.
post-up /sbin/ifenslave bond0 eth0 eth1 eth2 eth3
post-down /sbin/ifenslave -d bond0 eth0 eth1 eth2 eth3
auto bond1
iface bond1 inet static
# Networking information
# On switch dc-cs2:trk38 Vlan 819
# address 10.15.4.10
# broadcast 10.15.4.255
# network 10.15.4.0
# netmask 255.255.255.0
# Now bond the four 1Gb network interfaces together.
# in an active active setup where they are all equal.
bond-primary eth4 eth5
# what happens as part of startup/shutdown cycle.
post-up /sbin/ifenslave bond1 eth4 eth5
post-down /sbin/ifenslave -d bond1 eth4 eth5
# End of ifenslave example.