Softpanorama

May the source be with you, but remember the KISS principle ;-)
Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and  bastardization of classic Unix

Bonding Ethernet Interfaces in Red Hat Linux

News Trunking / Bonding Multiple Network Interfaces Recommended Links

High Performance Computing (HPC)

Bonding Ethernet Interfaces in Red Hat Linux ethtool Internet Layer of TCP/IP Protocol
Linux ifconfig Traceroute Linux route command Tips Admin Horror Stories Humor Etc
 

Red Hat Enterprise Linux allows administrators to bind multiple network interfaces together into a single channel using the bonding kernel module and a special network interface called a channel bonding interface. Channel bonding enables two or more network interfaces to act as one, simultaneously increasing the bandwidth and providing redundancy.

To create a channel bonding interface, create a file in the /etc/sysconfig/network-scripts/ directory called ifcfg-bond<N> , replacing <N> with the number for the interface, such as 0.

The contents of the file can be identical to whatever type of interface is getting bonded, such as an Ethernet interface. The only difference is that the DEVICE= directive must be bond<N> , replacing <N> with the number for the interface.

The following is a sample channel bonding configuration file, ifcfg-bond0:

DEVICE=bond0
IPADDR=192.168.1.1
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
BONDING_OPTS="<bonding parameters separated by spaces>"
After the channel bonding interface is created, the network interfaces to be bound together must be configured by adding the MASTER= and SLAVE= directives to their configuration files. The configuration files for each of the channel-bonded interfaces can be nearly identical.

For example, if two Ethernet interfaces are being channel bonded, both eth0 and eth1 may look like the following example:

DEVICE=eth<N>
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
In this example, replace <N> with the numerical value for the interface.

For a channel bonding interface to be valid, the kernel module must be loaded. To ensure that the module is loaded when the channel bonding interface is brought up, add the following line to /etc/modprobe.conf:

alias bond<N> bonding
Replace <N> with the number of the interface, such as 0.

Important

Do not place parameters for the bonding kernel module in the /etc/modprobe.conf file. Instead, specify them as a space-separated list in the BONDING_OPTS="<bonding parameters>" directive in the ifcfg-bond<N> interface file.

The only exception is the debug parameter, which cannot be used on a per-device basis, and which should therefore be specified in /etc/modprobe.conf as follows:

options bonding debug=1
For further instructions and advice on configuring the bonding module, as well as to view the list of bonding parameters, refer to Section 45.5.2, “The Channel Bonding Module”.

CentOS 6 Channel Bonding

Channel bonding (also known as “Ethernet bonding”) is a computer networking arrangement in which two or more network interfaces on a host computer are combined for redundancy or increased throughput.

mode=0 (Balance-rr) – This mode provides load balancing and fault tolerance.
mode=1 (active-backup) – This mode provides fault tolerance.
mode=2 (balance-xor) – This mode provides load balancing and fault tolerance.
mode=3 (broadcast) – This mode provides fault tolerance.
mode=4 (802.3ad)This mode provides load balancing and fault tolerance.
mode=5 (balance-tlb) – Prerequisite: Ethtool support in the base drivers for retrieving the speed of each slave.
mode=6 (balance-alb) – Prerequisite: Ethtool support in the base drivers for retrieving the speed of each slave.

Note: Always append extra configuration in case of a rollback.

Configuring Channel Bonding

# cd /etc/sysconfig/network-scripts/

# vi ifcfg-bond0

We’ll be using mode=6 (balance-alb)

1
2
3
4
5
6
7
8
9
10
DEVICE=bond0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
IPADDR=10.0.0.10
NETMASK=255.255.0.0
NETWORK=10.0.0.0
BONDING_OPTS="miimon=100 mode=balance-alb"
TYPE=Unknown
IPV6INIT=no

# vi ifcfg-eth0

1
2
3
4
5
6
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

# vi ifcfg-eth1

1
2
3
4
5
6
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

# vi ifcfg-eth2

1
2
3
4
5
6
DEVICE=eth2
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Due to the fact that /etc/modprobe.conf has been deprecated in CentOS 6, the process of bonding network interfaces has changed a bit.

Now instead of defining your bond in your /etc/modprobe.conf, you define it in /etc/modprobe.d/bonding.conf

# vi /etc/modprobe.d/bonding.conf

Append the following onto the end out your modprobe config file

1
alias bond0 bonding

# service network restart

About Technical Samurai specializing in open source IT Automation and Cloud Infrastructure.

 


Top Visited
Switchboard
Latest
Past week
Past month

NEWS CONTENTS

Old News ;-)

Configuring Interface Bonding on CentOS-RHEL-OEL 6.x Toki Winter

In my previous article I wrote about configuring configuring network interface bonding under Debian Wheezy. Here, I'll briefly outline the steps required to get the same configuration running under recent RHEL-flavoured distributions – namely CentOS 6.4 in my case.

I will be bonding eth0 and eth1 into a bond named bond0. Ensure that you're connected to your host via a console. I'll be using active-backup (i.e. failover) bonding, but there are other options available – see the Debian article for links to reference material for those.

First, create the ifcfg-bond0 configuration file:

RHEL 6 - New Network Bonding Configuration - FATMIN

September 12, 2011

Due to the fact that /etc/modprobe.conf has been deprecated in RHEL 6, the process of bonding network interfaces has changed a bit.

Now instead of defining your bond in your /etc/modprobe.conf, you define it in /etc/modprobe.d/bonding.conf. No changes in syntax.

alias bond0 bonding

Then in your ifconfig-bond0 file, you define your bonding mode. Note the quotes, and the fact that I explicitly typed out the bonding mode

Bonding Ethernet Interfaces in Linux

This short HOWTO will tell you how to 'bond' two (or more) physical ethernet interfaces together to look and act as a single interface under Linux.

