http://www.linuxfoundation.org/collaborate/workgroups/networking/bonding#Configure_and_build_the_kernel_with_bonding
http://unixadminschool.com/blog/2013/10/redhat-enterprise-linux-network-bonding-quick-reference-rhel5-rhel6/
https://docs.fedoraproject.org/en-US/Fedora/23/html/Networking_Guide/sec-Configuring_a_VLAN_over_a_Bond.html
Configuration with initscripts support
This section applies to distros using a version of initscripts
with bonding support, for example, Red Hat Linux 9 or Red Hat
Enterprise Linux version 3 or 4. On these systems, the network
initialization scripts have some knowledge of bonding, and can be
configured to control bonding devices.
These distros will not automatically load the network adapter
driver unless the ethX device is configured with an IP address.
Because of this constraint, users must manually configure a
network-script file for all physical adapters that will be members of
a bondX link. Network script files are located in the directory:
/etc/sysconfig/network-scripts
The file name must be prefixed with "ifcfg-eth" and suffixed
with the adapter's physical adapter number. For example, the script
for eth0 would be named /etc/sysconfig/network-scripts/ifcfg-eth0.
Place the following text in the file:
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none
The DEVICE= line will be different for every ethX device and
must correspond with the name of the file, i.e., ifcfg-eth1 must have
a device line of DEVICE=eth1. The setting of the MASTER= line will
also depend on the final bonding interface name chosen for your bond.
As with other network devices, these typically start at 0, and go up
one for each device, i.e., the first bonding instance is bond0, the
second is bond1, and so on.
Next, create a bond network script. The file name for this
script will be /etc/sysconfig/network-scripts/ifcfg-bondX where X is
the number of the bond. For bond0 the file is named "ifcfg-bond0",
for bond1 it is named "ifcfg-bond1", and so on. Within that file,
place the following text:
DEVICE=bond0
IPADDR=192.168.1.1
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
Be sure to change the networking specific lines (IPADDR,
NETMASK, NETWORK and BROADCAST) to match your network configuration.
Finally, it is necessary to edit /etc/modules.conf (or
/etc/modprobe.conf, depending upon your distro) to load the bonding
module with your desired options when the bond0 interface is brought
up. The following lines in /etc/modules.conf (or modprobe.conf) will
load the bonding module, and select its options:
alias bond0 bonding
options bond0 mode=balance-alb miimon=100
Replace the sample parameters with the appropriate set of options for your configuration.
Finally run "/etc/rc.d/init.d/network restart" as root. This
will restart the networking subsystem and your bond link should be now
up and running.
Example configuration:
cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.10.5
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
#NM_CONTROLLED=no
TYPE=Bond
BONDING_MASTER=yes
BONDING_OPTS="mode=1 miimon=100 arp_interval=200 arp_ip_target=192.168.10.254,192.188.10.2"
cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=00:1e:65:09:22:55
IPADDR=192.168.10.105
NETMASK=255.255.255.0
IPV6INIT=no
USERCTL=no
SLAVE=yes
MASTER=bond0
cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
ONBOOT=no
HWADDR=00:1e:65:09:22:56
IPADDR=192.168.10.115
NETMASK=255.255.255.0
USERCTL=no
IPV6INIT=no
SLAVE=yes
MASTER=bond0
cat /etc/sysconfig/network-scripts/route-bond0
192.168.0.0/24 via 192.168.10.254 dev bond0
----------------------------------------------------
To configure VLAN over bonded interfaces add configuration script ifcfg_<bond>.<tag> to /etc/sysconfig/network-scripts/ directory, for example:
> cat /etc/sysconfig/network-scripts/ifcfg_bond0.100
VLAN=yes
VLAN_NAME_TYPE=DEV_PLUS_VID_NO_PAD
DEVICE=bond0.100
BOOTPROTO=none
ONPARENT=yes
#ONBOOT=yes
#TYPE=Ethernet
IPADDR=192.168.0.1
NETMASK=255.255.255.0
IPV6INIT=no
If VLAN requires some specific route it can be added as:
> cat /etc/sysconfig/network-scripts/route-bond0.100
192.168.15.0/24 via 192.168.0.254 dev bond0.100
|