{"id":892,"date":"2015-09-18T16:21:25","date_gmt":"2015-09-18T14:21:25","guid":{"rendered":"http:\/\/elkano.org\/blog\/?p=892"},"modified":"2015-09-18T09:52:40","modified_gmt":"2015-09-18T07:52:40","slug":"interface-bonding-ubuntu-14-04","status":"publish","type":"post","link":"https:\/\/elkano.org\/blog\/interface-bonding-ubuntu-14-04\/","title":{"rendered":"Interface bonding on Ubuntu 14.04"},"content":{"rendered":"<p>Install the required package ifenslave<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\" data-enlighter-theme=\"enlighter\" data-enlighter-language=\"null\">\r\n$ sudo apt-get install ifenslave ethtool\r\n<\/pre>\n<p>To prevent issues make sure that the bonding\u00a0 module is listed in the \/etc\/modules file. In this way the module will be loaded at boot time.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\" data-enlighter-theme=\"enlighter\" data-enlighter-language=\"null\">$ cat \/etc\/modules\r\n# \/etc\/modules: kernel modules to load at boot time.\r\n#\r\n# This file contains the names of kernel modules that should be loaded\r\n# at boot time, one per line. Lines beginning with &quot;#&quot; are ignored.\r\n# Parameters can be specified after the module name.\r\n\r\nlp\r\nrtc\r\nbonding\r\n\r\n<\/pre>\n<p>Configure the network with the new bond0 interface. <\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\" data-enlighter-theme=\"enlighter\" data-enlighter-language=\"null\">$ cat \/etc\/network\/interfaces\r\n\r\n# This file describes the network interfaces available on your system\r\n# and how to activate them. For more information, see interfaces(5).\r\n\r\n# The loopback network interface\r\nauto lo\r\niface lo inet loopback\r\n\r\n# The primary network interface\r\nauto eth0\r\niface eth0 inet manual\r\n  bond-master bond0\r\n\r\nauto eth1\r\niface eth1 inet manual\r\n  bond-master bond0\r\n\r\nauto bond0\r\niface bond0 inet manual\r\n  address 172.17.16.10\r\n  netmask 255.255.255.0\r\n  gateway 172.17.16.1\r\n  bond-miimon 100\r\n  bond-mode balance-alb\r\n  bond-slaves eth0 eth1\r\n<\/pre>\n<p>I configured here with the balance-alb mode that is able to balance the outgoing and incoming traffic without any special switch support, but the network drivers must support ethtool to retrieve the speed from them.<\/p>\n<p>The common bonding modes that are very used are:<br \/>\n&#8211; active-backup<br \/>\n&#8211; balance-alb<br \/>\n&#8211; 802.3ad<\/p>\n<p>You should check the bonding documentation and the features of each mode here:<\/p>\n<p><a href=\"https:\/\/www.kernel.org\/doc\/Documentation\/networking\/bonding.txt\" target=\"_blank\">https:\/\/www.kernel.org\/doc\/Documentation\/networking\/bonding.txt<\/a><\/p>\n<p>To check that the new bond0 interface is working:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-linenumbers=\"false\" data-enlighter-theme=\"enlighter\" data-enlighter-language=\"null\">\r\n$ sudo cat \/proc\/net\/bonding\/bond0 \r\nEthernet Channel Bonding Driver: v3.7.1 (April 27, 2011)\r\n\r\nBonding Mode: adaptive load balancing\r\nPrimary Slave: None\r\nCurrently Active Slave: eth0\r\nMII Status: up\r\nMII Polling Interval (ms): 100\r\nUp Delay (ms): 0\r\nDown Delay (ms): 0\r\n\r\nSlave Interface: eth0\r\nMII Status: up\r\nSpeed: 10000 Mbps\r\nDuplex: full\r\nLink Failure Count: 1\r\nPermanent HW addr: 0c:c4:7a:34:e8:a2\r\nSlave queue ID: 0\r\n\r\nSlave Interface: eth1\r\nMII Status: up\r\nSpeed: 10000 Mbps\r\nDuplex: full\r\nLink Failure Count: 1\r\nPermanent HW addr: 0c:c4:7a:34:e8:a3\r\nSlave queue ID: 0\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Install the required package ifenslave $ sudo apt-get install ifenslave ethtool To prevent issues make sure that the bonding\u00a0 module is listed in the \/etc\/modules file. In this way the module will be loaded at boot time. $ cat \/etc\/modules # \/etc\/modules: kernel modules to load at boot time. # # This file contains the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,27],"tags":[158,148,153],"_links":{"self":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/892"}],"collection":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/comments?post=892"}],"version-history":[{"count":7,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/892\/revisions"}],"predecessor-version":[{"id":1123,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/posts\/892\/revisions\/1123"}],"wp:attachment":[{"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/media?parent=892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/categories?post=892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elkano.org\/blog\/wp-json\/wp\/v2\/tags?post=892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}