{"id":371,"date":"2012-10-07T11:19:01","date_gmt":"2012-10-07T09:19:01","guid":{"rendered":"http:\/\/songoku.homelinux.com\/wordpress\/?p=371"},"modified":"2012-10-07T11:19:01","modified_gmt":"2012-10-07T09:19:01","slug":"nic-bonding-port-trunking-with-centosrhel","status":"publish","type":"post","link":"https:\/\/ndk.sytes.net\/wordpress\/?p=371","title":{"rendered":"NIC Bonding \/ Port Trunking with CentOS\/RHEL"},"content":{"rendered":"<p>\n\tHello,\n<\/p>\n<p>\n\twith NIC Bonding or Port Trunking you can provide higher throughput and redundency to your network cards. Basically it bonds two, let&#39;s say 1Gb network cards, to one 2Gb card. Bonding can be achieved with more than 2 cards in a system.\n<\/p>\n<p>\n\tThere are several modes:\n<\/p>\n<p>\n\t<strong>Mode 0 (round-robin &#8211; load balancing\/fault tolerence):<\/strong><br \/>\n\tThis is the default mode and sends packets from the first to the last slave.&nbsp;1st packet -&gt; 1st NIC, 2nd packet -&gt; 2nd NIC, 3rd packet -&gt; 1st NIC etc&#8230;\n<\/p>\n<p>\n\t<strong>Mode 1 (active backup &#8211; fault tolerence):<\/strong><br \/>\n\tIn this mode only 1 card\/slave is active at the moment. Another takes over as soon as the other goes down. Only the MAC address of the bond is visible on the outside.\n<\/p>\n<p>\n\t<strong>Mode 2 (balance-xor &#8211; load balancing\/fault tolerence &#8211; Static Link Aggregation):<\/strong><br \/>\n\tIn this mode every destination gets the packets from the same source address based on MAC addresses.\n<\/p>\n<p>\n\t<strong>Mode 3 (broadcast &#8211; fault tolerence):<\/strong><br \/>\n\tIn this mode all packets go out on every interface. Incoming traffic is not affected.\n<\/p>\n<p>\n\t<strong>Mode 4 (802.3ad &#8211; Dynamic Link Aggregation, LACP):<\/strong><br \/>\n\tIn this mode there is a group created wth the same speed an duplex possibilities according to IEEE 802.3ad. There are some prerequisites fot this: Ethtool support in drivers to get speed and duplex of each slave and a switch which supports 802.3ad.\n<\/p>\n<p>\n\t<strong>Mode 5 (balance-tlb &#8211; load balancing):<\/strong><br \/>\n\tIn this mode the outgoing packets are distributed over all slaves, but only the active slaves receives packets. If this goes down another slave takes over.\n<\/p>\n<p>\n\t<strong>Mode 6 (balance-alb &#8211; load balancing):<\/strong><br \/>\n\tIn this mode all outgoing and incoming traffic in distributed over all salves.\n<\/p>\n<p>\n\tNow after shortly explaining all modes here how to create such a bond:\n<\/p>\n<ul>\n<li>\n\t\tadd these lines to <em>\/etc\/modprobe.conf:<br \/>\n\t\talias bond0 bonding<\/em>\n\t<\/li>\n<li>\n\t\tcreate and open the file <em>\/etc\/sysconfig\/network-scripts\/ifcfg-bond0:<\/em><br \/>\n\t\t<em>DEVICE=bond0<br \/>\n\t\tIPADDR=&lt;ip address&gt;<br \/>\n\t\tNETMASK=&lt;your netmask&gt;<br \/>\n\t\tNETWORK=&lt;network&gt;<br \/>\n\t\tBROADCAST=&lt;broadcast&gt;<br \/>\n\t\tGATEWAY=&lt;gateway&gt;<br \/>\n\t\tONBOOT=yes<br \/>\n\t\tBOOTPROTO=none<br \/>\n\t\tUSERCTL=no<br \/>\n\t\t<span style=\"white-space: pre-wrap; line-height: 1.6;\">BONDING_OPTS=&quot;mode=&lt;your selected mode (0-6)&gt; miimon=100&quot;<\/span><\/em>\n\t<\/li>\n<li>\n\t\tthen change your \/etc\/sysconfig\/network-scripts\/ifcfg-ethX files to:<br \/>\n\t\t<em>DEVICE=ethX<br \/>\n\t\tONBOOT=yes<br \/>\n\t\tBOOTPROTO=none<br \/>\n\t\tUSERCTL=no<br \/>\n\t\tMASTER=bond0<br \/>\n\t\tSLAVE=yes<\/em>\n\t<\/li>\n<\/ul>\n<p>\n\tNow you should only need to restart your server. If you can&#39;t restart it please load the bond kernel module and restart your network:\n<\/p>\n<p>\n\t<em># modprobe bonding<br \/>\n\t<strong>(ATTENTION: My host&#39;s connection froze here and i had to go to the physical server to restart the network)<\/strong><\/em><br \/>\n\t<em># \/etc\/init.d\/network restart<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, with NIC Bonding or Port Trunking you can provide higher throughput and redundency to your network cards. Basically it bonds two, let&#39;s say 1Gb network cards, to one 2Gb card. Bonding can be achieved with more than 2 cards in a system. There are several modes: Mode 0 (round-robin &#8211; load balancing\/fault tolerence): This [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,7],"tags":[],"class_list":["post-371","post","type-post","status-publish","format-standard","hentry","category-linuxunix","category-servers"],"_links":{"self":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/371","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=371"}],"version-history":[{"count":0,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/371\/revisions"}],"wp:attachment":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}