{"id":12947,"date":"2019-03-29T03:47:28","date_gmt":"2019-03-29T03:47:28","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12947"},"modified":"2019-03-29T03:47:28","modified_gmt":"2019-03-29T03:47:28","slug":"how-to-configure-network-bonding-or-teaming-in-ubuntu","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/29\/how-to-configure-network-bonding-or-teaming-in-ubuntu\/","title":{"rendered":"How to Configure Network Bonding or Teaming in Ubuntu"},"content":{"rendered":"<p><strong>Network Interface Bonding<\/strong>\u00a0is a mechanism used in Linux servers which consists of binding more physical network interfaces in order to provide more bandwidth than a single interface can provide or provide link redundancy in case of a cable failure. This type of link redundancy has multiple names in Linux, such as\u00a0<strong>Bonding<\/strong>,\u00a0<strong>Teaming<\/strong>\u00a0or\u00a0<strong>Link Aggregation Groups<\/strong>\u00a0(<strong>LAG<\/strong>).<\/p>\n<p><strong>Read Also<\/strong>:\u00a0<a href=\"https:\/\/www.tecmint.com\/configure-network-bonding-or-teaming-in-rhel-centos-7\/\" target=\"_blank\" rel=\"noopener\">How to Setup Network Bonding or Teaming in RHEL\/CentOS<\/a><\/p>\n<p>To use network bonding mechanism in\u00a0<strong>Ubuntu<\/strong>\u00a0or\u00a0<strong>Debian<\/strong>\u00a0based Linux systems, first you need to install the bonding kernel module and test if the bonding driver is loaded via\u00a0<strong>modprobe<\/strong>\u00a0command.<\/p>\n<pre>$ sudo modprobe bonding\r\n<\/pre>\n<div id=\"attachment_29093\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Check-Network-Bonding-in-Ubuntu.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29093\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Check-Network-Bonding-in-Ubuntu.png\" alt=\"Check Network Bonding in Ubuntu\" width=\"380\" height=\"99\" aria-describedby=\"caption-attachment-29093\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29093\" class=\"wp-caption-text\">Check Network Bonding in Ubuntu<\/p>\n<\/div>\n<p>On older releases of\u00a0<strong>Debian<\/strong>\u00a0or\u00a0<strong>Ubuntu<\/strong>\u00a0you should install\u00a0<strong>ifenslave<\/strong>\u00a0package by issuing the below command.<\/p>\n<pre>$ sudo apt-get install ifenslave<\/pre>\n<p>To create a bond interface composed of the first two physical NCs in your system, issue the below command. However this method of creating bond interface is ephemeral and does not survive system reboot.<\/p>\n<pre>$ sudo ip link add bond0 type bond mode 802.3ad\r\n$ sudo ip link set eth0 master bond0\r\n$ sudo ip link set eth1 master bond0\r\n<\/pre>\n<p>To create a permanent bond interface in\u00a0<strong>mode 0<\/strong>\u00a0type, use the method to manually edit interfaces configuration file, as shown in the below excerpt.<\/p>\n<pre>$ sudo nano \/etc\/network\/interfaces\r\n<\/pre>\n<pre># The primary network interface\r\nauto bond0\r\niface bond0 inet static\r\n\taddress 192.168.1.150\r\n\tnetmask 255.255.255.0\t\r\n\tgateway 192.168.1.1\r\n\tdns-nameservers 192.168.1.1 8.8.8.8\r\n\tdns-search domain.local\r\n\t\tslaves eth0 eth1\r\n\t\tbond_mode 0\r\n\t\tbond-miimon 100\r\n\t\tbond_downdelay 200\r\n\t\tbound_updelay 200\r\n<\/pre>\n<div id=\"attachment_29094\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Configure-Bonding-in-Ubuntu.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29094\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Configure-Bonding-in-Ubuntu.jpg\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Configure-Bonding-in-Ubuntu.jpg 960w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Configure-Bonding-in-Ubuntu-768x426.jpg 768w\" alt=\"Configure Bonding in Ubuntu\" width=\"960\" height=\"533\" aria-describedby=\"caption-attachment-29094\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29094\" class=\"wp-caption-text\">Configure Bonding in Ubuntu<\/p>\n<\/div>\n<p>In order to activate the\u00a0<strong>bond interface<\/strong>, either restart network service, bring down the physical interface and rise the\u00a0<strong>bond interface<\/strong>\u00a0or\u00a0<strong>reboot<\/strong>\u00a0the machine in order for the kernel to pick-up the new bond interface.<\/p>\n<pre>$ sudo systemctl restart networking.service\r\nor\r\n$ sudo ifdown eth0 &amp;&amp; ifdown eth1 &amp;&amp; ifup bond0\r\n<\/pre>\n<p>The bond interface settings can be inspected by issuing the below commands.<\/p>\n<pre>$ ifconfig \r\nor \r\n$ ip a\r\n<\/pre>\n<div id=\"attachment_29095\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Verify-Bond-Interface-in-Ubuntu.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29095\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Verify-Bond-Interface-in-Ubuntu.jpg\" sizes=\"auto, (max-width: 915px) 100vw, 915px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Verify-Bond-Interface-in-Ubuntu.jpg 915w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Verify-Bond-Interface-in-Ubuntu-768x607.jpg 768w\" alt=\"Verify Bond Interface in Ubuntu\" width=\"915\" height=\"723\" aria-describedby=\"caption-attachment-29095\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29095\" class=\"wp-caption-text\">Verify Bond Interface in Ubuntu<\/p>\n<\/div>\n<p>Details about the bond interface can be obtained by displaying the content of the below kernel file using\u00a0<a href=\"https:\/\/www.tecmint.com\/13-basic-cat-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">cat command<\/a>\u00a0as shown.<\/p>\n<pre>$ cat \/proc\/net\/bonding\/bond0\r\n<\/pre>\n<div id=\"attachment_29096\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Check-Bonding-Information-in-Ubuntu.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29096\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Check-Bonding-Information-in-Ubuntu.jpg\" sizes=\"auto, (max-width: 867px) 100vw, 867px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Check-Bonding-Information-in-Ubuntu.jpg 867w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Check-Bonding-Information-in-Ubuntu-768x562.jpg 768w\" alt=\"Check Bonding Information in Ubuntu\" width=\"867\" height=\"634\" aria-describedby=\"caption-attachment-29096\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29096\" class=\"wp-caption-text\">Check Bonding Information in Ubuntu<\/p>\n<\/div>\n<p>To investigate other bond interface messages or to debug the state of the bond physical NICS, issue the below commands.<\/p>\n<pre>$ tail -f \/var\/log\/messages\r\n<\/pre>\n<div id=\"attachment_29097\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Check-Bond-Interface-Messages.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29097\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Check-Bond-Interface-Messages.png\" alt=\"Check Bond Interface Messages\" width=\"720\" height=\"400\" aria-describedby=\"caption-attachment-29097\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29097\" class=\"wp-caption-text\">Check Bond Interface Messages<\/p>\n<\/div>\n<p>Next use\u00a0<strong>mii-tool<\/strong>\u00a0tool to check Network Interface Controller (NIC) parameters as shown.<\/p>\n<pre>$ mii-tool\r\n<\/pre>\n<div id=\"attachment_29098\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Check-Bond-Interface-Link.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29098\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/04\/Check-Bond-Interface-Link.png\" alt=\"Check Bond Interface Link\" width=\"516\" height=\"92\" aria-describedby=\"caption-attachment-29098\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-29098\" class=\"wp-caption-text\">Check Bond Interface Link<\/p>\n<\/div>\n<p>The types of Network Bonding are listed below.<\/p>\n<ul>\n<li><strong>mode=0<\/strong>\u00a0(balance-rr)<\/li>\n<li><strong>mode=1<\/strong>\u00a0(active-backup)<\/li>\n<li><strong>mode=2<\/strong>\u00a0(balance-xor)<\/li>\n<li><strong>mode=3<\/strong>\u00a0(broadcast)<\/li>\n<li><strong>mode=4<\/strong>\u00a0(802.3ad)<\/li>\n<li><strong>mode=5<\/strong>\u00a0(balance-tlb)<\/li>\n<li><strong>mode=6<\/strong>\u00a0(balance-alb)<\/li>\n<\/ul>\n<p>The full documentations regarding NIC bonding can be found at\u00a0<a href=\"https:\/\/www.kernel.org\/doc\/Documentation\/networking\/bonding.txt\" target=\"_blank\" rel=\"nofollow noopener\">Linux kernel doc pages<\/a>.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/configure-network-bonding-teaming-in-ubuntu\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Network Interface Bonding\u00a0is a mechanism used in Linux servers which consists of binding more physical network interfaces in order to provide more bandwidth than a single interface can provide or provide link redundancy in case of a cable failure. This type of link redundancy has multiple names in Linux, such as\u00a0Bonding,\u00a0Teaming\u00a0or\u00a0Link Aggregation Groups\u00a0(LAG). Read Also:\u00a0How &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/29\/how-to-configure-network-bonding-or-teaming-in-ubuntu\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Configure Network Bonding or Teaming in Ubuntu&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12947","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12947"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12947\/revisions"}],"predecessor-version":[{"id":12948,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12947\/revisions\/12948"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}