{"id":135,"date":"2015-10-27T11:48:22","date_gmt":"2015-10-27T11:48:22","guid":{"rendered":"http:\/\/luliserver.com.ar\/?p=135"},"modified":"2023-12-19T23:42:52","modified_gmt":"2023-12-20T02:42:52","slug":"how-to-bonding-en-debian","status":"publish","type":"post","link":"http:\/\/luliserver.com.ar\/?p=135","title":{"rendered":"HOW TO: Bonding en Debian"},"content":{"rendered":"<p>Configuramos el archivo: <code>\/etc\/network\/interfaces<\/code><\/p>\n<pre>\/etc\/network\/interfaces\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\n#allow-hotplug eth0\r\n#iface eth0 inet dhcp\r\n\r\n#auto eth0\r\n#iface eth0 inet dhcp\r\n\r\n#auto eth1\r\n#iface eth1 inet dhcp\r\n\r\nauto bond0\r\niface bond0 inet static\r\n    address 10.104.0.10\r\n    netmask 255.255.248.0\r\n    gateway 10.104.0.1\r\n    slaves eth0 eth1\r\n    bond_mode balance-rr\r\n    bond_miimon 100\r\n    bond_downdelay 200\r\n    bond_updelay 200<\/pre>\n<p>Reiniciamos las interfaces:<br \/>\n<code>\/etc\/init.d\/networking restart<\/code><\/p>\n<p>Leemos el siguiente archivo para saber el estado del bonding creado:<br \/>\n<code>cat \/proc\/net\/bonding\/bond0<\/code><\/p>\n<pre>\r\ncat \/proc\/net\/bonding\/bond0\r\nEthernet Channel Bonding Driver: v3.7.1 (April 27, 2011)\r\n\r\nBonding Mode: load balancing (round-robin)\r\nMII Status: up\r\nMII Polling Interval (ms): 100\r\nUp Delay (ms): 200\r\nDown Delay (ms): 200\r\n\r\nSlave Interface: eth0\r\nMII Status: up\r\nSpeed: 1000 Mbps\r\nDuplex: full\r\nLink Failure Count: 0\r\nPermanent HW addr: c8:60:00:c0:b9:9b\r\nSlave queue ID: 0\r\n\r\nSlave Interface: eth1\r\nMII Status: down\r\nSpeed: 10 Mbps\r\nDuplex: half\r\nLink Failure Count: 3\r\nPermanent HW addr: 00:1c:f0:9c:62:58\r\nSlave queue ID: 0\r\n<\/pre>\n<pre>\r\nModo\tTolerancia\tBalanceo\tDescripci\u00f3n\r\n0\tS\u00ed\t\tS\u00ed  \t\t[balance-rr]    Balanceo Round-Robin\r\n1\tS\u00ed\t\tNo  \t\t[active-backup] Backup Activo\r\n2\tS\u00ed\t\tS\u00ed  \t\t[balance-xor]   Seg\u00fan MAC\r\n3\tS\u00ed\t\tNo  \t\t[broadcast]\r\n4\tS\u00ed\t\tS\u00ed  \t\t[802.3ad]       Crea grupos esclavos con la misma configuraci\u00f3n\r\n5\tS\u00ed\t\tS\u00ed  \t\t[balance-tlb]   Transmit Load Balancing\r\n6\tS\u00ed\t\tS\u00ed  \t\t[balance-alb]   Adaptative Load Balancing (con una \u00fanica MAC)\r\n<\/pre>\n<p>El siguiente c\u00f3digo esta hecho en perl y sirve para consultar el estado del bonding:<br \/>\n<a href=\"https:\/\/github.com\/ankkzz\/getBondStatus\/\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/ankkzz\/getBondStatus\/<\/a><\/p>\n<p>Sino tenemos el siguiente script que te saca de apuros, que postearon en serverfault:<\/p>\n<pre>\r\nif [ `grep -c down \/proc\/net\/bonding\/bond0` -eq 1 ]; then\r\n    echo \"`date +%c`\" | \\\r\n    mail -s \"$(grep -B1 down \/proc\/net\/bonding\/bond0 | head -1 | \\\r\n    awk -F': ' '{ print $2 }') is down\" your@email.address \r\nfi\r\n<\/pre>\n<blockquote><p>Fuente:<br \/>\n<a href=\"http:\/\/kudithipudi.org\/2010\/07\/30\/how-to-check-status-of-bond-interface-in-linux\/\" target=\"_blank\" rel=\"noopener\">http:\/\/kudithipudi.org\/2010\/07\/30\/how-to-check-status-of-bond-interface-in-linux\/<\/a><br \/>\n<a href=\"https:\/\/github.com\/ankkzz\/getBondStatus\/blob\/master\/getBondStatus\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/ankkzz\/getBondStatus\/blob\/master\/getBondStatus<\/a><br \/>\n<a href=\"http:\/\/serverfault.com\/questions\/312207\/how-do-people-monitor-the-status-of-bonding-slave-interfaces-on-linux\" target=\"_blank\" rel=\"noopener\">http:\/\/serverfault.com\/questions\/312207\/how-do-people-monitor-the-status-of-bonding-slave-interfaces-on-linux<\/a>\n<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Configuramos el archivo: \/etc\/network\/interfaces \/etc\/network\/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[15,2],"tags":[24,67,66,49,68],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-bash","category-scripts","tag-bash","tag-bond","tag-bonding","tag-debian","tag-interfaces"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8Ixc0-2b","_links":{"self":[{"href":"http:\/\/luliserver.com.ar\/index.php?rest_route=\/wp\/v2\/posts\/135"}],"collection":[{"href":"http:\/\/luliserver.com.ar\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/luliserver.com.ar\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/luliserver.com.ar\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/luliserver.com.ar\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=135"}],"version-history":[{"count":9,"href":"http:\/\/luliserver.com.ar\/index.php?rest_route=\/wp\/v2\/posts\/135\/revisions"}],"predecessor-version":[{"id":447,"href":"http:\/\/luliserver.com.ar\/index.php?rest_route=\/wp\/v2\/posts\/135\/revisions\/447"}],"wp:attachment":[{"href":"http:\/\/luliserver.com.ar\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/luliserver.com.ar\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/luliserver.com.ar\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}