It was originally written for Mandrakelinux users but it has also been tested on recent versions of Mandriva Linux.

HOWTO

This example assumes you have two interfaces and want to use them in a 'fail-over' setup, where if one cable dies, the kernel will automatically switch to using the other cable.. This setup is quite common on server hardware.

In /etc/modules.conf on a 2.4.x kernel, or in /etc/modprobe.conf on a 2.6.x kernel, you should have something similar to the following:


	alias eth0 e1000	# Intel GigE (pci) port 1
	alias eth1 e1000	# Intel GigE (pci) port 2

	alias bond0 bonding				# Kernel nic bonding driver
	alias bond1 bonding				# Another bonded interface
	options bond0 max_bonds=2 miimon=100 mode=1	# 100ms fail-over timer. Mode 1 = Active/Backup
	options bond1 miimon=100 mode=1			# Same for bond1 

You need the following files in /etc/sysconfig/network-scripts/ :


	ifcfg-bond0
	ifcfg-eth0
	ifcfg-eth1

ifcfg-eth0 and ifcfg-eth1 should look similar to the following:


	DEVICE=eth0
	USERCTL=no
	ONBOOT=yes
	MASTER=bond0
	SLAVE=yes
	BOOTPROTO=none
	MII_NOT_SUPPORTED=yes

The DEVICE= section should reflect the interface the file relates to (ifcfg-eth1 should have DEVICE=eth1). The MASTER= section should indicate the bonded interface to be used. Assign both e1000 devices to bond0.

The bond0 file contains the actual IP address information:


	DEVICE=bond0
	IPADDR=192.168.1.1
	NETMASK=255.255.255.0
	ONBOOT=yes
	BOOTPROTO=none
	USERCTL=no
	MII_NOT_SUPPORTED=yes

Simply restarting the network service 'service network restart' should present you with a new 'bond0' interface. This is the interface you should see traffic going in and out of if youwere to tcpdump the interface.

You will also notice (using /sbin/ifconfig) that all of the ethX interfaces are also up, and also have IP addresses.


bond0     Link encap:Ethernet  HWaddr 00:04:23:61:06:30
	  inet addr:192.168.1.1  Bcast:194.61.191.127  Mask:255.255.255.224
          inet6 addr: fe80::204:23ff:fe61:630/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:240339580 errors:0 dropped:0 overruns:0 frame:0
          TX packets:264367658 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3328878476 (3174.6 Mb)  TX bytes:2497930422 (2382.2 Mb)

eth0      Link encap:Ethernet  HWaddr 00:04:23:61:06:30
          inet6 addr: fe80::204:23ff:fe61:630/64 Scope:Link
          UP BROADCAST RUNNING NOARP SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:43224057 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50149177 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:965949319 (921.2 Mb)  TX bytes:3242163496 (3091.9 Mb)
          Base address:0xdcc0 Memory:fcfa0000-fcfc0000

eth1      Link encap:Ethernet  HWaddr 00:04:23:61:06:30
          inet6 addr: fe80::204:23ff:fe61:630/64 Scope:Link
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:197115526 errors:0 dropped:0 overruns:0 frame:0
          TX packets:214218484 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2362929367 (2253.4 Mb)  TX bytes:3550735168 (3386.2 Mb)
          Base address:0xdc80 Memory:fcf80000-fcfa0000

In this example, we are using the fail-over mode. The eth device without NOARP is the current active SLAVE. You may notice that both ethX interfaces have high traffic counters. This is because the system has been up for around 200 days and at some point the interfaces swapped status.

For further reading, you should also read /usr/src/linux/Documentation/networking/bonding.txt which also gives the different bonding modes you can use. Some of these (like Etherchannel trunking) need compatible switches.

Debian - Ubuntu Linux Configure Network Bonding by nixCraft

Sep 4, 2011

Debian / Ubuntu Linux: Configure Network Bonding [ Teaming / Aggregating NIC ]

by NIX Craft on · 19 comments· LAST UPDATED September 6, 2011

in Debian Linux

NIC teaming is nothing but combining or aggregating multiple network connections in parallel. This is done to increase throughput, and to provide redundancy in case one of the links fails or Ethernet card fails. The Linux kernel comes with the bounding driver for aggregating multiple network interfaces into a single logical interface called bond0. In this tutorial, I will explain how to setup bonding under Debian Linux server to aggregate multiple Ethernet devices into a single link, to get higher data rates and link failover.

The instructions were tested using the following setup:
◾2 x PCI-e Gig NIC with jumbo frames.
◾RAID 6 w/ 5 enterprise grade 15k SAS hard disks.
◾Debian Linux 6.0.2 amd64

Please note that the following instructions should also work on Ubuntu Linux server.

RHEL: Linux Bond / Team Multiple Network Interfaces (NIC) Into a Single Interface by NIX Craft

April 3, 2006

121 comments

Finally, today I had implemented NIC bounding (bind both NIC so that it works as a single device). Bonding is nothing but Linux kernel feature that allows to aggregate multiple like interfaces (such as eth0, eth1) into a single virtual link such as bond0. The idea is pretty simple get higher data rates and as well as link failover. The following instructions were tested on:

  1. RHEL v4 / 5 / 6 amd64
  2. CentOS v5 / 6 amd64
  3. Fedora Linux 13 amd64 and up.
  4. 2 x PCI-e Gigabit Ethernet NICs with Jumbo Frames (MTU 9000)
  5. Hardware RAID-10 w/ SAS 15k enterprise grade hard disks.
  6. Gigabit switch with Jumbo Frame

Recommended Links

Google matched content

Softpanorama Recommended

Top articles

Sites

Top articles

Sites



Etc

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D


Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to to buy a cup of coffee for authors of this site

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: December, 12, 2020