1825771 Members
2160 Online
109687 Solutions
New Discussion

Bonding in Linux

 
John Guster
Trusted Contributor

Bonding in Linux

I have 4 NIC cards and 2 network cables teamed, want create bond0 out of 2 NIC cards. Before create bonding, eth0 is mapped to an IP, eth1 shows packets, eth2 and eth3 have zero packets. is it right to configure eth0 and eth1 as slave for bond0?
3 REPLIES 3
Modris Bremze
Esteemed Contributor

Re: Bonding in Linux

It would be wise to bond only those interfaces which have actual cables attached (you say that you have 4 NICs and only 2 cables). When you bond interfaces, all previous individual interface configuration is irrelevant, as you create a new bond0 virtual interface, which you then configure. Slave interfaces afterwards, if they are to be added to bond0, don't need any IP addresses etc.
Steven E. Protter
Exalted Contributor

Re: Bonding in Linux

Shalom,

Network bonding creates a new interface, usually called bond0

eth0 etc become slaves to that new inteface and the Interface bond0 contains the IP address.

It picks up a MAC address, usually from eth0, but not always.

Bonding configuration is controlled by /etc/modprobe.conf and how the traffic is handled is controlled by the mode statement in that file.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Matt Palmer_2
Respected Contributor

Re: Bonding in Linux

Hi,

In my setup I have done the following, which may help you. (Some of these instructions may need modifying depending on your distro)

you can force which card you want to be the primary in the bond by appending the following to the ifcfg-bond0 file in /etc/sysconfig/network:

primary=ethX

also you can forcefully set your eth devices to be persistent to specific mac addresses, by using udev:

look in:/etc/udev/rules.d/30-net_persistent_names.rules

for entries like this:
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:1a:4b:ce:4f:74", IMPORT="/lib/udev
/rename_netiface %k eth0"
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:1a:4b:ce:4f:72", IMPORT="/lib/udev
/rename_netiface %k eth1"

and change them to the specific mac addresses of the cards in your server and change the ethX label you want each to have.

look in:
good source for info:
http://www.linuxfoundation.org/collaborate/workgroups/networking/bonding

Hope that helps

regards

Matt