{"id":76965,"date":"2023-08-28T10:11:05","date_gmt":"2023-08-28T02:11:05","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=76965"},"modified":"2023-08-28T10:11:05","modified_gmt":"2023-08-28T02:11:05","slug":"analysis-bongmode","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/analysis-bongmode.html","title":{"rendered":"\u5256\u6790\u7f51\u5361\u7ed1\u5b9a\u6a21\u5f0f"},"content":{"rendered":"

\u76ee\u524d\u7f51\u5361\u7ed1\u5b9amode\u5171\u6709\u4e03\u79cd(0~6)bond0\u3001bond1\u3001bond2\u3001bond3\u3001bond4\u3001bond5\u3001bond6<\/p>\n

\"\"<\/p>\n

\u5e38\u7528\u7684\u6709\u4e09\u79cd:<\/strong><\/div>\n

mode=0\uff1a\u5e73\u8861\u8d1f\u8f7d\u6a21\u5f0f\uff0c\u6709\u81ea\u52a8\u5907\u63f4\uff0c\u4f46\u9700\u8981\u201dSwitch\u201d\u652f\u63f4\u53ca\u8bbe\u5b9a\u3002<\/p>\n

mode=1\uff1a\u81ea\u52a8\u5907\u63f4\u6a21\u5f0f\uff0c\u5176\u4e2d\u4e00\u6761\u7ebf\u82e5\u65ad\u7ebf\uff0c\u5176\u4ed6\u7ebf\u8def\u5c06\u4f1a\u81ea\u52a8\u5907\u63f4\u3002<\/p>\n

mode=6\uff1a\u5e73\u8861\u8d1f\u8f7d\u6a21\u5f0f\uff0c\u6709\u81ea\u52a8\u5907\u63f4\uff0c\u4e0d\u5fc5\u201dSwitch\u201d\u652f\u63f4\u53ca\u8bbe\u5b9a\u3002<\/p>\n

\u8bf4\u660e:<\/strong><\/span><\/div>\n

\u9700\u8981\u8bf4\u660e\u7684\u662f\u5982\u679c\u60f3\u505a\u6210mode 0\u7684\u8d1f\u8f7d\u5747\u8861,\u4ec5\u4ec5\u8bbe\u7f6e\u8fd9\u91ccoptionsbond0 miimon=100 mode=0\u662f\u4e0d\u591f\u7684,\u4e0e\u7f51\u5361\u76f8\u8fde\u7684\u4ea4\u6362\u673a\u5fc5\u987b\u505a\u7279\u6b8a\u914d\u7f6e\uff08\u8fd9\u4e24\u4e2a\u7aef\u53e3\u5e94\u8be5\u91c7\u53d6\u805a\u5408\u65b9\u5f0f\uff09\uff0c\u56e0\u4e3a\u505abonding\u7684\u8fd9\u4e24\u5757\u7f51\u5361\u662f\u4f7f\u7528\u540c\u4e00\u4e2aMAC\u5730\u5740.\u4ece\u539f\u7406\u5206\u6790\u4e00\u4e0b\uff08bond\u8fd0\u884c\u5728mode0\u4e0b\uff09\uff1a<\/p>\n

mode 0\u4e0bbond\u6240\u7ed1\u5b9a\u7684\u7f51\u5361\u7684IP\u90fd\u88ab\u4fee\u6539\u6210\u76f8\u540c\u7684mac\u5730\u5740\uff0c\u5982\u679c\u8fd9\u4e9b\u7f51\u5361\u90fd\u88ab\u63a5\u5728\u540c\u4e00\u4e2a\u4ea4\u6362\u673a\uff0c\u90a3\u4e48\u4ea4\u6362\u673a\u7684arp\u8868\u91cc\u8fd9\u4e2amac\u5730\u5740\u5bf9\u5e94\u7684\u7aef\u53e3\u5c31\u6709\u591a\u00a0\u4e2a\uff0c\u90a3\u4e48\u4ea4\u6362\u673a\u63a5\u53d7\u5230\u53d1\u5f80\u8fd9\u4e2amac\u5730\u5740\u7684\u5305\u5e94\u8be5\u5f80\u54ea\u4e2a\u7aef\u53e3\u8f6c\u53d1\u5462\uff1f\u6b63\u5e38\u60c5\u51b5\u4e0bmac\u5730\u5740\u662f\u5168\u7403\u552f\u4e00\u7684\uff0c\u4e00\u4e2amac\u5730\u5740\u5bf9\u5e94\u591a\u4e2a\u7aef\u53e3\u80af\u5b9a\u4f7f\u4ea4\u6362\u673a\u8ff7\u60d1\u4e86\u3002\u6240\u4ee5\u00a0mode0\u4e0b\u7684bond\u5982\u679c\u8fde\u63a5\u5230\u4ea4\u6362\u673a\uff0c\u4ea4\u6362\u673a\u8fd9\u51e0\u4e2a\u7aef\u53e3\u5e94\u8be5\u91c7\u53d6\u805a\u5408\u65b9\u5f0f\uff08cisco\u79f0\u4e3a\u00a0ethernetchannel\uff0cfoundry\u79f0\u4e3aportgroup\uff09\uff0c\u56e0\u4e3a\u4ea4\u6362\u673a\u505a\u4e86\u805a\u5408\u540e\uff0c\u805a\u5408\u4e0b\u7684\u51e0\u4e2a\u7aef\u53e3\u4e5f\u88ab\u6346\u7ed1\u6210\u4e00\u4e2amac\u5730\u5740.\u6211\u4eec\u7684\u89e3\u00a0\u51b3\u529e\u6cd5\u662f\uff0c\u4e24\u4e2a\u7f51\u5361\u63a5\u5165\u4e0d\u540c\u7684\u4ea4\u6362\u673a\u5373\u53ef\u3002<\/p>\n

mode6\u6a21\u5f0f\u4e0b\u65e0\u9700\u914d\u7f6e\u4ea4\u6362\u673a\uff0c\u56e0\u4e3a\u505abonding\u7684\u8fd9\u4e24\u5757\u7f51\u5361\u662f\u4f7f\u7528\u4e0d\u540c\u7684MAC\u5730\u5740\u3002<\/p>\n

\u4e03\u79cdbond\u6a21\u5f0f\u8bf4\u660e\uff1a<\/strong><\/div>\n
mod=0\u00a0\uff0c\u5373\uff1a(balance-rr)Round-robin policy\uff08\u5e73\u8861\u62a1\u5faa\u73af\u7b56\u7565\uff09<\/strong><\/span><\/div>\n

\u7279\u70b9\uff1a<\/strong>\u4f20\u8f93\u6570\u636e\u5305\u987a\u5e8f\u662f\u4f9d\u6b21\u4f20\u8f93\uff08\u5373\uff1a\u7b2c1\u4e2a\u5305\u8d70eth0\uff0c\u4e0b\u4e00\u4e2a\u5305\u5c31\u8d70eth1\u2026.\u4e00\u76f4\u5faa\u73af\u4e0b\u53bb\uff0c\u76f4\u5230\u6700\u540e\u4e00\u4e2a\u4f20\u8f93\u5b8c\u6bd5\uff09\uff0c\u6b64\u6a21\u5f0f\u63d0\u4f9b\u8d1f\u8f7d\u5e73\u8861\u548c\u5bb9\u9519\u80fd\u529b\uff1b\u4f46\u662f\u6211\u4eec\u77e5\u9053\u5982\u679c\u4e00\u4e2a\u8fde\u63a5\u6216\u8005\u4f1a\u8bdd\u7684\u6570\u636e\u5305\u4ece\u4e0d\u540c\u7684\u63a5\u53e3\u53d1\u51fa\u7684\u8bdd\uff0c\u4e2d\u9014\u518d\u7ecf\u8fc7\u4e0d\u540c\u7684\u94fe\u8def\uff0c\u5728\u5ba2\u6237\u7aef\u5f88\u6709\u53ef\u80fd\u4f1a\u51fa\u73b0\u6570\u636e\u5305\u65e0\u5e8f\u5230\u8fbe\u7684\u95ee\u9898\uff0c\u800c\u65e0\u5e8f\u5230\u8fbe\u7684\u6570\u636e\u5305\u9700\u8981\u91cd\u65b0\u8981\u6c42\u88ab\u53d1\u9001\uff0c\u8fd9\u6837\u7f51\u7edc\u7684\u541e\u5410\u91cf\u5c31\u4f1a\u4e0b\u964d<\/p>\n

mod=1\uff0c\u5373\uff1a\u00a0(active-backup)Active-backup policy\uff08\u4e3b-\u5907\u4efd\u7b56\u7565\uff09<\/strong><\/span><\/div>\n

\u7279\u70b9\uff1a<\/strong>\u53ea\u6709\u4e00\u4e2a\u8bbe\u5907\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\uff0c\u5f53\u4e00\u4e2a\u5b95\u6389\u53e6\u4e00\u4e2a\u9a6c\u4e0a\u7531\u5907\u4efd\u8f6c\u6362\u4e3a\u4e3b\u8bbe\u5907\u3002mac\u5730\u5740\u662f\u5916\u90e8\u53ef\u89c1\u5f97\uff0c\u4ece\u5916\u9762\u770b\u6765\uff0cbond\u7684MAC\u5730\u5740\u662f\u552f\u4e00\u7684\uff0c\u4ee5\u907f\u514dswitch(\u4ea4\u6362\u673a)\u53d1\u751f\u6df7\u4e71\u3002\u6b64\u6a21\u5f0f\u53ea\u63d0\u4f9b\u4e86\u5bb9\u9519\u80fd\u529b\uff1b\u7531\u6b64\u53ef\u89c1\u6b64\u7b97\u6cd5\u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u63d0\u4f9b\u9ad8\u7f51\u7edc\u8fde\u63a5\u7684\u53ef\u7528\u6027\uff0c\u4f46\u662f\u5b83\u7684\u8d44\u6e90\u5229\u7528\u7387\u8f83\u4f4e\uff0c\u53ea\u6709\u4e00\u4e2a\u63a5\u53e3\u5904\u4e8e\u5de5\u4f5c\u72b6\u6001\uff0c\u5728\u6709\u00a0N\u00a0\u4e2a\u7f51\u7edc\u63a5\u53e3\u7684\u60c5\u51b5\u4e0b\uff0c\u8d44\u6e90\u5229\u7528\u7387\u4e3a1\/N<\/p>\n

mod=2\uff0c\u5373\uff1a(balance-xor)XOR policy\uff08\u5e73\u8861\u7b56\u7565\uff09<\/strong><\/span><\/div>\n

\u7279\u70b9\uff1a<\/strong>\u57fa\u4e8e\u6307\u5b9a\u7684\u4f20\u8f93HASH\u7b56\u7565\u4f20\u8f93\u6570\u636e\u5305\u3002\u7f3a\u7701\u7684\u7b56\u7565\u662f\uff1a(\u6e90MAC\u5730\u5740\u00a0XOR\u00a0\u76ee\u6807MAC\u5730\u5740)% slave\u6570\u91cf\u3002\u5176\u4ed6\u7684\u4f20\u8f93\u7b56\u7565\u53ef\u4ee5\u901a\u8fc7xmit_hash_policy\u9009\u9879\u6307\u5b9a\uff0c\u6b64\u6a21\u5f0f\u63d0\u4f9b\u8d1f\u8f7d\u5e73\u8861\u548c\u5bb9\u9519\u80fd\u529b<\/p>\n

mod=3\uff0c\u5373\uff1abroadcast\uff08\u5e7f\u64ad\u7b56\u7565\uff09<\/strong><\/span><\/div>\n

\u7279\u70b9\uff1a<\/strong>\u5728\u6bcf\u4e2aslave\u63a5\u53e3\u4e0a\u4f20\u8f93\u6bcf\u4e2a\u6570\u636e\u5305\uff0c\u6b64\u6a21\u5f0f\u63d0\u4f9b\u4e86\u5bb9\u9519\u80fd\u529b<\/p>\n

mod=4\uff0c\u5373\uff1a(802.3ad) IEEE 802.3ad Dynamic link aggregation\uff08\u52a8\u6001\u94fe\u63a5\u805a\u5408\uff09<\/strong><\/span><\/div>\n

\u7279\u70b9\uff1a<\/strong>\u521b\u5efa\u4e00\u4e2a\u805a\u5408\u7ec4\uff0c\u5b83\u4eec\u5171\u4eab\u540c\u6837\u7684\u901f\u7387\u548c\u53cc\u5de5\u8bbe\u5b9a\u3002\u6839\u636e802.3ad\u89c4\u8303\u5c06\u591a\u4e2aslave\u5de5\u4f5c\u5728\u540c\u4e00\u4e2a\u6fc0\u6d3b\u7684\u805a\u5408\u4f53\u4e0b\u3002\u5916\u51fa\u6d41\u91cf\u7684slave\u9009\u4e3e\u662f\u57fa\u4e8e\u4f20\u8f93hash\u7b56\u7565\uff0c\u8be5\u7b56\u7565\u53ef\u4ee5\u901a\u8fc7xmit_hash_policy\u9009\u9879\u4ece\u7f3a\u7701\u7684XOR\u7b56\u7565\u6539\u53d8\u5230\u5176\u4ed6\u7b56\u7565\u3002\u9700\u8981\u6ce8\u610f\u7684\u00a0\u662f\uff0c\u5e76\u4e0d\u662f\u6240\u6709\u7684\u4f20\u8f93\u7b56\u7565\u90fd\u662f802.3ad\u9002\u5e94\u7684\uff0c\u5c24\u5176\u8003\u8651\u5230\u5728802.3ad\u6807\u51c643.2.4\u7ae0\u8282\u63d0\u53ca\u7684\u5305\u4e71\u5e8f\u95ee\u9898\u3002\u4e0d\u540c\u7684\u5b9e\u73b0\u53ef\u80fd\u4f1a\u6709\u4e0d\u540c\u7684\u9002\u5e94\u00a0\u6027\u3002<\/p>\n

\u5fc5\u8981\u6761\u4ef6\uff1a<\/strong><\/p>\n

\u6761\u4ef61\uff1aethtool\u652f\u6301\u83b7\u53d6\u6bcf\u4e2aslave\u7684\u901f\u7387\u548c\u53cc\u5de5\u8bbe\u5b9a<\/p>\n

\u6761\u4ef62\uff1aswitch(\u4ea4\u6362\u673a)\u652f\u6301IEEE802.3ad Dynamic link aggregation<\/p>\n

\u6761\u4ef63\uff1a\u5927\u591a\u6570switch(\u4ea4\u6362\u673a)\u9700\u8981\u7ecf\u8fc7\u7279\u5b9a\u914d\u7f6e\u624d\u80fd\u652f\u6301802.3ad\u6a21\u5f0f<\/p>\n

mod=5\uff0c\u5373\uff1a(balance-tlb)Adaptive transmit load balancing\uff08\u9002\u914d\u5668\u4f20\u8f93\u8d1f\u8f7d\u5747\u8861\uff09
\n<\/strong><\/span><\/div>\n

\u7279\u70b9\uff1a<\/strong>\u4e0d\u9700\u8981\u4efb\u4f55\u7279\u522b\u7684switch(\u4ea4\u6362\u673a)\u652f\u6301\u7684\u901a\u9053bonding\u3002\u5728\u6bcf\u4e2aslave\u4e0a\u6839\u636e\u5f53\u524d\u7684\u8d1f\u8f7d\uff08\u6839\u636e\u901f\u5ea6\u8ba1\u7b97\uff09\u5206\u914d\u5916\u51fa\u6d41\u91cf\u3002\u5982\u679c\u6b63\u5728\u63a5\u53d7\u6570\u636e\u7684slave\u51fa\u6545\u969c\u4e86\uff0c\u53e6\u4e00\u4e2aslave\u63a5\u7ba1\u5931\u8d25\u7684slave\u7684MAC\u5730\u5740\u3002<\/p>\n

\u8be5\u6a21\u5f0f\u7684\u5fc5\u8981\u6761\u4ef6\uff1a<\/strong>ethtool\u652f\u6301\u83b7\u53d6\u6bcf\u4e2aslave\u7684\u901f\u7387<\/p>\n

mod=6\uff0c\u5373\uff1a(balance-alb)Adaptive load balancing\uff08\u9002\u914d\u5668\u9002\u5e94\u6027\u8d1f\u8f7d\u5747\u8861\uff09
\n<\/strong><\/span><\/div>\n

\u7279\u70b9\uff1a<\/strong>\u8be5\u6a21\u5f0f\u5305\u542b\u4e86balance-tlb\u6a21\u5f0f\uff0c\u540c\u65f6\u52a0\u4e0a\u9488\u5bf9IPV4\u6d41\u91cf\u7684\u63a5\u6536\u8d1f\u8f7d\u5747\u8861(receiveload balance, rlb)\uff0c\u800c\u4e14\u4e0d\u9700\u8981\u4efb\u4f55switch(\u4ea4\u6362\u673a)\u7684\u652f\u6301\u3002\u63a5\u6536\u8d1f\u8f7d\u5747\u8861\u662f\u901a\u8fc7ARP\u534f\u5546\u5b9e\u73b0\u7684\u3002bonding\u9a71\u52a8\u622a\u83b7\u672c\u673a\u53d1\u9001\u7684ARP\u5e94\u7b54\uff0c\u5e76\u628a\u6e90\u786c\u4ef6\u5730\u5740\u6539\u5199\u4e3abond\u4e2d\u67d0\u4e2aslave\u7684\u552f\u4e00\u786c\u4ef6\u5730\u5740\uff0c\u4ece\u800c\u4f7f\u5f97\u4e0d\u540c\u7684\u5bf9\u7aef\u4f7f\u7528\u4e0d\u540c\u7684\u786c\u4ef6\u5730\u5740\u8fdb\u884c\u901a\u4fe1\u3002<\/p>\n

\u6765\u81ea\u670d\u52a1\u5668\u7aef\u7684\u63a5\u6536\u6d41\u91cf\u4e5f\u4f1a\u88ab\u5747\u8861\u3002\u5f53\u672c\u673a\u53d1\u9001ARP\u8bf7\u6c42\u65f6\uff0cbonding\u9a71\u52a8\u628a\u5bf9\u7aef\u7684IP\u4fe1\u606f\u4eceARP\u5305\u4e2d\u590d\u5236\u5e76\u4fdd\u5b58\u4e0b\u6765\u3002\u5f53ARP\u5e94\u7b54\u4ece\u5bf9\u7aef\u5230\u8fbe\u65f6\uff0cbonding\u9a71\u52a8\u628a\u5b83\u7684\u786c\u4ef6\u5730\u5740\u63d0\u53d6\u51fa\u6765\uff0c\u5e76\u53d1\u8d77\u4e00\u4e2aARP\u5e94\u7b54\u7ed9bond\u4e2d\u7684\u67d0\u4e2aslave\u3002\u4f7f\u7528ARP\u534f\u5546\u8fdb\u884c\u8d1f\u8f7d\u5747\u8861\u7684\u4e00\u4e2a\u95ee\u9898\u662f\uff1a\u6bcf\u6b21\u5e7f\u64ad\u00a0ARP\u8bf7\u6c42\u65f6\u90fd\u4f1a\u4f7f\u7528bond\u7684\u786c\u4ef6\u5730\u5740\uff0c\u56e0\u6b64\u5bf9\u7aef\u5b66\u4e60\u5230\u8fd9\u4e2a\u786c\u4ef6\u5730\u5740\u540e\uff0c\u63a5\u6536\u6d41\u91cf\u5c06\u4f1a\u5168\u90e8\u6d41\u5411\u5f53\u524d\u7684slave\u3002\u8fd9\u4e2a\u95ee\u9898\u53ef\u4ee5\u901a\u8fc7\u7ed9\u6240\u6709\u7684\u5bf9\u7aef\u53d1\u9001\u66f4\u65b0\uff08ARP\u5e94\u7b54\uff09\u6765\u89e3\u51b3\uff0c\u5e94\u7b54\u4e2d\u5305\u542b\u4ed6\u4eec\u72ec\u4e00\u65e0\u4e8c\u7684\u786c\u4ef6\u5730\u5740\uff0c\u4ece\u800c\u5bfc\u81f4\u6d41\u91cf\u91cd\u65b0\u5206\u5e03\u3002\u5f53\u65b0\u7684slave\u52a0\u5165\u5230bond\u4e2d\u65f6\uff0c\u6216\u8005\u67d0\u4e2a\u672a\u6fc0\u6d3b\u7684slave\u91cd\u65b0\u00a0\u6fc0\u6d3b\u65f6\uff0c\u63a5\u6536\u6d41\u91cf\u4e5f\u8981\u91cd\u65b0\u5206\u5e03\u3002\u63a5\u6536\u7684\u8d1f\u8f7d\u88ab\u987a\u5e8f\u5730\u5206\u5e03\uff08roundrobin\uff09\u5728bond\u4e2d\u6700\u9ad8\u901f\u7684slave\u4e0a\u5f53\u67d0\u4e2a\u94fe\u8def\u88ab\u91cd\u65b0\u63a5\u4e0a\uff0c\u6216\u8005\u4e00\u4e2a\u65b0\u7684slave\u52a0\u5165\u5230bond\u4e2d\uff0c\u63a5\u6536\u6d41\u91cf\u5728\u6240\u6709\u5f53\u524d\u6fc0\u6d3b\u7684slave\u4e2d\u5168\u90e8\u91cd\u65b0\u5206\u914d\uff0c\u901a\u8fc7\u4f7f\u7528\u6307\u5b9a\u7684MAC\u5730\u5740\u7ed9\u6bcf\u4e2a\u00a0client\u53d1\u8d77ARP\u5e94\u7b54\u3002\u4e0b\u9762\u4ecb\u7ecd\u7684updelay\u53c2\u6570\u5fc5\u987b\u88ab\u8bbe\u7f6e\u4e3a\u67d0\u4e2a\u5927\u4e8e\u7b49\u4e8eswitch(\u4ea4\u6362\u673a)\u8f6c\u53d1\u5ef6\u65f6\u7684\u503c\uff0c\u4ece\u800c\u4fdd\u8bc1\u53d1\u5f80\u5bf9\u7aef\u7684ARP\u5e94\u7b54\u00a0\u4e0d\u4f1a\u88abswitch(\u4ea4\u6362\u673a)\u963b\u622a\u3002<\/p>\n

\u5fc5\u8981\u6761\u4ef6\uff1a<\/strong><\/p>\n

\u6761\u4ef61\uff1aethtool\u652f\u6301\u83b7\u53d6\u6bcf\u4e2aslave\u7684\u901f\u7387\uff1b<\/p>\n

\u6761\u4ef62\uff1a\u5e95\u5c42\u9a71\u52a8\u652f\u6301\u8bbe\u7f6e\u67d0\u4e2a\u8bbe\u5907\u7684\u786c\u4ef6\u5730\u5740\uff0c\u4ece\u800c\u4f7f\u5f97\u603b\u662f\u6709\u4e2aslave(curr_active_slave)\u4f7f\u7528bond\u7684\u786c\u4ef6\u5730\u5740\uff0c\u540c\u65f6\u4fdd\u8bc1\u6bcf\u4e2a\u00a0bond\u00a0\u4e2d\u7684slave\u90fd\u6709\u4e00\u4e2a\u552f\u4e00\u7684\u786c\u4ef6\u5730\u5740\u3002\u5982\u679ccurr_active_slave\u51fa\u6545\u969c\uff0c\u5b83\u7684\u786c\u4ef6\u5730\u5740\u5c06\u4f1a\u88ab\u65b0\u9009\u51fa\u6765\u7684\u00a0curr_active_slave\u63a5\u7ba1\u5176\u5b9emod=6\u4e0emod=0\u7684\u533a\u522b\uff1amod=6\uff0c\u5148\u628aeth0\u6d41\u91cf\u5360\u6ee1\uff0c\u518d\u5360eth1\uff0c\u2026.ethX\uff1b\u800cmod=0\u7684\u8bdd\uff0c\u4f1a\u53d1\u73b02\u4e2a\u53e3\u7684\u6d41\u91cf\u90fd\u5f88\u7a33\u5b9a\uff0c\u57fa\u672c\u4e00\u6837\u7684\u5e26\u5bbd\u3002\u800cmod=6\uff0c\u4f1a\u53d1\u73b0\u7b2c\u4e00\u4e2a\u53e3\u6d41\u91cf\u5f88\u9ad8\uff0c\u7b2c2\u4e2a\u53e3\u53ea\u5360\u4e86\u5c0f\u90e8\u5206\u6d41\u91cf<\/p>\n

Linux\u7f51\u53e3\u7ed1\u5b9a\uff1a<\/strong><\/div>\n

\u901a\u8fc7\u7f51\u53e3\u7ed1\u5b9a(bond)\u6280\u672f,\u53ef\u4ee5\u5f88\u5bb9\u6613\u5b9e\u73b0\u7f51\u53e3\u5197\u4f59\uff0c\u8d1f\u8f7d\u5747\u8861\uff0c\u4ece\u800c\u8fbe\u5230\u9ad8\u53ef\u7528\u9ad8\u53ef\u9760\u7684\u76ee\u7684\u3002\u524d\u63d0\u7ea6\u5b9a\uff1a<\/p>\n

2\u4e2a\u7269\u7406\u7f51\u53e3\u5206\u522b\u662f\uff1aeth0,eth1\r\n\u7ed1\u5b9a\u540e\u7684\u865a\u62df\u53e3\u662f\uff1abond0\r\n\u670d\u52a1\u5668IP\u662f\uff1a10.10.10.1\r\n<\/pre>\n
\n

\u7b2c\u4e00\u6b65\uff0c\u914d\u7f6e\u8bbe\u5b9a\u6587\u4ef6\uff1a<\/strong><\/span><\/p>\n

[root@woo ~]# vi \u00a0\/etc\/sysconfig\/network-scripts\/ifcfg-bond0\r\n\r\nDEVICE=bond0\r\n\r\nBOOTPROTO=none\r\n\r\nONBOOT=yes\r\n\r\nIPADDR=10.10.10.1\r\n\r\nNETMASK=255.255.255.0\r\n\r\nNETWORK=192.168.0.0\r\n\r\n[root@woo ~]# vi \u00a0\/etc\/sysconfig\/network-scripts\/ifcfg-eth0\r\n\r\nDEVICE=eth0\r\n\r\nBOOTPROTO=none\r\n\r\nMASTER=bond0\r\n\r\nSLAVE=yes\r\n\r\n[root@woo ~]# vi \u00a0\/etc\/sysconfig\/network-scripts\/ifcfg-eth1\r\n\r\nDEVICE=eth1\r\n\r\nBOOTPROTO=none\r\n\r\nMASTER=bond0\r\n\r\nSLAVE=yes<\/pre>\n
\n

\u7b2c\u4e8c\u6b65\uff0c\u4fee\u6539modprobe\u76f8\u5173\u8bbe\u5b9a\u6587\u4ef6\uff0c\u5e76\u52a0\u8f7dbonding<\/strong>\u6a21\u5757\uff1a<\/strong><\/span><\/p>\n

1.\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u76f4\u63a5\u521b\u5efa\u4e00\u4e2a\u52a0\u8f7dbonding\u7684\u4e13\u5c5e\u8bbe\u5b9a\u6587\u4ef6\/etc\/modprobe.d\/bonding.conf<\/p>\n

[root@woo ~]# vi \/etc\/modprobe.d\/bonding.conf\r\n\r\nalias bond0 bonding\r\n\r\noptions bonding mode=0 miimon=200<\/pre>\n

2.\u52a0\u8f7d\u6a21\u5757(\u91cd\u542f\u7cfb\u7edf\u540e\u5c31\u4e0d\u7528\u624b\u52a8\u518d\u52a0\u8f7d\u4e86)<\/p>\n

[root@woo ~]# modprobe bonding<\/pre>\n

3.\u786e\u8ba4\u6a21\u5757\u662f\u5426\u52a0\u8f7d\u6210\u529f\uff1a<\/p>\n

[root@woo ~]# lsmod | grep bonding\r\n\r\nbonding 100065 0<\/pre>\n
\n

\u7b2c\u4e09\u6b65\uff0c\u91cd\u542f\u4e00\u4e0b\u7f51\u7edc\uff0c\u7136\u540e\u786e\u8ba4\u4e00\u4e0b\u72b6\u51b5\uff1a<\/strong><\/span><\/p>\n

[root@db01 ~]# service network restart\r\n\r\nShutting down interface bond0: \u00a0[ \u00a0OK \u00a0]\r\n\r\nShutting down loopback interface: \u00a0[ \u00a0OK \u00a0]\r\n\r\nBringing up loopback interface: \u00a0[ \u00a0OK \u00a0]\r\n\r\nBringing up interface bond0: \u00a0[ \u00a0OK \u00a0]\r\n\r\n[root@db01 ~]# \u00a0cat \/proc\/net\/bonding\/bond0\r\n\r\nEthernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)\r\n\r\nBonding Mode: fault-tolerance (active-backup)\r\n\r\nPrimary Slave: None\r\n\r\nCurrently Active Slave: eth0\r\n\r\nMII Status: up\r\n\r\nMII Polling Interval (ms): 100\r\n\r\nUp Delay (ms): 0\r\n\r\nDown Delay (ms): 0\r\n\r\nSlave Interface: eth0\r\n\r\nMII Status: up\r\n\r\nSpeed: 1000 Mbps\r\n\r\nDuplex: full\r\n\r\nLink Failure Count: 0\r\n\r\nPermanent HW addr: 40:f2:e9:db:c9:c2\r\n\r\nSlave Interface: eth1\r\n\r\nMII Status: up\r\n\r\nSpeed: 1000 Mbps\r\n\r\nDuplex: full\r\n\r\nLink Failure Count: 0\r\n\r\nPermanent HW addr: 40:f2:e9:db:c9:c3\r\n\r\n[root@db01 ~]# \u00a0ifconfig | grep HWaddr\r\n\r\nbond0 \u00a0 \u00a0 Link encap:Ethernet \u00a0HWaddr 40:F2:E9:DB:C9:C2\r\n\r\neth0 \u00a0 \u00a0 \u00a0Link encap:Ethernet \u00a0HWaddr 40:F2:E9:DB:C9:C2\r\n\r\neth1 \u00a0 \u00a0 \u00a0Link encap:Ethernet \u00a0HWaddr 40:F2:E9:DB:C9:C2<\/pre>\n

\u4ece\u4e0a\u9762\u7684\u786e\u8ba4\u4fe1\u606f\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u52303\u4e2a\u91cd\u8981\u4fe1\u606f\uff1a<\/p>\n

1.\u73b0\u5728\u7684bonding\u6a21\u5f0f\u662factive-backup<\/p>\n

2.\u73b0\u5728Active\u72b6\u6001\u7684\u7f51\u53e3\u662feth0<\/p>\n

3.bond0,eth1\u7684\u7269\u7406\u5730\u5740\u548c\u5904\u4e8eactive\u72b6\u6001\u4e0b\u7684eth0\u7684\u7269\u7406\u5730\u5740\u76f8\u540c\uff0c\u8fd9\u6837\u662f\u4e3a\u4e86\u907f\u514d\u4e0a\u4f4d\u4ea4\u6362\u673a\u53d1\u751f\u6df7\u4e71\u3002<\/p>\n

\u4efb\u610f\u62d4\u6389\u4e00\u6839\u7f51\u7ebf\uff0c\u7136\u540e\u518d\u8bbf\u95ee\u4f60\u7684\u670d\u52a1\u5668\uff0c\u770b\u7f51\u7edc\u662f\u5426\u8fd8\u662f\u901a\u7684\u3002<\/p>\n

\n

\u7b2c\u56db\u6b65\uff0c\u7cfb\u7edf\u542f\u52a8\u81ea\u52a8\u7ed1\u5b9a\u3001\u589e\u52a0\u9ed8\u8ba4\u7f51\u5173\uff1a<\/strong><\/span><\/p>\n

[root@woo ~]# vi \/etc\/rc.d\/rc.local\r\n\r\n#\u8ffd\u52a0\r\n\r\nifenslave bond0 eth0 eth1\r\n\r\nroute add default gw 10.10.10.1<\/pre>\n

#\u5982\u53ef\u4e0a\u7f51\u5c31\u4e0d\u7528\u589e\u52a0\u8def\u7531\uff0c0.1\u5730\u5740\u6309\u73af\u5883\u4fee\u6539.<\/p>\n

\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n

\u7559\u5fc3\uff1a\u524d\u9762\u53ea\u662f2\u4e2a\u7f51\u53e3\u7ed1\u5b9a\u6210\u4e00\u4e2abond0\u7684\u60c5\u51b5\uff0c\u5982\u679c\u6211\u4eec\u8981\u8bbe\u7f6e\u591a\u4e2abond\u53e3\uff0c\u6bd4\u5982\u7269\u7406\u7f51\u53e3eth0\u548ceth1\u7ec4\u6210bond0\uff0ceth2\u548ceth3\u7ec4\u6210bond1\uff0c<\/p>\n

\u591a\u7f51\u53e3\u7ed1\u5b9a\uff1a<\/strong><\/div>\n

\u90a3\u4e48\u7f51\u53e3\u8bbe\u7f6e\u6587\u4ef6\u7684\u8bbe\u7f6e\u65b9\u6cd5\u548c\u4e0a\u9762\u7b2c1\u6b65\u8bb2\u7684\u65b9\u6cd5\u76f8\u540c\uff0c\u53ea\u662f\/etc\/modprobe.d\/bonding.conf\u7684\u8bbe\u5b9a\u5c31\u4e0d\u80fd\u50cf\u4e0b\u9762\u8fd9\u6837\u7b80\u5355\u7684\u53e0\u52a0\u4e86\uff1a<\/p>\n

alias bond0 bonding\r\n\r\noptions bonding mode=1 miimon=200\r\n\r\nalias bond1 bonding\r\n\r\noptions bonding mode=1 miimon=200<\/pre>\n

\u6b63\u786e\u7684\u8bbe\u7f6e\u65b9\u6cd5\u67092\u79cd\uff1a<\/strong><\/p>\n

\n

\u7b2c\u4e00\u79cd,\u4f60\u53ef\u4ee5\u770b\u5230\uff0c\u8fd9\u79cd\u65b9\u5f0f\u7684\u8bdd\uff0c\u591a\u4e2abond<\/strong>\u53e3\u7684\u6a21\u5f0f\u5c31\u53ea\u80fd\u8bbe\u6210\u76f8\u540c\u7684\u4e86\uff1a<\/strong><\/span><\/p>\n

<span style=\u201dcolor:#000000;\u201d>alias bond0 bonding\r\n\r\nalias bond1 bonding\r\n\r\noptions bonding max_bonds=2 miimon=200 mode=1\r\n\r\n<\/span><\/pre>\n
\n

\u7b2c\u4e8c\u79cd\uff0c\u8fd9\u79cd\u65b9\u5f0f\uff0c\u4e0d\u540c\u7684bond\u53e3\u7684mode\u53ef\u4ee5\u8bbe\u6210\u4e0d\u4e00\u6837\uff1a<\/strong><\/span><\/p>\n

<span style=\u201dcolor:#000000;\u201d>alias bond0 bonding\r\n\r\noptions bond0 miimon=100 mode=1\r\n\r\ninstall bond1 \/sbin\/modprobe bonding -o bond1 miimon=200 mode=0\r\n\r\n<\/span><\/pre>\n

\u4ed4\u7ec6\u770b\u770b\u4e0a\u9762\u8fd92\u79cd\u8bbe\u7f6e\u65b9\u6cd5\uff0c\u73b0\u5728\u5982\u679c\u662f\u8981\u8bbe\u7f6e3\u4e2a\uff0c4\u4e2a\uff0c\u751a\u81f3\u66f4\u591a\u7684bond\u53e3\uff0c\u4f60\u5e94\u8be5\u4e5f\u4f1a\u4e86\u5427\uff01<\/p>\n

\u540e\u8bb0\uff1a<\/strong><\/div>\n

miimon\u00a0\u76d1\u89c6\u7f51\u7edc\u94fe\u63a5\u7684\u9891\u5ea6\uff0c\u5355\u4f4d\u662f\u6beb\u79d2\uff0c\u6211\u4eec\u8bbe\u7f6e\u7684\u662f200\u6beb\u79d2\u3002<\/p>\n

max_bonds\u00a0\u914d\u7f6e\u7684bond\u53e3\u4e2a\u6570<\/p>\n

mode bond\u6a21\u5f0f\uff0c\u4e3b\u8981\u6709\u4ee5\u4e0b\u51e0\u79cd\uff0c\u5728\u4e00\u822c\u7684\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c0\u548c1\u7528\u7684\u6bd4\u8f83\u591a\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.yunweipai.com\/archives\/21483.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1a http:\/\/lrxjmw.cn\/analysis-bongmode.html<\/a>\u7f16\u8f91\uff1a\u5f20\u5b8f\u5b87\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"

\u76ee\u524d\u7f51\u5361\u7ed1\u5b9amode\u5171\u6709\u4e03\u79cd(0~6)bond0\u3001bond1\u3001bond2\u3001bond3\u3001bond4\u3001bond5\u3001 […]<\/p>\n","protected":false},"author":63,"featured_media":76986,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-76965","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/76965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=76965"}],"version-history":[{"count":20,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/76965\/revisions"}],"predecessor-version":[{"id":281343,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/76965\/revisions\/281343"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/76986"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=76965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=76965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=76965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}