Home | Linuxmon.comhttps://linuxmon.com/2024-03-27T06:17:47+00:00HomeUbuntu bonding2017-04-04T19:46:11+00:002024-03-27T06:17:47+00:00mahhttps://linuxmon.com/author/mah/https://linuxmon.com/ubuntu-bonding/<p><a href="https://linuxmon.com/ubuntu-bonding/"><img alt="" height="116" src="https://linuxmon.com/static/media/uploads/Blog/.thumbnails/bonding.png/bonding-207x116.png" width="207"/></a></p>
<p>If we need increase Bandwidth of the server we need to configure bond in ethernet card Bonding also calls port <strong>trunking</strong> this is combination someethernet card in one link with one IP address, for high- loaded systems:</p>
<ul>
<li>load balancing,</li>
<li>high-availability,</li>
<li>maximum throughput,</li>
<li>high-availability</li>
</ul>
<p>or combinations of these modes. We will setup in Ubunti 12.04 LTS</p>
<!--more-->
<p>Ubuntu 12.04.4 LTS <strong>Installation</strong> we need to install <strong>ifenslave-2.6</strong> ifenslave-2.6 used turn-off-turn-on slave ethernet cards in bond</p>
<pre>sudo apt-get install ifenslave-2.6</pre>
<p><b>Configuration ethernet cards</b> before configuring eth cards in bond, we need to check exist module bonding in core system and make autoload module:</p>
<pre class="brush: bash; gutter: true; first-line: 1">sudo vi /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored
loop
lp
rtc
bonding
</pre>
<p>stop networking: sudo /etc/init.d/networking stop</p>
<pre>sudo /etc/init.d/networking stop</pre>
<p>load module <strong>bonding</strong></p>
<pre>sudo modprobe bonding</pre>
<p>now we are ready to set up our ethernet cards:</p>
<pre>sudo vim /etc/network/interfaces</pre>
<p>for example, we have two eth card and we need bond its. eth0 and eth1 for bonding in mode ‘load balancing’.</p>
<pre class="brush: bash; gutter: true; first-line: 1">auto eth0
iface eth0 inet manual
bond-master bond0
auto eth1
iface eth1 inet manual
bond-master bond0
# bond0 is configured using static network information.
auto bond0
iface bond0 inet static
address 192.168.1.10
gateway 192.168.1.1
netmask 255.255.255.0
bond-mode balance-rr
bond-miimon 100
bond-slaves eth0 eth1</pre>
<p>start networking:</p>
<pre>sudo /etc/init.d/networking start</pre>
<p>verify ethernet card bond0:</p>
<pre>$cat /proc/net/bonding/bond0</pre>
<pre>Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth3
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:15:17:6a:65:f5
Slave queue ID: 0
Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 00:15:17:6a:65:f4
Slave queue ID: 0</pre>
<p>Everything are OK. --- Original <span style="text-decoration: underline;">here</span></p>