{"id":268,"date":"2025-07-15T08:51:28","date_gmt":"2025-07-15T00:51:28","guid":{"rendered":"https:\/\/www.rbfwq.com\/blog\/?p=268"},"modified":"2025-07-15T08:51:28","modified_gmt":"2025-07-15T00:51:28","slug":"%e7%bd%91%e5%8d%a1bond%e6%a8%a1%e5%bc%8f%e7%9a%84%e6%9c%80%e4%bd%b3%e5%ae%9e%e8%b7%b5%e4%b8%8e%e5%ba%94%e7%94%a8%e5%9c%ba%e6%99%af%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"https:\/\/www.idc61.com\/blog\/268.html","title":{"rendered":"\u7f51\u5361bond\u6a21\u5f0f\u7684\u6700\u4f73\u5b9e\u8df5\u4e0e\u5e94\u7528\u573a\u666f\u5206\u6790"},"content":{"rendered":"<p><p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.idc61.com\/blog\/wp-content\/uploads\/2025\/06\/3G96Re.jpg\" alt=\"\u7f51\u5361bond\u6a21\u5f0f\u7684\u6700\u4f73\u5b9e\u8df5\u4e0e\u5e94\u7528\u573a\u666f\u5206\u6790\" title=\"\u7f51\u5361bond\u6a21\u5f0f\u7684\u6700\u4f73\u5b9e\u8df5\u4e0e\u5e94\u7528\u573a\u666f\u5206\u6790\"><\/p>\n<p><h3>1. \u7f51\u5361bond\u6a21\u5f0f\u6982\u8ff0<\/h3>\n<\/p>\n<p>\u7f51\u5361bond\u6a21\u5f0f\u662f\u5c06\u591a\u4e2a\u7269\u7406\u7f51\u5361\u7ed3\u5408\u5728\u4e00\u8d77\uff0c\u4ee5\u5f62\u6210\u4e00\u4e2a\u903b\u8f91\u63a5\u53e3\u7684\u4e00\u79cd\u7f51\u7edc\u914d\u7f6e\u65b9\u5f0f\u3002\u901a\u8fc7\u8fd9\u4e00\u6a21\u5f0f\uff0c\u7528\u6237\u53ef\u4ee5\u540c\u65f6\u63d0\u5347\u5e26\u5bbd\u4ee5\u53ca\u63d0\u9ad8\u7f51\u7edc\u5197\u4f59\u6027\uff0c\u4ece\u800c\u6539\u5584\u6574\u4f53\u7f51\u7edc\u6027\u80fd\u3002\u4e3b\u8981\u6709\u51e0\u79cd\u4e0d\u540c\u7684bonding\u6a21\u5f0f\uff0c\u6db5\u76d6\u4e86\u4e3b\u5907\u3001\u9ad8\u53ef\u7528\u8d1f\u8f7d\u5747\u8861\u7b49\u9700\u6c42\u3002<\/p>\n<\/p>\n<p>\n<h3>2. \u652f\u6301\u7684bonding\u6a21\u5f0f<\/h3>\n<\/p>\n<p>\u5e38\u7528\u7684\u7f51\u5361bond\u6a21\u5f0f\u6709\u51e0\u79cd\uff0c\u6bcf\u79cd\u6a21\u5f0f\u90fd\u6709\u5176\u7279\u5b9a\u7684\u4f7f\u7528\u573a\u666f\u548c\u4f18\u52bf\u3002\u4ee5\u4e0b\u662f\u51e0\u79cd\u5e38\u89c1\u7684bonding\u6a21\u5f0f\uff1a<\/p>\n<ul>\n<li><b>Mode 0 (Round Robin)<\/b>\uff1a\u5728\u8fd9\u79cd\u6a21\u5f0f\u4e0b\uff0c\u6240\u6709\u7684\u7f51\u5361\u90fd\u4f1a\u8f6e\u6d41\u53d1\u9001\u6570\u636e\u5305\uff0c\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861\u3002<\/li>\n<li><b>Mode 1 (Active Backup)<\/b>\uff1a\u53ea\u6709\u4e00\u4e2a\u4e3b\u7f51\u5361\u5728\u5de5\u4f5c\uff0c\u5176\u4ed6\u5361\u4f5c\u4e3a\u5907\u7528\uff0c\u53ea\u6709\u5728\u4e3b\u7f51\u5361\u6545\u969c\u65f6\u624d\u6fc0\u6d3b\u3002<\/li>\n<li><b>Mode 2 (XOR)<\/b>\uff1a\u901a\u8fc7\u6e90MAC\u5730\u5740\u548c\u76ee\u7684MAC\u5730\u5740\u7684XOR\u7ed3\u679c\u51b3\u5b9a\u53d1\u9001\u7684\u7f51\u5361\uff0c\u662f\u4e00\u79cd\u7b80\u5355\u7684\u8d1f\u8f7d\u5747\u8861\u65b9\u6848\u3002<\/li>\n<li><b>Mode 3 (Broadcast)<\/b>\uff1a\u6240\u6709\u7684\u7f51\u5361\u90fd\u4f1a\u53d1\u9001\u76f8\u540c\u7684\u6570\u636e\u5305\uff0c\u9002\u7528\u4e8e\u5bf9\u53ef\u9760\u6027\u8981\u6c42\u6781\u9ad8\u7684\u573a\u666f\u3002<\/li>\n<li><b>Mode 4 (802.3ad)<\/b>\uff1a\u6839\u636eIEEE 802.3ad\u6807\u51c6\u8fdb\u884c\u94fe\u8def\u805a\u5408\uff0c\u9002\u5408\u652f\u6301\u8be5\u6807\u51c6\u7684\u4ea4\u6362\u673a\u3002<\/li>\n<li><b>Mode 5 (Balance TCP)<\/b>\uff1a\u9002\u5408TCP\u8fde\u63a5\u7684\u8d1f\u8f7d\u5747\u8861\uff0c\u80fd\u63d0\u9ad8\u7f51\u7edc\u7684\u541e\u5410\u91cf\u3002<\/li>\n<li><b>Mode 6 (Balance VLAN)<\/b>\uff1a\u6839\u636eVLAN\u6807\u7b7e\u8fdb\u884c\u8d1f\u8f7d\u5747\u8861\uff0c\u9002\u7528\u4e8e\u865a\u62df\u5316\u73af\u5883\u3002<\/li>\n<li><b>Mode 7 (Adaptive Load Balancing)<\/b>\uff1a\u7ed3\u5408\u4e86\u53d1\u9001\u548c\u63a5\u6536\u7684\u8d1f\u8f7d\u5747\u8861\uff0c\u81ea\u52a8\u8c03\u8282\u6d41\u91cf\u3002<\/li>\n<\/ul>\n<\/p>\n<p>\n<h3>3. \u5982\u4f55\u914d\u7f6e\u7f51\u5361bond\u6a21\u5f0f<\/h3>\n<\/p>\n<p>\u7f51\u5361bond\u6a21\u5f0f\u7684\u914d\u7f6e\u6b65\u9aa4\u5e76\u4e0d\u590d\u6742\uff0c\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u64cd\u4f5c\u6765\u5b8c\u6210\u3002\u4ee5Linux\u73af\u5883\u4e3a\u4f8b\uff0c\u4ee5\u4e0b\u662f\u914d\u7f6e\u7f51\u5361bond\u7684\u57fa\u672c\u6b65\u9aa4\uff1a<\/p>\n<p><pre><code><\/p>\r\n<p># \u5b89\u88c5bonding\u6a21\u5757<\/p>\r\n<p>modprobe bonding<\/p>\r\n\r\n<p># \u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6<\/p>\r\n<p>nano \/etc\/sysconfig\/network-scripts\/ifcfg-bond0<\/p>\r\n<p>```<\/p>\r\n<p>\u5185\u5bb9\u793a\u4f8b\uff1a<\/p>\r\n<p>```<\/p>\r\n<p>DEVICE=bond0<\/p>\r\n<p>TYPE=Bond<\/p>\r\n<p>BONDING_OPTS=\"mode=1 miimon=100\"<\/p>\r\n<p>ONBOOT=yes<\/p>\r\n<p>IPADDR=192.168.1.100<\/p>\r\n<p>NETMASK=255.255.255.0<\/p>\r\n<p>```<\/p>\r\n\r\n<p># \u7f16\u8f91\u7269\u7406\u7f51\u5361\u914d\u7f6e\u6587\u4ef6<\/p>\r\n<p>nano \/etc\/sysconfig\/network-scripts\/ifcfg-eth0<\/p>\r\n<p>\u5185\u5bb9\u793a\u4f8b\uff1a<\/p>\r\n<p>```<\/p>\r\n<p>DEVICE=eth0<\/p>\r\n<p>MASTER=bond0<\/p>\r\n<p>SLAVE=yes<\/p>\r\n<p>ONBOOT=yes<\/p>\r\n<p>```<\/p>\r\n\r\n<p># \u542f\u52a8bonding<\/p>\r\n<p>ifcfg-bond0<\/p>\r\n\r\n<p><pre><\/code><\/p>\r\n\r\n<p>\u542f\u52a8\u6240\u6709\u7f51\u5361\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u6700\u540e\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u9a8c\u8bc1bonding\u72b6\u6001\uff1a<\/p>\r\n\r\n\r\n<p><pre><code><\/p>\r\n<p>cat \/proc\/net\/bonding\/bond0<\/p>\r\n<p><\/pre>\n<p><\/code><\/p>\n<\/p>\n<p>\n<h3>4. \u63a8\u8350bonding\u6a21\u5f0f<\/h3>\n<\/p>\n<p>\u5728\u9009\u62e9bonding\u6a21\u5f0f\u65f6\uff0c\u63a8\u8350\u4f7f\u7528Mode 4\uff08802.3ad\uff09\u6a21\u5f0f\uff0c\u524d\u63d0\u662f\u4ea4\u6362\u673a\u7684\u7aef\u53e3\u4e5f\u652f\u6301\u8be5\u6a21\u5f0f\u3002802.3ad\u63d0\u4f9b\u4e86\u826f\u597d\u7684\u8d1f\u8f7d\u5747\u8861\u548c\u6545\u969c\u8f6c\u79fb\u80fd\u529b\uff0c\u5c24\u5176\u5728\u9ad8\u8d1f\u8f7d\u73af\u5883\u4e0b\u6027\u80fd\u51fa\u8272\u3002\u7136\u800c\u5728\u4e0d\u5177\u5907\u4ea4\u6362\u673a\u652f\u6301\u7684\u60c5\u51b5\u4e0b\uff0cMode 1\uff08Active Backup\uff09\u662f\u4e00\u4e2a\u6b21\u4f18\u9009\u62e9\uff0c\u786e\u4fdd\u5728\u4e3b\u5361\u6545\u969c\u65f6\u7f51\u7edc\u7ee7\u7eed\u53ef\u7528\u3002<\/p>\n<\/p>\n<p>\n<h3>5. \u4e3a\u4ec0\u4e48\u4f7f\u7528\u7f51\u5361bond\u6a21\u5f0f\uff1f<\/h3>\n<\/p>\n<p>\u5982\u679c\u4f60\u5728\u95ee<b>\u4e3a\u4ec0\u4e48\u9700\u8981\u4f7f\u7528\u7f51\u5361bond\u6a21\u5f0f\uff1f<\/b>\u9996\u5148\uff0c\u7f51\u5361bond\u6a21\u5f0f\u53ef\u4ee5\u63d0\u9ad8\u7f51\u7edc\u7684\u5e26\u5bbd\uff0c\u901a\u8fc7\u591a\u6761\u7269\u7406\u8fde\u63a5\u540c\u65f6\u4f20\u8f93\u6570\u636e\uff0c\u5b9e\u73b0\u66f4\u9ad8\u7684\u603b\u5e26\u5bbd\u3002\u5176\u6b21\uff0c\u5728\u4fdd\u8bc1\u5197\u4f59\u6027\u65b9\u9762\uff0c\u8be5\u6a21\u5f0f\u80fd\u591f\u63d0\u4f9b\u66f4\u597d\u7684\u6545\u969c\u6062\u590d\uff0c\u51cf\u5c11\u5355\u70b9\u6545\u969c\u5e26\u6765\u7684\u5f71\u54cd\u3002\u6b64\u5916\uff0c\u7f51\u5361bond\u6a21\u5f0f\u80fd\u591f\u63d0\u5347\u7f51\u7edc\u7684\u53ef\u7528\u6027\uff0c\u5c24\u5176\u662f\u5728\u4f01\u4e1a\u7ea7\u73af\u5883\u4e2d\u3002<\/p>\n<\/p>\n<p>\n<h3>6. \u7f51\u5361bond\u6a21\u5f0f\u9002\u5408\u54ea\u4e9b\u573a\u666f\uff1f<\/h3>\n<\/p>\n<p>\u5bf9\u4e8e<b>\u7f51\u5361bond\u6a21\u5f0f\u9002\u5408\u4ec0\u4e48\u573a\u666f\uff1f<\/b>\u4e00\u822c\u6765\u8bf4\uff0c\u6570\u636e\u4e2d\u5fc3\u3001\u9ad8\u6d41\u91cf\u7f51\u7ad9\u3001\u4f01\u4e1a\u529e\u516c\u73af\u5883\u53ca\u865a\u62df\u5316\u73af\u5883\u7b49\u573a\u666f\u975e\u5e38\u9002\u5408\u4f7f\u7528\u7f51\u5361bond\u6a21\u5f0f\u3002\u8fd9\u4e9b\u573a\u666f\u901a\u5e38\u5bf9\u5e26\u5bbd\u548c\u53ef\u9760\u6027\u6709\u8f83\u9ad8\u8981\u6c42\uff0cbond\u6a21\u5f0f\u80fd\u5f88\u597d\u6ee1\u8db3\u8fd9\u4e9b\u9700\u6c42\u3002\u5c24\u5176\u662f\u5728\u7269\u7406\u7f51\u5361\u6570\u91cf\u6709\u9650\u6216\u8005\u5e0c\u671b\u51cf\u5c11\u8bbe\u5907\u6295\u8d44\u7684\u60c5\u51b5\u4e0b\uff0cbond\u6a21\u5f0f\u7684\u914d\u7f6e\u5c24\u5176\u6709\u610f\u4e49\u3002<\/p>\n<\/p>\n<p>\n<h3>7. \u5982\u4f55\u76d1\u63a7\u7f51\u5361bond\u7684\u6027\u80fd\uff1f<\/h3>\n<\/p>\n<p>\u5173\u4e8e<b>\u7f51\u5361bond\u7684\u6027\u80fd\u76d1\u63a7\u65b9\u5f0f\u6709\u54ea\u4e9b\uff1f<\/b>\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u5de5\u5177\u8fdb\u884c\u76d1\u63a7\uff0c\u5404\u79cdLinux\u547d\u4ee4\u5982iftop\u3001nload\u3001vnstat\u7b49\u5747\u80fd\u6709\u6548\u68c0\u6d4b\u6d41\u91cf\uff1b\u800c\u66f4\u4e3a\u9ad8\u7ea7\u7684\u5de5\u5177\u5982Nagios\u3001Zabbix\u7b49\u76d1\u63a7\u7cfb\u7edf\u80fd\u591f\u5b9e\u65f6\u76d1\u63a7\u7f51\u7edc\u7684\u6027\u80fd\u72b6\u51b5\u3002\u7f51\u7edc\u6d41\u91cf\u7684\u76d1\u63a7\u6709\u52a9\u4e8e\u53ca\u65f6\u53d1\u73b0\u6f5c\u5728\u7684\u95ee\u9898\uff0c\u4ece\u800c\u63d0\u9ad8\u7f51\u7edc\u7684\u53ef\u9760\u6027\u53ca\u6027\u80fd\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u7f51\u5361bond\u6a21\u5f0f\u6982\u8ff0 \u7f51\u5361bond\u6a21\u5f0f\u662f\u5c06\u591a\u4e2a\u7269\u7406\u7f51\u5361\u7ed3\u5408\u5728\u4e00\u8d77\uff0c\u4ee5\u5f62\u6210\u4e00\u4e2a\u903b\u8f91\u63a5\u53e3\u7684\u4e00\u79cd\u7f51\u7edc\u914d\u7f6e\u65b9\u5f0f\u3002\u901a\u8fc7\u8fd9\u4e00\u6a21\u5f0f\uff0c\u7528\u6237\u53ef\u4ee5\u540c\u65f6\u63d0\u5347\u5e26\u5bbd\u4ee5\u53ca\u63d0\u9ad8\u7f51\u7edc\u5197\u4f59\u6027\uff0c\u4ece\u800c\u6539\u5584\u6574\u4f53\u7f51\u7edc\u6027\u80fd\u3002\u4e3b\u8981\u6709\u51e0\u79cd\u4e0d\u540c\u7684bonding\u6a21\u5f0f\uff0c\u6db5\u76d6\u4e86\u4e3b\u5907\u3001\u9ad8\u53ef\u7528&#8230;<\/p>\n","protected":false},"author":1,"featured_media":269,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[95,94,93],"topic":[],"class_list":["post-268","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jishu","tag-bond","tag-94","tag-93"],"_links":{"self":[{"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/posts\/268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/comments?post=268"}],"version-history":[{"count":1,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/posts\/268\/revisions"}],"predecessor-version":[{"id":271,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/posts\/268\/revisions\/271"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/media\/269"}],"wp:attachment":[{"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/media?parent=268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/categories?post=268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/tags?post=268"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.idc61.com\/blog\/wp-json\/wp\/v2\/topic?post=268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}