{"id":14066,"date":"2026-02-27T11:37:11","date_gmt":"2026-02-27T03:37:11","guid":{"rendered":"https:\/\/www.killtest.com.tw\/?p=14066"},"modified":"2026-02-27T11:41:43","modified_gmt":"2026-02-27T03:41:43","slug":"%e7%b6%b2%e8%b7%af%e5%8d%a1bonding%e9%9b%99%e7%b6%b2%e5%8d%a1%e7%b6%81%e5%ae%9a%e5%af%a6%e6%88%b0%ef%bc%9a%e8%ae%93%e4%bc%ba%e6%9c%8d%e5%99%a8%e7%b6%b2%e8%b7%af%e6%b0%b8%e4%b8%8d%e4%b8%ad%e6%96%b7","status":"publish","type":"post","link":"https:\/\/www.killtest.com.tw\/?p=14066","title":{"rendered":"\u7db2\u8def\u5361Bonding\u96d9\u7db2\u5361\u7d81\u5b9a\u5be6\u6230\uff1a\u8b93\u4f3a\u670d\u5668\u7db2\u8def\u6c38\u4e0d\u4e2d\u65b7"},"content":{"rendered":"\n<p><strong>\u524d\u8a00<\/strong><\/p>\n\n\n\n<p>\u5e72\u8fd0\u7ef4\u8fd9\u884c\u5341\u5e74\u4e86\uff0c\u89c1\u8fc7\u592a\u591a\u56e0\u4e3a\u5355\u7f51\u5361\u6545\u969c\u5bfc\u81f4\u7684\u751f\u4ea7\u4e8b\u6545\u3002\u8bb0\u5f972019\u5e74\u90a3\u4f1a\uff0c\u67d0\u7535\u5546\u5ba2\u6237\u53cc\u5341\u4e00\u5f53\u5929\uff0c\u6838\u5fc3\u4ea4\u6613\u670d\u52a1\u5668\u7684\u7f51\u5361\u7a81\u7136\u6302\u4e86\uff0c\u6574\u6574\u65ad\u7f5140\u5206\u949f\uff0c\u76f4\u63a5\u635f\u5931\u51e0\u767e\u4e07\u3002\u4e8b\u540e\u590d\u76d8\uff0c\u5176\u5b9e\u5c31\u662f\u4e00\u5757\u51e0\u5341\u5757\u94b1\u7684\u7f51\u5361\u574f\u4e86\uff0c\u4f46\u56e0\u4e3a\u6ca1\u505a\u4efb\u4f55\u5197\u4f59\uff0c\u7ed3\u679c\u635f\u5931\u60e8\u91cd\u3002<\/p>\n\n\n\n<p>\u4ece\u90a3\u4ee5\u540e\uff0c\u6211\u5c31\u628a\u7f51\u5361Bonding\u5f53\u6210\u670d\u52a1\u5668\u4e0a\u67b6\u7684\u6807\u914d\u64cd\u4f5c\u3002\u8fd9\u73a9\u610f\u914d\u7f6e\u8d77\u6765\u4e0d\u590d\u6742\uff0c\u4f46\u80fd\u5728\u5173\u952e\u65f6\u523b\u6551\u547d\u3002\u4eca\u5929\u5c31\u628a\u8fd9\u4e9b\u5e74\u8e29\u8fc7\u7684\u5751\u3001\u603b\u7ed3\u7684\u7ecf\u9a8c\u90fd\u5199\u51fa\u6765\uff0c\u5e0c\u671b\u80fd\u5e2e\u5230\u540c\u884c\u4eec\u5c11\u8d70\u5f2f\u8def\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e00\u3001Bonding\u6280\u672f\u6982\u8ff0<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.1 \u4ec0\u4e48\u662f\u7f51\u5361Bonding<\/strong><\/h3>\n\n\n\n<p>\u7b80\u5355\u8bf4\uff0cBonding\u5c31\u662f\u628a\u591a\u5757\u7269\u7406\u7f51\u5361\u7ed1\u5b9a\u6210\u4e00\u4e2a\u903b\u8f91\u7f51\u5361\u3002\u5bf9\u4e0a\u5c42\u5e94\u7528\u6765\u8bf4\uff0c\u5b83\u53ea\u770b\u5230\u4e00\u4e2a\u7f51\u7edc\u63a5\u53e3\uff0c\u4f46\u5e95\u5c42\u5b9e\u9645\u4e0a\u6709\u591a\u5757\u7f51\u5361\u5728\u5de5\u4f5c\u3002\u8fd9\u6837\u505a\u6709\u4e24\u4e2a\u6838\u5fc3\u597d\u5904\uff1a<\/p>\n\n\n\n<p>\u7b2c\u4e00\u662f\u9ad8\u53ef\u7528\u3002\u4efb\u4f55\u4e00\u5757\u7269\u7406\u7f51\u5361\u574f\u4e86\uff0c\u6d41\u91cf\u81ea\u52a8\u5207\u6362\u5230\u5176\u4ed6\u7f51\u5361\uff0c\u4e1a\u52a1\u65e0\u611f\u77e5\u3002<\/p>\n\n\n\n<p>\u7b2c\u4e8c\u662f\u5e26\u5bbd\u805a\u5408\u3002\u591a\u5757\u7f51\u5361\u7684\u5e26\u5bbd\u53ef\u4ee5\u53e0\u52a0\u4f7f\u7528\uff0c\u6bd4\u5982\u4e24\u5757\u5343\u5146\u7f51\u5361\u7ed1\u5b9a\u540e\u7406\u8bba\u4e0a\u80fd\u8dd1\u52302Gbps\u3002<\/p>\n\n\n\n<p>Linux\u5185\u6838\u4ece2.0\u7248\u672c\u5c31\u5f00\u59cb\u652f\u6301Bonding\u4e86\uff0c\u5230\u73b0\u5728\u5df2\u7ecf\u975e\u5e38\u6210\u719f\u7a33\u5b9a\u30022025\u5e74\u7684\u4e3b\u6d41\u53d1\u884c\u7248\uff0c\u4e0d\u7ba1\u662fRHEL 9\u3001Ubuntu 24.04\u8fd8\u662fDebian 12\uff0c\u90fd\u5bf9Bonding\u6709\u5b8c\u5584\u7684\u652f\u6301\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.2 Bonding\u7684\u5de5\u4f5c\u539f\u7406<\/strong><\/h3>\n\n\n\n<p>Bonding\u9a71\u52a8\u5728\u5185\u6838\u5c42\u9762\u5de5\u4f5c\uff0c\u5b83\u4f1a\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u7684bond\u63a5\u53e3\uff0c\u7136\u540e\u628a\u591a\u4e2a\u7269\u7406\u7f51\u5361\uff08\u79f0\u4e3aslave\uff09\u6302\u8f7d\u5230\u8fd9\u4e2a\u865a\u62df\u63a5\u53e3\u4e0b\u9762\u3002\u6240\u6709\u53d1\u5f80bond\u63a5\u53e3\u7684\u6d41\u91cf\uff0c\u90fd\u4f1a\u6839\u636e\u914d\u7f6e\u7684\u6a21\u5f0f\u5206\u53d1\u5230\u5404\u4e2aslave\u7f51\u5361\u4e0a\u3002<\/p>\n\n\n\n<p>\u4ece\u534f\u8bae\u6808\u7684\u89d2\u5ea6\u770b\uff0c\u6d41\u91cf\u662f\u8fd9\u6837\u8d70\u7684\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u5e94\u7528\u7a0b\u5e8f<br>&nbsp; &nbsp; |<br>TCP\/IP\u534f\u8bae\u6808<br>&nbsp; &nbsp; |<br>Bond\u865a\u62df\u63a5\u53e3\uff08bond0\uff09<br>&nbsp; &nbsp; |<br>+---+---+<br>| &nbsp; &nbsp; &nbsp; |<br>eth0 &nbsp; eth1<br>| &nbsp; &nbsp; &nbsp; |<br>\u7269\u7406\u4ea4\u6362\u673a<\/code><\/pre>\n\n\n\n<p>Bond\u63a5\u53e3\u6709\u81ea\u5df1\u7684MAC\u5730\u5740\uff0c\u9ed8\u8ba4\u4f1a\u4f7f\u7528\u7b2c\u4e00\u4e2aslave\u7f51\u5361\u7684MAC\u3002\u5f53\u7136\u8fd9\u4e2a\u53ef\u4ee5\u624b\u52a8\u6307\u5b9a\uff0c\u540e\u9762\u4f1a\u8bb2\u5230\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.3 \u4e3a\u4ec0\u4e48\u8981\u7528Bonding\u800c\u4e0d\u662f\u5176\u4ed6\u65b9\u6848<\/strong><\/h3>\n\n\n\n<p>\u6709\u4eba\u53ef\u80fd\u4f1a\u95ee\uff0c\u73b0\u5728\u4e0d\u662f\u6709\u5f88\u591a\u9ad8\u53ef\u7528\u65b9\u6848\u5417\uff0c\u6bd4\u5982Keepalived\u3001HAProxy\u8fd9\u4e9b\uff0c\u4e3a\u5565\u8fd8\u8981\u7528Bonding\uff1f<\/p>\n\n\n\n<p>\u8fd9\u91cc\u8981\u641e\u6e05\u695a\u4e00\u70b9\uff1aBonding\u89e3\u51b3\u7684\u662f\u5355\u673a\u7f51\u5361\u5c42\u9762\u7684\u5197\u4f59\uff0c\u800cKeepalived\u8fd9\u4e9b\u89e3\u51b3\u7684\u662f\u670d\u52a1\u5c42\u9762\u7684\u5197\u4f59\u3002\u4e24\u8005\u4e0d\u662f\u66ff\u4ee3\u5173\u7cfb\uff0c\u800c\u662f\u4e92\u8865\u5173\u7cfb\u3002<\/p>\n\n\n\n<p>\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u4f60\u7528Keepalived\u505a\u4e86MySQL\u4e3b\u4ece\u5207\u6362\uff0c\u4f46\u5982\u679c\u4e3b\u5e93\u7684\u7f51\u5361\u574f\u4e86\uff0cKeepalived\u68c0\u6d4b\u5230\u6545\u969c\u9700\u8981\u65f6\u95f4\uff0c\u5207\u6362\u4e5f\u9700\u8981\u65f6\u95f4\uff0c\u8fd9\u671f\u95f4\u4e1a\u52a1\u5c31\u662f\u4e2d\u65ad\u7684\u3002\u4f46\u5982\u679c\u4e3b\u5e93\u672c\u8eab\u505a\u4e86Bonding\uff0c\u7f51\u5361\u574f\u4e86\u6d41\u91cf\u77ac\u95f4\u5207\u6362\uff0cKeepalived\u6839\u672c\u611f\u77e5\u4e0d\u5230\uff0c\u4e1a\u52a1\u5b8c\u5168\u65e0\u635f\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\u6211\u7684\u5efa\u8bae\u662f\uff1a\u5173\u952e\u4e1a\u52a1\u670d\u52a1\u5668\uff0cBonding\u662f\u5fc5\u987b\u7684\uff0c\u5728\u6b64\u57fa\u7840\u4e0a\u518d\u53e0\u52a0\u670d\u52a1\u5c42\u9762\u7684\u9ad8\u53ef\u7528\u65b9\u6848\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e8c\u3001Bonding\u6a21\u5f0f\u8be6\u89e3<\/strong><\/h2>\n\n\n\n<p>Linux Bonding\u652f\u63017\u79cd\u5de5\u4f5c\u6a21\u5f0f\uff0c\u7f16\u53f7\u4ece0\u52306\u3002\u6bcf\u79cd\u6a21\u5f0f\u7684\u7279\u70b9\u548c\u9002\u7528\u573a\u666f\u90fd\u4e0d\u4e00\u6837\uff0c\u9009\u9519\u6a21\u5f0f\u53ef\u80fd\u8fbe\u4e0d\u5230\u9884\u671f\u6548\u679c\u3002\u4e0b\u9762\u9010\u4e2a\u5206\u6790\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.1 Mode 0\uff1abalance-rr\uff08\u8f6e\u8be2\u6a21\u5f0f\uff09<\/strong><\/h3>\n\n\n\n<p>\u8fd9\u662f\u6700\u7b80\u5355\u7684\u6a21\u5f0f\uff0c\u6570\u636e\u5305\u8f6e\u6d41\u4ece\u5404\u4e2aslave\u7f51\u5361\u53d1\u51fa\u53bb\u3002\u6bd4\u5982\u7b2c\u4e00\u4e2a\u5305\u4eceeth0\u53d1\uff0c\u7b2c\u4e8c\u4e2a\u5305\u4eceeth1\u53d1\uff0c\u7b2c\u4e09\u4e2a\u5305\u53c8\u4eceeth0\u53d1\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002<\/p>\n\n\n\n<p>\u4f18\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u914d\u7f6e\u7b80\u5355\uff0c\u4e0d\u9700\u8981\u4ea4\u6362\u673a\u914d\u5408<\/li>\n\n\n\n<li>\u7406\u8bba\u4e0a\u53ef\u4ee5\u5b9e\u73b0\u5e26\u5bbd\u53e0\u52a0<\/li>\n<\/ul>\n\n\n\n<p>\u7f3a\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u53ef\u80fd\u5bfc\u81f4\u6570\u636e\u5305\u4e71\u5e8f\uff0c\u5bf9TCP\u8fde\u63a5\u6709\u5f71\u54cd<\/li>\n\n\n\n<li>\u67d0\u4e9b\u4ea4\u6362\u673a\u53ef\u80fd\u56e0\u4e3aMAC\u5730\u5740\u5728\u591a\u4e2a\u7aef\u53e3\u51fa\u73b0\u800c\u4ea7\u751f\u56f0\u60d1<\/li>\n<\/ul>\n\n\n\n<p>\u9002\u7528\u573a\u666f\uff1a \u8bf4\u5b9e\u8bdd\uff0c\u751f\u4ea7\u73af\u5883\u6211\u51e0\u4e4e\u4e0d\u7528\u8fd9\u4e2a\u6a21\u5f0f\u3002\u56e0\u4e3a\u6570\u636e\u5305\u4e71\u5e8f\u7684\u95ee\u9898\u5728\u9ad8\u8d1f\u8f7d\u4e0b\u4f1a\u5f88\u660e\u663e\uff0c\u53ef\u80fd\u5bfc\u81f4TCP\u91cd\u4f20\u589e\u52a0\uff0c\u53cd\u800c\u964d\u4f4e\u6027\u80fd\u3002\u5982\u679c\u4f60\u7684\u573a\u666f\u4e3b\u8981\u662fUDP\u6d41\u91cf\uff0c\u53ef\u4ee5\u8003\u8651\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.2 Mode 1\uff1aactive-backup\uff08\u4e3b\u5907\u6a21\u5f0f\uff09<\/strong><\/h3>\n\n\n\n<p>\u8fd9\u662f\u6211\u7528\u5f97\u6700\u591a\u7684\u6a21\u5f0f\u3002\u987e\u540d\u601d\u4e49\uff0c\u540c\u4e00\u65f6\u95f4\u53ea\u6709\u4e00\u5757\u7f51\u5361\u5728\u5de5\u4f5c\uff0c\u5176\u4ed6\u7f51\u5361\u4f5c\u4e3a\u5907\u4efd\u3002\u4e3b\u7f51\u5361\u6545\u969c\u65f6\uff0c\u81ea\u52a8\u5207\u6362\u5230\u5907\u4efd\u7f51\u5361\u3002<\/p>\n\n\n\n<p>\u4f18\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u914d\u7f6e\u7b80\u5355\uff0c\u4e0d\u9700\u8981\u4ea4\u6362\u673a\u4efb\u4f55\u7279\u6b8a\u914d\u7f6e<\/li>\n\n\n\n<li>\u5207\u6362\u901f\u5ea6\u5feb\uff0c\u901a\u5e38\u5728\u6beb\u79d2\u7ea7<\/li>\n\n\n\n<li>\u7a33\u5b9a\u53ef\u9760\uff0c\u51e0\u4e4e\u4e0d\u4f1a\u51fa\u95ee\u9898<\/li>\n<\/ul>\n\n\n\n<p>\u7f3a\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e0d\u80fd\u5b9e\u73b0\u5e26\u5bbd\u53e0\u52a0\uff0c\u540c\u65f6\u53ea\u7528\u4e00\u5757\u7f51\u5361\u7684\u5e26\u5bbd<\/li>\n\n\n\n<li>\u5907\u4efd\u7f51\u5361\u5e73\u65f6\u95f2\u7f6e\uff0c\u6709\u70b9\u6d6a\u8d39<\/li>\n<\/ul>\n\n\n\n<p>\u9002\u7528\u573a\u666f\uff1a \u5927\u591a\u6570\u9700\u8981\u9ad8\u53ef\u7528\u4f46\u5bf9\u5e26\u5bbd\u8981\u6c42\u4e0d\u90a3\u4e48\u6781\u7aef\u7684\u573a\u666f\u3002\u6bd4\u5982\u6570\u636e\u5e93\u670d\u52a1\u5668\u3001\u5e94\u7528\u670d\u52a1\u5668\u3001\u7ba1\u7406\u7f51\u7edc\u7b49\u3002\u8fd9\u4e2a\u6a21\u5f0f\u6211\u63a8\u8350\u4f5c\u4e3a\u9ed8\u8ba4\u9009\u62e9\uff0c\u9664\u975e\u6709\u7279\u6b8a\u9700\u6c42\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.3 Mode 2\uff1abalance-xor\uff08\u5f02\u6216\u6a21\u5f0f\uff09<\/strong><\/h3>\n\n\n\n<p>\u8fd9\u4e2a\u6a21\u5f0f\u6839\u636e\u6e90MAC\u5730\u5740\u548c\u76ee\u6807MAC\u5730\u5740\u505a\u5f02\u6216\u8fd0\u7b97\uff0c\u7ed3\u679c\u51b3\u5b9a\u7528\u54ea\u5757\u7f51\u5361\u53d1\u9001\u3002\u76f8\u540c\u7684\u6e90\u76ee\u5730\u5740\u5bf9\uff0c\u603b\u662f\u8d70\u540c\u4e00\u5757\u7f51\u5361\u3002<\/p>\n\n\n\n<p>\u4f18\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u53ef\u4ee5\u5b9e\u73b0\u4e00\u5b9a\u7a0b\u5ea6\u7684\u8d1f\u8f7d\u5747\u8861<\/li>\n\n\n\n<li>\u540c\u4e00\u4e2a\u8fde\u63a5\u7684\u6570\u636e\u5305\u4e0d\u4f1a\u4e71\u5e8f<\/li>\n<\/ul>\n\n\n\n<p>\u7f3a\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9700\u8981\u4ea4\u6362\u673a\u652f\u6301\uff0c\u8981\u914d\u7f6e\u7aef\u53e3\u805a\u5408<\/li>\n\n\n\n<li>\u8d1f\u8f7d\u5747\u8861\u6548\u679c\u53d6\u51b3\u4e8e\u8fde\u63a5\u6570\uff0c\u8fde\u63a5\u5c11\u7684\u8bdd\u53ef\u80fd\u5206\u5e03\u4e0d\u5747<\/li>\n<\/ul>\n\n\n\n<p>\u9002\u7528\u573a\u666f\uff1a \u9700\u8981\u8d1f\u8f7d\u5747\u8861\u4e14\u4ea4\u6362\u673a\u652f\u6301\u9759\u6001\u805a\u5408\u7684\u573a\u666f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.4 Mode 3\uff1abroadcast\uff08\u5e7f\u64ad\u6a21\u5f0f\uff09<\/strong><\/h3>\n\n\n\n<p>\u6240\u6709\u6570\u636e\u5305\u90fd\u4ece\u6240\u6709slave\u7f51\u5361\u53d1\u9001\u51fa\u53bb\u3002<\/p>\n\n\n\n<p>\u8bf4\u5b9e\u8bdd\u8fd9\u4e2a\u6a21\u5f0f\u6211\u4ece\u6765\u6ca1\u5728\u751f\u4ea7\u73af\u5883\u7528\u8fc7\u3002\u5b83\u7684\u4e3b\u8981\u7528\u9014\u662f\u4e00\u4e9b\u7279\u6b8a\u7684\u5bb9\u9519\u573a\u666f\uff0c\u6bd4\u5982\u4e24\u5757\u7f51\u5361\u8fde\u5230\u4e24\u4e2a\u5b8c\u5168\u72ec\u7acb\u7684\u7f51\u7edc\uff0c\u786e\u4fdd\u6570\u636e\u4e00\u5b9a\u80fd\u9001\u8fbe\u3002\u4f46\u8fd9\u79cd\u573a\u666f\u592a\u5c11\u89c1\u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.5 Mode 4\uff1a802.3ad\uff08LACP\u52a8\u6001\u94fe\u8def\u805a\u5408\uff09<\/strong><\/h3>\n\n\n\n<p>\u8fd9\u662fIEEE\u6807\u51c6\u534f\u8bae\uff0c\u4e5f\u53ebLACP\uff08Link Aggregation Control Protocol\uff09\u3002\u5b83\u9700\u8981\u4ea4\u6362\u673a\u4e5f\u652f\u6301LACP\uff0c\u53cc\u65b9\u534f\u5546\u540e\u5efa\u7acb\u805a\u5408\u94fe\u8def\u3002<\/p>\n\n\n\n<p>\u4f18\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6807\u51c6\u534f\u8bae\uff0c\u517c\u5bb9\u6027\u597d<\/li>\n\n\n\n<li>\u771f\u6b63\u7684\u5e26\u5bbd\u805a\u5408<\/li>\n\n\n\n<li>\u81ea\u52a8\u6545\u969c\u68c0\u6d4b\u548c\u6062\u590d<\/li>\n<\/ul>\n\n\n\n<p>\u7f3a\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5fc5\u987b\u4ea4\u6362\u673a\u652f\u6301LACP\u5e76\u6b63\u786e\u914d\u7f6e<\/li>\n\n\n\n<li>\u914d\u7f6e\u76f8\u5bf9\u590d\u6742<\/li>\n\n\n\n<li>\u8d1f\u8f7d\u5747\u8861\u6548\u679c\u53d6\u51b3\u4e8ehash\u7b97\u6cd5\u548c\u6d41\u91cf\u6a21\u5f0f<\/li>\n<\/ul>\n\n\n\n<p>\u9002\u7528\u573a\u666f\uff1a \u5bf9\u5e26\u5bbd\u6709\u8f83\u9ad8\u8981\u6c42\uff0c\u4e14\u4ea4\u6362\u673a\u652f\u6301LACP\u7684\u573a\u666f\u3002\u6bd4\u5982\u5b58\u50a8\u670d\u52a1\u5668\u3001\u5927\u6570\u636e\u8282\u70b9\u3001\u865a\u62df\u5316\u5bbf\u4e3b\u673a\u7b49\u3002\u8fd9\u662f\u76ee\u524d\u4e1a\u754c\u7528\u5f97\u6700\u591a\u7684\u805a\u5408\u6a21\u5f0f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.6 Mode 5\uff1abalance-tlb\uff08\u81ea\u9002\u5e94\u4f20\u8f93\u8d1f\u8f7d\u5747\u8861\uff09<\/strong><\/h3>\n\n\n\n<p>\u8fd9\u4e2a\u6a21\u5f0f\u6bd4\u8f83\u806a\u660e\uff0c\u5b83\u6839\u636e\u6bcf\u4e2aslave\u7f51\u5361\u7684\u8d1f\u8f7d\u60c5\u51b5\u52a8\u6001\u5206\u914d\u51fa\u7ad9\u6d41\u91cf\u3002\u8d1f\u8f7d\u4f4e\u7684\u7f51\u5361\u4f1a\u5206\u914d\u66f4\u591a\u6d41\u91cf\u3002<\/p>\n\n\n\n<p>\u4f18\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e0d\u9700\u8981\u4ea4\u6362\u673a\u7279\u6b8a\u914d\u7f6e<\/li>\n\n\n\n<li>\u51fa\u7ad9\u6d41\u91cf\u53ef\u4ee5\u8d1f\u8f7d\u5747\u8861<\/li>\n<\/ul>\n\n\n\n<p>\u7f3a\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5165\u7ad9\u6d41\u91cf\u4e0d\u80fd\u8d1f\u8f7d\u5747\u8861\uff0c\u90fd\u8d70\u4e3b\u7f51\u5361<\/li>\n\n\n\n<li>\u5b9e\u73b0\u76f8\u5bf9\u590d\u6742\uff0c\u53ef\u80fd\u6709\u517c\u5bb9\u6027\u95ee\u9898<\/li>\n<\/ul>\n\n\n\n<p>\u9002\u7528\u573a\u666f\uff1a \u4ea4\u6362\u673a\u4e0d\u652f\u6301\u805a\u5408\uff0c\u4f46\u53c8\u60f3\u5b9e\u73b0\u51fa\u7ad9\u8d1f\u8f7d\u5747\u8861\u7684\u573a\u666f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.7 Mode 6\uff1abalance-alb\uff08\u81ea\u9002\u5e94\u8d1f\u8f7d\u5747\u8861\uff09<\/strong><\/h3>\n\n\n\n<p>\u8fd9\u662fMode 5\u7684\u589e\u5f3a\u7248\uff0c\u4e0d\u4ec5\u51fa\u7ad9\u6d41\u91cf\u8d1f\u8f7d\u5747\u8861\uff0c\u5165\u7ad9\u6d41\u91cf\u4e5f\u80fd\u5747\u8861\u3002\u5b83\u901a\u8fc7ARP\u534f\u5546\u6765\u5b9e\u73b0\uff0c\u4f1a\u4e3b\u52a8\u4fee\u6539ARP\u54cd\u5e94\u4e2d\u7684MAC\u5730\u5740\u3002<\/p>\n\n\n\n<p>\u4f18\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4e0d\u9700\u8981\u4ea4\u6362\u673a\u7279\u6b8a\u914d\u7f6e<\/li>\n\n\n\n<li>\u51fa\u5165\u7ad9\u6d41\u91cf\u90fd\u80fd\u8d1f\u8f7d\u5747\u8861<\/li>\n<\/ul>\n\n\n\n<p>\u7f3a\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ARP\u64cd\u4f5c\u53ef\u80fd\u5728\u67d0\u4e9b\u7f51\u7edc\u73af\u5883\u4e0b\u6709\u95ee\u9898<\/li>\n\n\n\n<li>\u865a\u62df\u5316\u73af\u5883\u4e0b\u53ef\u80fd\u4e0dwork<\/li>\n<\/ul>\n\n\n\n<p>\u9002\u7528\u573a\u666f\uff1a \u7269\u7406\u670d\u52a1\u5668\u73af\u5883\uff0c\u4ea4\u6362\u673a\u4e0d\u652f\u6301\u805a\u5408\u4f46\u9700\u8981\u53cc\u5411\u8d1f\u8f7d\u5747\u8861\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.8 \u6a21\u5f0f\u9009\u62e9\u5efa\u8bae<\/strong><\/h3>\n\n\n\n<p>\u57fa\u4e8e\u8fd9\u4e9b\u5e74\u7684\u7ecf\u9a8c\uff0c\u6211\u603b\u7ed3\u4e86\u4e00\u4e2a\u9009\u62e9\u6d41\u7a0b\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5982\u679c\u53ea\u9700\u8981\u9ad8\u53ef\u7528\uff0c\u4e0d\u9700\u8981\u5e26\u5bbd\u53e0\u52a0 -&gt; Mode 1\uff08active-backup\uff09<\/li>\n\n\n\n<li>\u5982\u679c\u9700\u8981\u5e26\u5bbd\u805a\u5408\uff0c\u4ea4\u6362\u673a\u652f\u6301LACP -&gt; Mode 4\uff08802.3ad\uff09<\/li>\n\n\n\n<li>\u5982\u679c\u9700\u8981\u5e26\u5bbd\u805a\u5408\uff0c\u4ea4\u6362\u673a\u53ea\u652f\u6301\u9759\u6001\u805a\u5408 -&gt; Mode 2\uff08balance-xor\uff09<\/li>\n\n\n\n<li>\u5982\u679c\u4ea4\u6362\u673a\u5565\u90fd\u4e0d\u652f\u6301\uff0c\u53c8\u60f3\u8d1f\u8f7d\u5747\u8861 -&gt; Mode 6\uff08balance-alb\uff09<\/li>\n<\/ol>\n\n\n\n<p>90%\u7684\u573a\u666f\uff0c\u7528Mode 1\u6216Mode 4\u5c31\u591f\u4e86\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e09\u3001Bonding\u914d\u7f6e\u5b9e\u6218<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.1 \u73af\u5883\u51c6\u5907<\/strong><\/h3>\n\n\n\n<p>\u5728\u5f00\u59cb\u914d\u7f6e\u4e4b\u524d\uff0c\u5148\u68c0\u67e5\u51e0\u4e2a\u524d\u63d0\u6761\u4ef6\u3002<\/p>\n\n\n\n<p>\u786e\u8ba4\u5185\u6838\u652f\u6301Bonding\uff1a<br><br><em># \u68c0\u67e5bonding\u6a21\u5757<\/em><br>lsmod | grep bonding<br><br><em># \u5982\u679c\u6ca1\u6709\u52a0\u8f7d\uff0c\u624b\u52a8\u52a0\u8f7d<\/em><br>modprobe bonding<br><br><em># \u67e5\u770b\u6a21\u5757\u4fe1\u606f<\/em><br>modinfo bonding<\/p>\n\n\n\n<p>\u5728\u73b0\u4ee3Linux\u53d1\u884c\u7248\u4e0a\uff0cbonding\u6a21\u5757\u9ed8\u8ba4\u90fd\u662f\u7f16\u8bd1\u8fdb\u5185\u6838\u7684\uff0c\u4e00\u822c\u4e0d\u9700\u8981\u989d\u5916\u5b89\u88c5\u3002<\/p>\n\n\n\n<p>\u786e\u8ba4\u6709\u591a\u5757\u7f51\u5361\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u67e5\u770b\u6240\u6709\u7f51\u7edc\u63a5\u53e3<\/em><br>ip link show<br><br><em># \u6216\u8005\u7528\u8001\u547d\u4ee4<\/em><br>ifconfig -a<br><br><em># \u67e5\u770b\u7f51\u5361\u8be6\u7ec6\u4fe1\u606f<\/em><br>ethtool eth0<br>ethtool eth1<\/code><\/pre>\n\n\n\n<p>\u786e\u8ba4\u7f51\u5361\u8fde\u63a5\u72b6\u6001\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u67e5\u770b\u94fe\u8def\u72b6\u6001<\/em><br>ethtool eth0 | grep&nbsp;\"Link detected\"<br>ethtool eth1 | grep&nbsp;\"Link detected\"<br><br><em># \u6216\u8005<\/em><br>cat \/sys\/class\/net\/eth0\/carrier<br>cat \/sys\/class\/net\/eth1\/carrier<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.2 RHEL\/Rocky\/AlmaLinux 9 \u914d\u7f6e\u65b9\u6cd5<\/strong><\/h3>\n\n\n\n<p>RHEL\u7cfb\u4ece\u7248\u672c8\u5f00\u59cb\u63a8\u8350\u4f7f\u7528nmcli\uff08NetworkManager\u547d\u4ee4\u884c\u5de5\u5177\uff09\u6765\u7ba1\u7406\u7f51\u7edc\u3002RHEL 9\u4e0a\uff0c\u4f20\u7edf\u7684network-scripts\u5df2\u7ecf\u5f7b\u5e95\u79fb\u9664\u4e86\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3.2.1 \u4f7f\u7528nmcli\u914d\u7f6eMode 1\uff08\u4e3b\u5907\u6a21\u5f0f\uff09<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u521b\u5efabond\u63a5\u53e3<\/em><br>nmcli connection add&nbsp;type&nbsp;bond \\<br>&nbsp; &nbsp; con-name bond0 \\<br>&nbsp; &nbsp; ifname bond0 \\<br>&nbsp; &nbsp; bond.options&nbsp;\"mode=active-backup,miimon=100,primary=ens33\"<br><br><em># \u6dfb\u52a0\u7b2c\u4e00\u4e2aslave<\/em><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond0-slave1 \\<br>&nbsp; &nbsp; ifname ens33 \\<br>&nbsp; &nbsp; master bond0<br><br><em># \u6dfb\u52a0\u7b2c\u4e8c\u4e2aslave<\/em><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond0-slave2 \\<br>&nbsp; &nbsp; ifname ens34 \\<br>&nbsp; &nbsp; master bond0<br><br><em># \u914d\u7f6eIP\u5730\u5740<\/em><br>nmcli connection modify bond0 \\<br>&nbsp; &nbsp; ipv4.addresses 192.168.1.100\/24 \\<br>&nbsp; &nbsp; ipv4.gateway 192.168.1.1 \\<br>&nbsp; &nbsp; ipv4.dns&nbsp;\"8.8.8.8,8.8.4.4\"&nbsp;\\<br>&nbsp; &nbsp; ipv4.method manual<br><br><em># \u542f\u52a8bond<\/em><br>nmcli connection up bond0<\/code><\/pre>\n\n\n\n<p>\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>mode=active-backup\uff1a\u4e3b\u5907\u6a21\u5f0f<\/li>\n\n\n\n<li>miimon=100\uff1a\u6bcf100\u6beb\u79d2\u68c0\u6d4b\u4e00\u6b21\u94fe\u8def\u72b6\u6001<\/li>\n\n\n\n<li>primary=ens33\uff1a\u6307\u5b9aens33\u4e3a\u4e3b\u7f51\u5361<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3.2.2 \u4f7f\u7528nmcli\u914d\u7f6eMode 4\uff08LACP\u6a21\u5f0f\uff09<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u521b\u5efabond\u63a5\u53e3<\/em><br>nmcli connection add&nbsp;type&nbsp;bond \\<br>&nbsp; &nbsp; con-name bond0 \\<br>&nbsp; &nbsp; ifname bond0 \\<br>&nbsp; &nbsp; bond.options&nbsp;\"mode=802.3ad,miimon=100,lacp_rate=fast,xmit_hash_policy=layer3+4\"<br><br><em># \u6dfb\u52a0slave<\/em><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond0-slave1 \\<br>&nbsp; &nbsp; ifname ens33 \\<br>&nbsp; &nbsp; master bond0<br><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond0-slave2 \\<br>&nbsp; &nbsp; ifname ens34 \\<br>&nbsp; &nbsp; master bond0<br><br><em># \u914d\u7f6eIP<\/em><br>nmcli connection modify bond0 \\<br>&nbsp; &nbsp; ipv4.addresses 192.168.1.100\/24 \\<br>&nbsp; &nbsp; ipv4.gateway 192.168.1.1 \\<br>&nbsp; &nbsp; ipv4.method manual<br><br><em># \u542f\u52a8<\/em><br>nmcli connection up bond0<\/code><\/pre>\n\n\n\n<p>\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>mode=802.3ad\uff1aLACP\u6a21\u5f0f<\/li>\n\n\n\n<li>lacp_rate=fast\uff1a\u5feb\u901fLACP\u534f\u5546\uff08\u6bcf\u79d2\u4e00\u6b21\uff09\uff0c\u9ed8\u8ba4\u662fslow\uff08\u6bcf30\u79d2\u4e00\u6b21\uff09<\/li>\n\n\n\n<li>xmit_hash_policy=layer3+4\uff1a\u4f7f\u7528IP\u5730\u5740\u548c\u7aef\u53e3\u53f7\u505ahash\uff0c\u8d1f\u8f7d\u5747\u8861\u6548\u679c\u66f4\u597d<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3.2.3 \u67e5\u770b\u548c\u7ba1\u7406bond\u72b6\u6001<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u67e5\u770bbond\u72b6\u6001<\/em><br>cat \/proc\/net\/bonding\/bond0<br><br><em># \u67e5\u770b\u8fde\u63a5\u72b6\u6001<\/em><br>nmcli connection show<br><br><em># \u67e5\u770b\u8bbe\u5907\u72b6\u6001<\/em><br>nmcli device status<br><br><em># \u67e5\u770b\u8be6\u7ec6\u914d\u7f6e<\/em><br>nmcli connection show bond0<br><br><em># \u4e34\u65f6\u7981\u7528\u67d0\u4e2aslave\uff08\u6d4b\u8bd5\u7528\uff09<\/em><br>nmcli device disconnect ens33<br><br><em># \u91cd\u65b0\u542f\u7528<\/em><br>nmcli device connect ens33<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.3 Ubuntu 24.04 \u914d\u7f6e\u65b9\u6cd5<\/strong><\/h3>\n\n\n\n<p>Ubuntu\u4ece17.10\u5f00\u59cb\u4f7f\u7528Netplan\u4f5c\u4e3a\u7f51\u7edc\u914d\u7f6e\u5de5\u5177\uff0c\u5e95\u5c42\u53ef\u4ee5\u9009\u62e9NetworkManager\u6216systemd-networkd\u4f5c\u4e3a\u6e32\u67d3\u5668\u3002\u670d\u52a1\u5668\u7248\u9ed8\u8ba4\u7528systemd-networkd\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3.3.1 Netplan\u914d\u7f6eMode 1<\/strong><\/h4>\n\n\n\n<p>\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6&nbsp;<code>\/etc\/netplan\/01-bond-config.yaml<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>network:<br>&nbsp;&nbsp;version:&nbsp;2<br>&nbsp;&nbsp;renderer:&nbsp;networkd<br><br>&nbsp;&nbsp;ethernets:<br>&nbsp; &nbsp;&nbsp;ens33:<br>&nbsp; &nbsp; &nbsp;&nbsp;dhcp4:&nbsp;false<br>&nbsp; &nbsp; &nbsp;&nbsp;dhcp6:&nbsp;false<br>&nbsp; &nbsp;&nbsp;ens34:<br>&nbsp; &nbsp; &nbsp;&nbsp;dhcp4:&nbsp;false<br>&nbsp; &nbsp; &nbsp;&nbsp;dhcp6:&nbsp;false<br><br>&nbsp;&nbsp;bonds:<br>&nbsp; &nbsp;&nbsp;bond0:<br>&nbsp; &nbsp; &nbsp;&nbsp;interfaces:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;ens33<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;ens34<br>&nbsp; &nbsp; &nbsp;&nbsp;addresses:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;192.168.1.100\/24<br>&nbsp; &nbsp; &nbsp;&nbsp;routes:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;to:&nbsp;default<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;via:&nbsp;192.168.1.1<br>&nbsp; &nbsp; &nbsp;&nbsp;nameservers:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;addresses:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;8.8.8.8<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;8.8.4.4<br>&nbsp; &nbsp; &nbsp;&nbsp;parameters:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;mode:&nbsp;active-backup<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;primary:&nbsp;ens33<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;mii-monitor-interval:&nbsp;100<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;fail-over-mac-policy:&nbsp;active<\/code><\/pre>\n\n\n\n<p>\u5e94\u7528\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u68c0\u67e5\u914d\u7f6e\u8bed\u6cd5<\/em><br>netplan try<br><br><em># \u5e94\u7528\u914d\u7f6e<\/em><br>netplan apply<br><br><em># \u67e5\u770b\u72b6\u6001<\/em><br>networkctl status bond0<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3.3.2 Netplan\u914d\u7f6eMode 4<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>network:<br>&nbsp;&nbsp;version:&nbsp;2<br>&nbsp;&nbsp;renderer:&nbsp;networkd<br><br>&nbsp;&nbsp;ethernets:<br>&nbsp; &nbsp;&nbsp;ens33:<br>&nbsp; &nbsp; &nbsp;&nbsp;dhcp4:&nbsp;false<br>&nbsp; &nbsp;&nbsp;ens34:<br>&nbsp; &nbsp; &nbsp;&nbsp;dhcp4:&nbsp;false<br><br>&nbsp;&nbsp;bonds:<br>&nbsp; &nbsp;&nbsp;bond0:<br>&nbsp; &nbsp; &nbsp;&nbsp;interfaces:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;ens33<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;ens34<br>&nbsp; &nbsp; &nbsp;&nbsp;addresses:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;192.168.1.100\/24<br>&nbsp; &nbsp; &nbsp;&nbsp;routes:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;to:&nbsp;default<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;via:&nbsp;192.168.1.1<br>&nbsp; &nbsp; &nbsp;&nbsp;nameservers:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;addresses:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;8.8.8.8<br>&nbsp; &nbsp; &nbsp;&nbsp;parameters:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;mode:&nbsp;802.3ad<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;lacp-rate:&nbsp;fast<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;mii-monitor-interval:&nbsp;100<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;transmit-hash-policy:&nbsp;layer3+4<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>3.3.3 \u4f7f\u7528systemd-networkd\u76f4\u63a5\u914d\u7f6e<\/strong><\/h4>\n\n\n\n<p>\u5982\u679c\u4e0d\u60f3\u7528Netplan\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u5199systemd-networkd\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n\n\n\n<p>\u521b\u5efa&nbsp;<code>\/etc\/systemd\/network\/10-bond0.netdev<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;NetDev]<br>Name=bond0<br>Kind=bond<br><br>&#91;Bond]<br>Mode=802.3ad<br>TransmitHashPolicy=layer3+4<br>MIIMonitorSec=100ms<br>LACPTransmitRate=fast<\/code><\/pre>\n\n\n\n<p>\u521b\u5efa&nbsp;<code>\/etc\/systemd\/network\/20-bond0-slave.network<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Match]<br>Name=ens33 ens34<br><br>&#91;Network]<br>Bond=bond0<\/code><\/pre>\n\n\n\n<p>\u521b\u5efa&nbsp;<code>\/etc\/systemd\/network\/30-bond0.network<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Match]<br>Name=bond0<br><br>&#91;Network]<br>Address=192.168.1.100\/24<br>Gateway=192.168.1.1<br>DNS=8.8.8.8<\/code><\/pre>\n\n\n\n<p>\u91cd\u542f\u7f51\u7edc\u670d\u52a1\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart systemd-networkd<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.4 Debian 12 \u914d\u7f6e\u65b9\u6cd5<\/strong><\/h3>\n\n\n\n<p>Debian 12\u53ef\u4ee5\u4f7f\u7528\u4f20\u7edf\u7684ifupdown\u914d\u7f6e\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528systemd-networkd\u3002\u8fd9\u91cc\u6f14\u793aifupdown\u65b9\u5f0f\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u5b89\u88c5ifenslave\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt install ifenslave<\/code><\/pre>\n\n\n\n<p>\u7f16\u8f91&nbsp;<code>\/etc\/network\/interfaces<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u56de\u73af\u63a5\u53e3<\/em><br>auto lo<br>iface lo inet loopback<br><br><em># \u7269\u7406\u7f51\u5361\u8bbe\u4e3a\u624b\u52a8\u6a21\u5f0f<\/em><br>auto ens33<br>iface ens33 inet manual<br>&nbsp; &nbsp; bond-master bond0<br><br>auto ens34<br>iface ens34 inet manual<br>&nbsp; &nbsp; bond-master bond0<br><br><em># Bond\u63a5\u53e3\u914d\u7f6e<\/em><br>auto bond0<br>iface bond0 inet static<br>&nbsp; &nbsp; address 192.168.1.100<br>&nbsp; &nbsp; netmask 255.255.255.0<br>&nbsp; &nbsp; gateway 192.168.1.1<br>&nbsp; &nbsp; dns-nameservers 8.8.8.8<br>&nbsp; &nbsp; bond-slaves ens33 ens34<br>&nbsp; &nbsp; bond-mode active-backup<br>&nbsp; &nbsp; bond-miimon 100<br>&nbsp; &nbsp; bond-primary ens33<\/code><\/pre>\n\n\n\n<p>\u91cd\u542f\u7f51\u7edc\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart networking<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.5 \u914d\u7f6e\u6c38\u4e45\u52a0\u8f7dbonding\u6a21\u5757<\/strong><\/h3>\n\n\n\n<p>\u786e\u4fddbonding\u6a21\u5757\u5f00\u673a\u81ea\u52a8\u52a0\u8f7d\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># RHEL\u7cfb<\/em><br>echo&nbsp;\"bonding\"&nbsp;&gt; \/etc\/modules-load.d\/bonding.conf<br><br><em># Debian\/Ubuntu<\/em><br>echo&nbsp;\"bonding\"&nbsp;&gt;&gt; \/etc\/modules<br><br><em># \u914d\u7f6e\u6a21\u5757\u53c2\u6570\uff08\u53ef\u9009\uff09<\/em><br>cat &gt; \/etc\/modprobe.d\/bonding.conf &lt;&lt; EOF<br>options bonding max_bonds=0<br>EOF<\/code><\/pre>\n\n\n\n<p><code>max_bonds=0<\/code>\u8868\u793a\u4e0d\u81ea\u52a8\u521b\u5efabond\u63a5\u53e3\uff0c\u8ba9\u7f51\u7edc\u7ba1\u7406\u5de5\u5177\u6765\u521b\u5efa\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u56db\u3001\u4ea4\u6362\u673a\u914d\u7f6e<\/strong><\/h2>\n\n\n\n<p>Bonding\u7684\u67d0\u4e9b\u6a21\u5f0f\u9700\u8981\u4ea4\u6362\u673a\u914d\u5408\u914d\u7f6e\uff0c\u7279\u522b\u662fMode 4\uff08LACP\uff09\u3002\u8fd9\u91cc\u7ed9\u51fa\u51e0\u4e2a\u4e3b\u6d41\u4ea4\u6362\u673a\u7684\u914d\u7f6e\u793a\u4f8b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.1 \u534e\u4e3a\u4ea4\u6362\u673a\u914d\u7f6eLACP<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u8fdb\u5165\u7cfb\u7edf\u89c6\u56fe<\/em><br>system-view<br><br><em># \u521b\u5efa\u94fe\u8def\u805a\u5408\u7ec4<\/em><br>interface Eth-Trunk 1<br>&nbsp;mode lacp-static<br><br><em># \u5c06\u7aef\u53e3\u52a0\u5165\u805a\u5408\u7ec4<\/em><br>interface GigabitEthernet 0\/0\/1<br>&nbsp;eth-trunk 1<br><br>interface GigabitEthernet 0\/0\/2<br>&nbsp;eth-trunk 1<br><br><em># \u914d\u7f6e\u8d1f\u8f7d\u5747\u8861\u6a21\u5f0f<\/em><br>interface Eth-Trunk 1<br>&nbsp;load-balance src-dst-ip<br><br><em># \u67e5\u770b\u805a\u5408\u72b6\u6001<\/em><br>display eth-trunk 1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.2 \u601d\u79d1\u4ea4\u6362\u673a\u914d\u7f6eLACP<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u8fdb\u5165\u5168\u5c40\u914d\u7f6e\u6a21\u5f0f<\/em><br>configure terminal<br><br><em># \u521b\u5efaPort-Channel<\/em><br>interface Port-channel1<br>&nbsp;switchport mode access<br>&nbsp;switchport access vlan 100<br><br><em># \u5c06\u7aef\u53e3\u52a0\u5165Port-Channel<\/em><br>interface range GigabitEthernet0\/1-2<br>&nbsp;channel-group 1 mode active<br><br><em># \u914d\u7f6e\u8d1f\u8f7d\u5747\u8861<\/em><br>port-channel load-balance src-dst-ip<br><br><em># \u67e5\u770b\u72b6\u6001<\/em><br>show etherchannel summary<br>show lacp neighbor<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.3 H3C\u4ea4\u6362\u673a\u914d\u7f6eLACP<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u8fdb\u5165\u7cfb\u7edf\u89c6\u56fe<\/em><br>system-view<br><br><em># \u521b\u5efa\u805a\u5408\u63a5\u53e3<\/em><br>interface Bridge-Aggregation 1<br>&nbsp;link-aggregation mode dynamic<br><br><em># \u5c06\u7aef\u53e3\u52a0\u5165\u805a\u5408\u7ec4<\/em><br>interface GigabitEthernet 1\/0\/1<br>&nbsp;port link-aggregation group 1<br><br>interface GigabitEthernet 1\/0\/2<br>&nbsp;port link-aggregation group 1<br><br><em># \u914d\u7f6e\u8d1f\u8f7d\u5747\u8861<\/em><br>link-aggregation load-sharing mode destination-ip&nbsp;source-ip<br><br><em># \u67e5\u770b\u72b6\u6001<\/em><br>display link-aggregation verbose<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4.4 \u4ea4\u6362\u673a\u914d\u7f6e\u6ce8\u610f\u4e8b\u9879<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u7aef\u53e3\u5c5e\u6027\u8981\u4e00\u81f4<\/strong>\uff1a\u805a\u5408\u7ec4\u5185\u7684\u6240\u6709\u7aef\u53e3\uff0c\u901f\u7387\u3001\u53cc\u5de5\u6a21\u5f0f\u3001VLAN\u914d\u7f6e\u5fc5\u987b\u5b8c\u5168\u4e00\u81f4\uff0c\u5426\u5219\u805a\u5408\u4f1a\u5931\u8d25\u3002<\/li>\n\n\n\n<li><strong>LACP\u6a21\u5f0f\u9009\u62e9<\/strong>\uff1a\u4ea4\u6362\u673a\u7aef\u53ef\u4ee5\u914d\u7f6e\u4e3aactive\u6216passive\u3002\u5efa\u8bae\u670d\u52a1\u5668\u548c\u4ea4\u6362\u673a\u81f3\u5c11\u6709\u4e00\u7aef\u662factive\uff0c\u5426\u5219\u534f\u5546\u4e0d\u4f1a\u542f\u52a8\u3002<\/li>\n\n\n\n<li><strong>\u8d1f\u8f7d\u5747\u8861\u7b97\u6cd5<\/strong>\uff1a\u4ea4\u6362\u673a\u548c\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\u5747\u8861\u7b97\u6cd5\u6700\u597d\u914d\u7f6e\u6210\u4e00\u6837\u7684\uff0c\u6bd4\u5982\u90fd\u7528layer3+4\uff0c\u8fd9\u6837\u6d41\u91cf\u5206\u5e03\u66f4\u5747\u5300\u3002<\/li>\n\n\n\n<li><strong>\u751f\u6210\u6811\u534f\u8bae<\/strong>\uff1a\u805a\u5408\u7aef\u53e3\u901a\u5e38\u4e0d\u9700\u8981\u542f\u7528STP\uff0c\u56e0\u4e3a\u805a\u5408\u672c\u8eab\u5c31\u662f\u5197\u4f59\u7684\u3002\u4f46\u5982\u679c\u7f51\u7edc\u62d3\u6251\u590d\u6742\uff0c\u8fd8\u662f\u5efa\u8bae\u4fdd\u7559\u3002<\/li>\n\n\n\n<li><strong>\u8de8\u8bbe\u5907\u805a\u5408<\/strong>\uff1a\u5982\u679c\u8981\u628a\u670d\u52a1\u5668\u7684\u4e24\u5757\u7f51\u5361\u5206\u522b\u8fde\u5230\u4e24\u53f0\u4ea4\u6362\u673a\uff0c\u9700\u8981\u4ea4\u6362\u673a\u652f\u6301\u8de8\u8bbe\u5907\u805a\u5408\uff08\u5982\u534e\u4e3a\u7684Eth-Trunk\u8de8\u6846\u3001\u601d\u79d1\u7684vPC\/VSS\uff09\u3002\u8fd9\u79cd\u914d\u7f6e\u66f4\u590d\u6742\uff0c\u4f46\u53ef\u7528\u6027\u66f4\u9ad8\u3002<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e94\u3001\u9ad8\u7ea7\u914d\u7f6e\u4e0e\u8c03\u4f18<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.1 ARP\u76d1\u63a7\u914d\u7f6e<\/strong><\/h3>\n\n\n\n<p>\u9664\u4e86MII\u76d1\u63a7\uff0cBonding\u8fd8\u652f\u6301ARP\u76d1\u63a7\u3002ARP\u76d1\u63a7\u901a\u8fc7\u5b9a\u671f\u53d1\u9001ARP\u8bf7\u6c42\u6765\u68c0\u6d4b\u94fe\u8def\u72b6\u6001\uff0c\u6bd4MII\u76d1\u63a7\u66f4\u53ef\u9760\uff0c\u56e0\u4e3a\u5b83\u80fd\u68c0\u6d4b\u5230\u7f51\u7edc\u4e0d\u901a\u4f46\u94fe\u8def\u5c42\u6b63\u5e38\u7684\u60c5\u51b5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># nmcli\u914d\u7f6eARP\u76d1\u63a7<\/em><br>nmcli connection modify bond0 \\<br>&nbsp; &nbsp; bond.options&nbsp;\"mode=active-backup,arp_interval=1000,arp_ip_target=192.168.1.1\"<\/code><\/pre>\n\n\n\n<p>\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>arp_interval=1000\uff1a\u6bcf1000\u6beb\u79d2\u53d1\u9001\u4e00\u6b21ARP\u8bf7\u6c42<\/li>\n\n\n\n<li>arp_ip_target=192.168.1.1\uff1aARP\u8bf7\u6c42\u7684\u76ee\u6807\u5730\u5740\uff0c\u901a\u5e38\u8bbe\u4e3a\u7f51\u5173<\/li>\n<\/ul>\n\n\n\n<p>\u6ce8\u610f\uff1aARP\u76d1\u63a7\u548cMII\u76d1\u63a7\u4e0d\u80fd\u540c\u65f6\u4f7f\u7528\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.2 \u591a\u4e2aARP\u76ee\u6807<\/strong><\/h3>\n\n\n\n<p>\u53ef\u4ee5\u914d\u7f6e\u591a\u4e2aARP\u76ee\u6807\u5730\u5740\uff0c\u63d0\u9ad8\u68c0\u6d4b\u53ef\u9760\u6027\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection modify bond0 \\<br>&nbsp; &nbsp; bond.options&nbsp;\"mode=active-backup,arp_interval=1000,arp_ip_target=192.168.1.1+192.168.1.2+192.168.1.3,arp_all_targets=any\"<\/code><\/pre>\n\n\n\n<p>arp_all_targets\u53c2\u6570\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>any\uff1a\u4efb\u610f\u4e00\u4e2a\u76ee\u6807\u53ef\u8fbe\u5c31\u8ba4\u4e3a\u94fe\u8def\u6b63\u5e38<\/li>\n\n\n\n<li>all\uff1a\u6240\u6709\u76ee\u6807\u90fd\u53ef\u8fbe\u624d\u8ba4\u4e3a\u94fe\u8def\u6b63\u5e38<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.3 \u914d\u7f6eBond\u63a5\u53e3\u7684MAC\u5730\u5740<\/strong><\/h3>\n\n\n\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cbond\u63a5\u53e3\u4f7f\u7528\u7b2c\u4e00\u4e2aslave\u7684MAC\u5730\u5740\u3002\u53ef\u4ee5\u624b\u52a8\u6307\u5b9a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u8bbe\u7f6e\u56fa\u5b9aMAC<\/em><br>nmcli connection modify bond0 \\<br>&nbsp; &nbsp; ethernet.cloned-mac-address&nbsp;\"00:11:22:33:44:55\"<\/code><\/pre>\n\n\n\n<p>\u6216\u8005\u914d\u7f6efail_over_mac\u53c2\u6570\u63a7\u5236\u6545\u969c\u5207\u6362\u65f6\u7684MAC\u884c\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection modify bond0 \\<br>&nbsp; &nbsp; bond.options&nbsp;\"mode=active-backup,miimon=100,fail_over_mac=active\"<\/code><\/pre>\n\n\n\n<p>fail_over_mac\u9009\u9879\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>none\uff1a\u9ed8\u8ba4\u503c\uff0cbond\u63a5\u53e3MAC\u4e0d\u53d8<\/li>\n\n\n\n<li>active\uff1abond\u63a5\u53e3\u4f7f\u7528\u5f53\u524dactive slave\u7684MAC<\/li>\n\n\n\n<li>follow\uff1aactive slave\u7684MAC\u8ddf\u968fbond\u63a5\u53e3<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.4 LACP\u53c2\u6570\u8c03\u4f18<\/strong><\/h3>\n\n\n\n<p>\u4f7f\u7528Mode 4\u65f6\uff0c\u6709\u51e0\u4e2a\u91cd\u8981\u53c2\u6570\u53ef\u4ee5\u8c03\u4f18\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection modify bond0 \\<br>&nbsp; &nbsp; bond.options&nbsp;\"mode=802.3ad,miimon=100,lacp_rate=fast,ad_select=bandwidth,xmit_hash_policy=layer3+4\"<\/code><\/pre>\n\n\n\n<p>\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n\n\n\n<p><strong>lacp_rate<\/strong>\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>slow\uff1a\u9ed8\u8ba4\u503c\uff0c\u6bcf30\u79d2\u53d1\u9001\u4e00\u6b21LACPDU<\/li>\n\n\n\n<li>fast\uff1a\u6bcf\u79d2\u53d1\u9001\u4e00\u6b21LACPDU\uff0c\u6545\u969c\u68c0\u6d4b\u66f4\u5feb<\/li>\n<\/ul>\n\n\n\n<p><strong>ad_select<\/strong>\uff1a\u805a\u5408\u7ec4\u9009\u62e9\u7b56\u7565<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>stable\uff1a\u9ed8\u8ba4\u503c\uff0c\u9009\u62e9\u540e\u4e0d\u518d\u6539\u53d8<\/li>\n\n\n\n<li>bandwidth\uff1a\u9009\u62e9\u5e26\u5bbd\u6700\u5927\u7684\u805a\u5408\u7ec4<\/li>\n\n\n\n<li>count\uff1a\u9009\u62e9\u7aef\u53e3\u6570\u6700\u591a\u7684\u805a\u5408\u7ec4<\/li>\n<\/ul>\n\n\n\n<p><strong>xmit_hash_policy<\/strong>\uff1a\u53d1\u9001hash\u7b56\u7565<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>layer2\uff1a\u57fa\u4e8eMAC\u5730\u5740hash<\/li>\n\n\n\n<li>layer3+4\uff1a\u57fa\u4e8eIP\u5730\u5740\u548c\u7aef\u53e3\u53f7hash\uff08\u63a8\u8350\uff09<\/li>\n\n\n\n<li>layer2+3\uff1a\u57fa\u4e8eMAC\u548cIP\u5730\u5740hash<\/li>\n\n\n\n<li>encap2+3\uff1a\u9488\u5bf9\u96a7\u9053\u5c01\u88c5\u6d41\u91cf<\/li>\n\n\n\n<li>encap3+4\uff1a\u9488\u5bf9\u96a7\u9053\u5c01\u88c5\u6d41\u91cf\uff0c\u4f7f\u7528\u5185\u5c42IP<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.5 \u914d\u7f6e\u591a\u4e2aBond\u63a5\u53e3<\/strong><\/h3>\n\n\n\n<p>\u4e00\u53f0\u670d\u52a1\u5668\u53ef\u4ee5\u914d\u7f6e\u591a\u4e2abond\u63a5\u53e3\uff0c\u7528\u4e8e\u4e0d\u540c\u7f51\u7edc\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u4e1a\u52a1\u7f51bond<\/em><br>nmcli connection add&nbsp;type&nbsp;bond \\<br>&nbsp; &nbsp; con-name bond0 \\<br>&nbsp; &nbsp; ifname bond0 \\<br>&nbsp; &nbsp; bond.options&nbsp;\"mode=802.3ad,miimon=100,xmit_hash_policy=layer3+4\"<br><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond0-slave1 \\<br>&nbsp; &nbsp; ifname ens33 \\<br>&nbsp; &nbsp; master bond0<br><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond0-slave2 \\<br>&nbsp; &nbsp; ifname ens34 \\<br>&nbsp; &nbsp; master bond0<br><br>nmcli connection modify bond0 \\<br>&nbsp; &nbsp; ipv4.addresses 192.168.1.100\/24 \\<br>&nbsp; &nbsp; ipv4.gateway 192.168.1.1 \\<br>&nbsp; &nbsp; ipv4.method manual<br><br><em># \u7ba1\u7406\u7f51bond<\/em><br>nmcli connection add&nbsp;type&nbsp;bond \\<br>&nbsp; &nbsp; con-name bond1 \\<br>&nbsp; &nbsp; ifname bond1 \\<br>&nbsp; &nbsp; bond.options&nbsp;\"mode=active-backup,miimon=100\"<br><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond1-slave1 \\<br>&nbsp; &nbsp; ifname ens35 \\<br>&nbsp; &nbsp; master bond1<br><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond1-slave2 \\<br>&nbsp; &nbsp; ifname ens36 \\<br>&nbsp; &nbsp; master bond1<br><br>nmcli connection modify bond1 \\<br>&nbsp; &nbsp; ipv4.addresses 10.0.0.100\/24 \\<br>&nbsp; &nbsp; ipv4.method manual<br><br><em># \u542f\u52a8<\/em><br>nmcli connection up bond0<br>nmcli connection up bond1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5.6 Bond\u63a5\u53e3\u914d\u7f6eVLAN<\/strong><\/h3>\n\n\n\n<p>bond\u63a5\u53e3\u4e0a\u53ef\u4ee5\u53e0\u52a0VLAN\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u5148\u521b\u5efabond<\/em><br>nmcli connection add&nbsp;type&nbsp;bond \\<br>&nbsp; &nbsp; con-name bond0 \\<br>&nbsp; &nbsp; ifname bond0 \\<br>&nbsp; &nbsp; bond.options&nbsp;\"mode=802.3ad,miimon=100\"<br><br><em># ... \u6dfb\u52a0slave\u7701\u7565 ...<\/em><br><br><em># \u5728bond\u4e0a\u521b\u5efaVLAN\u63a5\u53e3<\/em><br>nmcli connection add&nbsp;type&nbsp;vlan \\<br>&nbsp; &nbsp; con-name bond0.100 \\<br>&nbsp; &nbsp; dev bond0 \\<br>&nbsp; &nbsp; id 100 \\<br>&nbsp; &nbsp; ipv4.addresses 192.168.100.10\/24 \\<br>&nbsp; &nbsp; ipv4.method manual<br><br>nmcli connection add&nbsp;type&nbsp;vlan \\<br>&nbsp; &nbsp; con-name bond0.200 \\<br>&nbsp; &nbsp; dev bond0 \\<br>&nbsp; &nbsp; id 200 \\<br>&nbsp; &nbsp; ipv4.addresses 192.168.200.10\/24 \\<br>&nbsp; &nbsp; ipv4.method manual<\/code><\/pre>\n\n\n\n<p>\u8fd9\u79cd\u914d\u7f6e\u5e38\u7528\u4e8e\u670d\u52a1\u5668\u9700\u8981\u63a5\u5165\u591a\u4e2aVLAN\u7684\u573a\u666f\uff0c\u6bd4\u5982\u865a\u62df\u5316\u5bbf\u4e3b\u673a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u516d\u3001\u76d1\u63a7\u4e0e\u8fd0\u7ef4<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6.1 Bond\u72b6\u6001\u68c0\u67e5\u811a\u672c<\/strong><\/h3>\n\n\n\n<p>\u5199\u4e00\u4e2a\u5b9e\u7528\u7684\u68c0\u67e5\u811a\u672c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash<br><em># bond_check.sh - \u68c0\u67e5bonding\u72b6\u6001<\/em><br><br>RED='\\033&#91;0;31m'<br>GREEN='\\033&#91;0;32m'<br>YELLOW='\\033&#91;1;33m'<br>NC='\\033&#91;0m'<br><br>check_bond() {<br>&nbsp; &nbsp;&nbsp;local&nbsp;bond=$1<br>&nbsp; &nbsp;&nbsp;local&nbsp;bond_file=\"\/proc\/net\/bonding\/${bond}\"<br><br>&nbsp; &nbsp;&nbsp;if&nbsp;&#91;&#91; ! -f&nbsp;\"$bond_file\"&nbsp;]];&nbsp;then<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;echo&nbsp;-e&nbsp;\"${RED}&#91;ERROR]${NC}&nbsp;Bond interface&nbsp;${bond}&nbsp;does not exist\"<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;1<br>&nbsp; &nbsp;&nbsp;fi<br><br>&nbsp; &nbsp;&nbsp;echo&nbsp;\"==========================================\"<br>&nbsp; &nbsp;&nbsp;echo&nbsp;\"Checking:&nbsp;${bond}\"<br>&nbsp; &nbsp;&nbsp;echo&nbsp;\"==========================================\"<br><br>&nbsp; &nbsp;&nbsp;<em># \u83b7\u53d6bond\u6a21\u5f0f<\/em><br>&nbsp; &nbsp;&nbsp;local&nbsp;mode=$(grep&nbsp;\"Bonding Mode:\"&nbsp;\"$bond_file\"&nbsp;| cut -d: -f2 | xargs)<br>&nbsp; &nbsp;&nbsp;echo&nbsp;\"Mode:&nbsp;${mode}\"<br><br>&nbsp; &nbsp;&nbsp;<em># \u83b7\u53d6MII\u72b6\u6001<\/em><br>&nbsp; &nbsp;&nbsp;local&nbsp;mii_status=$(grep&nbsp;\"MII Status:\"&nbsp;\"$bond_file\"&nbsp;| head -1 | cut -d: -f2 | xargs)<br>&nbsp; &nbsp;&nbsp;if&nbsp;&#91;&#91;&nbsp;\"$mii_status\"&nbsp;==&nbsp;\"up\"&nbsp;]];&nbsp;then<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;echo&nbsp;-e&nbsp;\"Bond MII Status:&nbsp;${GREEN}${mii_status}${NC}\"<br>&nbsp; &nbsp;&nbsp;else<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;echo&nbsp;-e&nbsp;\"Bond MII Status:&nbsp;${RED}${mii_status}${NC}\"<br>&nbsp; &nbsp;&nbsp;fi<br><br>&nbsp; &nbsp;&nbsp;<em># \u68c0\u67e5\u5404slave\u72b6\u6001<\/em><br>&nbsp; &nbsp;&nbsp;echo&nbsp;\"\"<br>&nbsp; &nbsp;&nbsp;echo&nbsp;\"Slave Interfaces:\"<br>&nbsp; &nbsp;&nbsp;local&nbsp;slave_count=0<br>&nbsp; &nbsp;&nbsp;local&nbsp;active_count=0<br><br>&nbsp; &nbsp;&nbsp;while&nbsp;IFS=&nbsp;read&nbsp;-r line;&nbsp;do<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;&#91;&#91;&nbsp;\"$line\"&nbsp;=~ ^Slave\\ Interface:\\ (.+) ]];&nbsp;then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; current_slave=\"${BASH_REMATCH&#91;1]}\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ((slave_count++))<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;fi<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;&#91;&#91;&nbsp;\"$line\"&nbsp;=~ ^MII\\ Status:\\ (.+) ]];&nbsp;then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;&#91;&#91; -n&nbsp;\"$current_slave\"&nbsp;]];&nbsp;then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; status=\"${BASH_REMATCH&#91;1]}\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;&#91;&#91;&nbsp;\"$status\"&nbsp;==&nbsp;\"up\"&nbsp;]];&nbsp;then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;echo&nbsp;-e&nbsp;\" &nbsp;-&nbsp;${current_slave}:&nbsp;${GREEN}${status}${NC}\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ((active_count++))<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;else<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;echo&nbsp;-e&nbsp;\" &nbsp;-&nbsp;${current_slave}:&nbsp;${RED}${status}${NC}\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;fi<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; current_slave=\"\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;fi<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;fi<br>&nbsp; &nbsp;&nbsp;done&nbsp;&lt; &lt;(tail -n +10&nbsp;\"$bond_file\")<br><br>&nbsp; &nbsp;&nbsp;echo&nbsp;\"\"<br>&nbsp; &nbsp;&nbsp;echo&nbsp;\"Summary:&nbsp;${active_count}\/${slave_count}&nbsp;slaves active\"<br><br>&nbsp; &nbsp;&nbsp;if&nbsp;&#91;&#91;&nbsp;$active_count&nbsp;-eq 0 ]];&nbsp;then<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;echo&nbsp;-e&nbsp;\"${RED}&#91;CRITICAL]${NC}&nbsp;No active slaves!\"<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;2<br>&nbsp; &nbsp;&nbsp;elif&nbsp;&#91;&#91;&nbsp;$active_count&nbsp;-lt&nbsp;$slave_count&nbsp;]];&nbsp;then<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;echo&nbsp;-e&nbsp;\"${YELLOW}&#91;WARNING]${NC}&nbsp;Some slaves are down\"<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;1<br>&nbsp; &nbsp;&nbsp;else<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;echo&nbsp;-e&nbsp;\"${GREEN}&#91;OK]${NC}&nbsp;All slaves are active\"<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;0<br>&nbsp; &nbsp;&nbsp;fi<br>}<br><br><em># \u4e3b\u7a0b\u5e8f<\/em><br>if&nbsp;&#91;&#91;&nbsp;$#&nbsp;-eq 0 ]];&nbsp;then<br>&nbsp; &nbsp;&nbsp;<em># \u68c0\u67e5\u6240\u6709bond\u63a5\u53e3<\/em><br>&nbsp; &nbsp;&nbsp;for&nbsp;bond&nbsp;in&nbsp;\/proc\/net\/bonding\/bond*;&nbsp;do<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;&#91;&#91; -f&nbsp;\"$bond\"&nbsp;]];&nbsp;then<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bond_name=$(basename&nbsp;\"$bond\")<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; check_bond&nbsp;\"$bond_name\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;echo&nbsp;\"\"<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;fi<br>&nbsp; &nbsp;&nbsp;done<br>else<br>&nbsp; &nbsp;&nbsp;<em># \u68c0\u67e5\u6307\u5b9a\u7684bond\u63a5\u53e3<\/em><br>&nbsp; &nbsp;&nbsp;for&nbsp;bond&nbsp;in&nbsp;\"$@\";&nbsp;do<br>&nbsp; &nbsp; &nbsp; &nbsp; check_bond&nbsp;\"$bond\"<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;echo&nbsp;\"\"<br>&nbsp; &nbsp;&nbsp;done<br>fi<\/code><\/pre>\n\n\n\n<p>\u4f7f\u7528\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x bond_check.sh<br><br><em># \u68c0\u67e5\u6240\u6709bond<\/em><br>.\/bond_check.sh<br><br><em># \u68c0\u67e5\u6307\u5b9abond<\/em><br>.\/bond_check.sh bond0<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6.2 Prometheus\u76d1\u63a7\u914d\u7f6e<\/strong><\/h3>\n\n\n\n<p>\u4f7f\u7528node_exporter\u53ef\u4ee5\u91c7\u96c6bonding\u6307\u6807\u3002\u786e\u4fddnode_exporter\u542f\u7528\u4e86bonding collector\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u542f\u52a8node_exporter\u65f6\u542f\u7528bonding collector<\/em><br>.\/node_exporter --collector.bonding<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u914d\u7f6ePrometheus\u544a\u8b66\u89c4\u5219\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>groups:<br>&nbsp;&nbsp;-&nbsp;name:&nbsp;bonding<br>&nbsp; &nbsp;&nbsp;rules:<br>&nbsp; &nbsp; &nbsp;&nbsp;<em># Bond\u63a5\u53e3\u6709slave down<\/em><br>&nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;alert:&nbsp;BondingSlaveDegraded<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;expr:&nbsp;node_bonding_slaves&nbsp;-&nbsp;node_bonding_active&nbsp;!=&nbsp;0<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;for:&nbsp;1m<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;labels:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;severity:&nbsp;warning<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;annotations:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;summary:&nbsp;\"Bonding interface degraded on&nbsp;{{ $labels.instance }}\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;description:&nbsp;\"Bond&nbsp;{{ $labels.master }}&nbsp;has&nbsp;{{ $value }}&nbsp;inactive slaves\"<br><br>&nbsp; &nbsp; &nbsp;&nbsp;<em># Bond\u63a5\u53e3\u5b8c\u5168down<\/em><br>&nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;alert:&nbsp;BondingInterfaceDown<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;expr:&nbsp;node_bonding_active&nbsp;==&nbsp;0<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;for:&nbsp;30s<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;labels:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;severity:&nbsp;critical<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;annotations:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;summary:&nbsp;\"Bonding interface down on&nbsp;{{ $labels.instance }}\"<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;description:&nbsp;\"Bond&nbsp;{{ $labels.master }}&nbsp;has no active slaves\"<\/code><\/pre>\n\n\n\n<p>Grafana\u9762\u677f\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{<br>&nbsp;&nbsp;\"panels\": &#91;<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp;&nbsp;\"title\":&nbsp;\"Bond Active Slaves\",<br>&nbsp; &nbsp; &nbsp;&nbsp;\"type\":&nbsp;\"stat\",<br>&nbsp; &nbsp; &nbsp;&nbsp;\"targets\": &#91;<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"expr\":&nbsp;\"node_bonding_active{instance=\\\"$instance\\\"}\",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"legendFormat\":&nbsp;\"{{ master }}\"<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; ]<br>&nbsp; &nbsp; },<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp;&nbsp;\"title\":&nbsp;\"Bond Status\",<br>&nbsp; &nbsp; &nbsp;&nbsp;\"type\":&nbsp;\"table\",<br>&nbsp; &nbsp; &nbsp;&nbsp;\"targets\": &#91;<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"expr\":&nbsp;\"node_bonding_slaves{instance=\\\"$instance\\\"} - node_bonding_active{instance=\\\"$instance\\\"}\",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;\"legendFormat\":&nbsp;\"{{ master }}\"<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; ]<br>&nbsp; &nbsp; }<br>&nbsp; ]<br>}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6.3 \u65e5\u5fd7\u76d1\u63a7<\/strong><\/h3>\n\n\n\n<p>bonding\u76f8\u5173\u7684\u65e5\u5fd7\u5728\u7cfb\u7edf\u65e5\u5fd7\u4e2d\uff0c\u53ef\u4ee5\u8fd9\u6837\u76d1\u63a7\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u5b9e\u65f6\u67e5\u770bbonding\u65e5\u5fd7<\/em><br>journalctl -f | grep -i bonding<br><br><em># \u6216\u8005<\/em><br>tail -f \/var\/log\/messages | grep -i bonding<\/code><\/pre>\n\n\n\n<p>\u914d\u7f6ersyslog\u8f6c\u53d1bonding\u65e5\u5fd7\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \/etc\/rsyslog.d\/bonding.conf<\/em><br>:msg, contains,&nbsp;\"bonding\"&nbsp;\/var\/log\/bonding.log<br>&amp; stop<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6.4 \u5b9a\u671f\u5065\u5eb7\u68c0\u67e5Cron\u4efb\u52a1<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \/etc\/cron.d\/bond-check<\/em><br>*\/5 * * * * root \/usr\/local\/bin\/bond_check.sh &gt; \/dev\/null 2&gt;&amp;1 ||&nbsp;echo&nbsp;\"Bond degraded on&nbsp;$(hostname)\"&nbsp;| mail -s&nbsp;\"Bond Alert\"&nbsp;ops@example.com<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e03\u3001\u6545\u969c\u6392\u67e5\u6307\u5357<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7.1 \u5e38\u89c1\u95ee\u9898\uff1aBond\u63a5\u53e3\u65e0\u6cd5\u542f\u52a8<\/strong><\/h3>\n\n\n\n<p>\u73b0\u8c61\uff1a\u914d\u7f6e\u5b8c\u6210\u540e\uff0cbond\u63a5\u53e3\u65e0\u6cd5UP\u3002<\/p>\n\n\n\n<p>\u6392\u67e5\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># 1. \u68c0\u67e5bonding\u6a21\u5757\u662f\u5426\u52a0\u8f7d<\/em><br>lsmod | grep bonding<br><br><em># 2. \u68c0\u67e5\u914d\u7f6e\u6587\u4ef6\u8bed\u6cd5<\/em><br><em># RHEL\/Rocky<\/em><br>nmcli connection show bond0<br><br><em># Ubuntu<\/em><br>netplan try<br><br><em># 3. \u68c0\u67e5slave\u7f51\u5361\u72b6\u6001<\/em><br>ip link show ens33<br>ip link show ens34<br><br><em># 4. \u67e5\u770b\u7cfb\u7edf\u65e5\u5fd7<\/em><br>journalctl -xe | grep -i bond<br>dmesg | grep -i bond<br><br><em># 5. \u68c0\u67e5\u662f\u5426\u6709IP\u51b2\u7a81<\/em><br>arping -I bond0 192.168.1.100<\/code><\/pre>\n\n\n\n<p>\u5e38\u89c1\u539f\u56e0\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>slave\u7f51\u5361\u5df2\u7ecf\u914d\u7f6e\u4e86IP\u5730\u5740\uff0c\u9700\u8981\u5148\u6e05\u9664<\/li>\n\n\n\n<li>slave\u7f51\u5361\u88ab\u5176\u4ed6\u8fdb\u7a0b\u5360\u7528<\/li>\n\n\n\n<li>bonding\u6a21\u5757\u53c2\u6570\u9519\u8bef<\/li>\n<\/ul>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u6e05\u9664slave\u7f51\u5361\u7684IP\u914d\u7f6e<\/em><br>ip addr flush dev ens33<br>ip addr flush dev ens34<br><br><em># \u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e<\/em><br>nmcli connection reload<br>nmcli connection up bond0<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7.2 \u5e38\u89c1\u95ee\u9898\uff1aLACP\u534f\u5546\u5931\u8d25<\/strong><\/h3>\n\n\n\n<p>\u73b0\u8c61\uff1a\u914d\u7f6e\u4e86Mode 4\uff0c\u4f46bond\u72b6\u6001\u663e\u793a\u4e0d\u6b63\u5e38\uff0c\u6ca1\u6709\u5efa\u7acb\u805a\u5408\u3002<\/p>\n\n\n\n<p>\u6392\u67e5\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># 1. \u68c0\u67e5LACP\u72b6\u6001<\/em><br>cat \/proc\/net\/bonding\/bond0<br><em># \u6ce8\u610f\u770bPartner Mac Address\u662f\u5426\u4e3a00:00:00:00:00:00<\/em><br><br><em># 2. \u6293\u5305\u770bLACPDU<\/em><br>tcpdump -i ens33 ether proto 0x8809 -vv<br><br><em># 3. \u68c0\u67e5\u4ea4\u6362\u673a\u914d\u7f6e<\/em><br><em># \u767b\u5f55\u4ea4\u6362\u673a\u67e5\u770b\u805a\u5408\u72b6\u6001<\/em><\/code><\/pre>\n\n\n\n<p>\u5e38\u89c1\u539f\u56e0\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4ea4\u6362\u673a\u6ca1\u6709\u914d\u7f6eLACP\u6216\u914d\u7f6e\u9519\u8bef<\/li>\n\n\n\n<li>\u4ea4\u6362\u673a\u7aef\u53e3\u6a21\u5f0f\u4e0d\u5339\u914d\uff08access vs trunk\uff09<\/li>\n\n\n\n<li>\u4ea4\u6362\u673a\u7aef\u53e3VLAN\u914d\u7f6e\u4e0d\u4e00\u81f4<\/li>\n\n\n\n<li>\u7f51\u7ebf\u8fde\u63a5\u9519\u8bef<\/li>\n<\/ul>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u786e\u8ba4\u4ea4\u6362\u673a\u914d\u7f6e\u6b63\u786e<\/li>\n\n\n\n<li>\u786e\u4fdd\u7aef\u53e3\u5c5e\u6027\u4e00\u81f4<\/li>\n\n\n\n<li>\u5c1d\u8bd5\u5c06\u4ea4\u6362\u673aLACP\u6a21\u5f0f\u6539\u4e3aactive<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7.3 \u5e38\u89c1\u95ee\u9898\uff1aSlave\u9891\u7e41\u5207\u6362<\/strong><\/h3>\n\n\n\n<p>\u73b0\u8c61\uff1abond\u8fd0\u884c\u4e2d\uff0cslave\u9891\u7e41\u5728up\u548cdown\u4e4b\u95f4\u5207\u6362\u3002<\/p>\n\n\n\n<p>\u6392\u67e5\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># 1. \u67e5\u770b\u5207\u6362\u65e5\u5fd7<\/em><br>journalctl -u NetworkManager | grep -i bond<br><br><em># 2. \u68c0\u67e5\u7f51\u5361\u548c\u94fe\u8def\u72b6\u6001<\/em><br>ethtool ens33<br>ethtool ens34<br><br><em># 3. \u68c0\u67e5miimon\u8bbe\u7f6e\u662f\u5426\u5408\u7406<\/em><br>cat \/proc\/net\/bonding\/bond0 | grep&nbsp;\"MII Polling\"<br><br><em># 4. \u68c0\u67e5\u7f51\u5361\u9a71\u52a8\u548c\u56fa\u4ef6\u7248\u672c<\/em><br>ethtool -i ens33<\/code><\/pre>\n\n\n\n<p>\u5e38\u89c1\u539f\u56e0\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7f51\u7ebf\u63a5\u89e6\u4e0d\u826f<\/li>\n\n\n\n<li>\u7f51\u5361\u6216\u4ea4\u6362\u673a\u7aef\u53e3\u786c\u4ef6\u95ee\u9898<\/li>\n\n\n\n<li>\u7f51\u5361\u9a71\u52a8bug<\/li>\n\n\n\n<li>miimon\u8bbe\u7f6e\u592a\u77ed<\/li>\n<\/ul>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u66f4\u6362\u7f51\u7ebf<\/li>\n\n\n\n<li>\u66f4\u6362\u7f51\u5361\u6216\u4ea4\u6362\u673a\u7aef\u53e3<\/li>\n\n\n\n<li>\u66f4\u65b0\u7f51\u5361\u9a71\u52a8<\/li>\n\n\n\n<li>\u9002\u5f53\u589e\u52a0miimon\u503c\uff08\u5982200ms\uff09<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7.4 \u5e38\u89c1\u95ee\u9898\uff1aMode 4\u6d41\u91cf\u4e0d\u5747\u8861<\/strong><\/h3>\n\n\n\n<p>\u73b0\u8c61\uff1a\u4f7f\u7528LACP\u6a21\u5f0f\uff0c\u4f46\u6d41\u91cf\u660e\u663e\u504f\u5411\u67d0\u4e00\u5757\u7f51\u5361\u3002<\/p>\n\n\n\n<p>\u6392\u67e5\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># 1. \u67e5\u770b\u5404slave\u7684\u6d41\u91cf\u7edf\u8ba1<\/em><br>cat \/proc\/net\/bonding\/bond0<br><br><em># \u6216\u8005\u7528ip\u547d\u4ee4<\/em><br>ip -s link show ens33<br>ip -s link show ens34<br><br><em># 2. \u68c0\u67e5hash\u7b56\u7565<\/em><br>cat \/proc\/net\/bonding\/bond0 | grep&nbsp;\"Transmit Hash\"<br><br><em># 3. \u5206\u6790\u6d41\u91cf\u6a21\u5f0f<\/em><br>iftop -i bond0<\/code><\/pre>\n\n\n\n<p>\u539f\u56e0\u5206\u6790\uff1a LACP\u7684\u8d1f\u8f7d\u5747\u8861\u662f\u57fa\u4e8ehash\u7684\uff0c\u5982\u679c\u6d41\u91cf\u90fd\u6765\u81ea\u5c11\u91cf\u7684\u6e90\u6216\u76ee\u7684\u5730\u5740\uff0chash\u7ed3\u679c\u53ef\u80fd\u90fd\u843d\u5230\u540c\u4e00\u5757\u7f51\u5361\u4e0a\u3002<\/p>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6539\u7528layer3+4\u7684hash\u7b56\u7565\uff08\u5982\u679c\u8fd8\u6ca1\u7528\u7684\u8bdd\uff09<\/li>\n\n\n\n<li>\u8fd9\u662f\u6b63\u5e38\u73b0\u8c61\uff0chash\u8d1f\u8f7d\u5747\u8861\u4e0d\u662f\u7edd\u5bf9\u5747\u5300\u7684<\/li>\n\n\n\n<li>\u5982\u679c\u9700\u8981\u66f4\u5747\u5300\u7684\u5206\u5e03\uff0c\u8003\u8651Mode 6\uff08balance-alb\uff09<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7.5 \u5e38\u89c1\u95ee\u9898\uff1a\u865a\u62df\u673a\u4e2dBonding\u4e0d\u5de5\u4f5c<\/strong><\/h3>\n\n\n\n<p>\u73b0\u8c61\uff1a\u5728\u865a\u62df\u673a\u4e2d\u914d\u7f6ebonding\uff0c\u529f\u80fd\u4e0d\u6b63\u5e38\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u95ee\u9898\u6bd4\u8f83\u5e38\u89c1\uff0c\u539f\u56e0\u662f\u865a\u62df\u5316\u5e73\u53f0\u7684\u865a\u62df\u4ea4\u6362\u673a\u53ef\u80fd\u5bf9bonding\u7684\u67d0\u4e9b\u6a21\u5f0f\u652f\u6301\u4e0d\u597d\u3002<\/p>\n\n\n\n<p>VMware\u73af\u5883\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Mode 1\uff08active-backup\uff09\u901a\u5e38\u6ca1\u95ee\u9898<\/li>\n\n\n\n<li>Mode 4\uff08LACP\uff09\u9700\u8981vDS\uff08\u5206\u5e03\u5f0f\u4ea4\u6362\u673a\uff09\u4e14\u914d\u7f6eLAG<\/li>\n\n\n\n<li>Mode 6\uff08balance-alb\uff09\u53ef\u80fd\u4e0d\u5de5\u4f5c\uff0c\u56e0\u4e3aARP\u4ee3\u7406\u53d7\u9650<\/li>\n<\/ul>\n\n\n\n<p>KVM\/libvirt\u73af\u5883\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5efa\u8bae\u5728\u5bbf\u4e3b\u673a\u800c\u4e0d\u662f\u865a\u62df\u673a\u4e2d\u914d\u7f6ebonding<\/li>\n\n\n\n<li>\u5982\u679c\u5fc5\u987b\u5728VM\u4e2d\u914d\u7f6e\uff0c\u4f7f\u7528bridge\u7f51\u7edc\u4e14\u786e\u4fdd\u5bbf\u4e3b\u673a\u6865\u63a5\u914d\u7f6e\u6b63\u786e<\/li>\n<\/ul>\n\n\n\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u865a\u62df\u673a\u4e2d\u4f18\u5148\u4f7f\u7528Mode 1<\/li>\n\n\n\n<li>\u5982\u679c\u9700\u8981\u5e26\u5bbd\u805a\u5408\uff0c\u5728\u865a\u62df\u5316\u5e73\u53f0\u5c42\u9762\u505a\u805a\u5408<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>7.6 \u8c03\u8bd5\u547d\u4ee4\u6c47\u603b<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u67e5\u770bbond\u8be6\u7ec6\u72b6\u6001<\/em><br>cat \/proc\/net\/bonding\/bond0<br><br><em># \u67e5\u770b\u6240\u6709\u7f51\u7edc\u63a5\u53e3<\/em><br>ip addr show<br>ip link show<br><br><em># \u67e5\u770b\u7f51\u5361\u8be6\u7ec6\u4fe1\u606f<\/em><br>ethtool eth0<br>ethtool -i eth0 &nbsp;<em># \u9a71\u52a8\u4fe1\u606f<\/em><br>ethtool -S eth0 &nbsp;<em># \u7edf\u8ba1\u4fe1\u606f<\/em><br><br><em># \u67e5\u770bARP\u8868<\/em><br>ip neigh show<br><br><em># \u6293\u5305\u5206\u6790<\/em><br>tcpdump -i bond0 -nn<br>tcpdump -i ens33 ether proto 0x8809 -vv &nbsp;<em># LACP<\/em><br><br><em># \u67e5\u770b\u7cfb\u7edf\u65e5\u5fd7<\/em><br>journalctl -xe | grep -i bond<br>dmesg | grep -i bond<br><br><em># NetworkManager\u8c03\u8bd5<\/em><br>nmcli general logging level DEBUG domain ALL<br>journalctl -u NetworkManager -f<br><br><em># \u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e<\/em><br>nmcli connection reload<br>systemctl restart NetworkManager<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u516b\u3001\u5b9e\u6218\u6848\u4f8b<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>8.1 \u6848\u4f8b\u4e00\uff1a\u7535\u5546\u6838\u5fc3\u4ea4\u6613\u5e93\u9ad8\u53ef\u7528\u6539\u9020<\/strong><\/h3>\n\n\n\n<p>\u80cc\u666f\uff1a \u67d0\u7535\u5546\u5e73\u53f0\u7684MySQL\u4e3b\u5e93\u5355\u7f51\u5361\u90e8\u7f72\uff0c\u4e4b\u524d\u53d1\u751f\u8fc7\u7f51\u5361\u6545\u969c\u5bfc\u81f4\u670d\u52a1\u4e2d\u65ad\u7684\u60c5\u51b5\u3002\u9700\u8981\u6539\u9020\u4e3a\u53cc\u7f51\u5361bonding\uff0c\u8981\u6c42\u4e0d\u80fd\u5f71\u54cd\u73b0\u6709\u4e1a\u52a1\u3002<\/p>\n\n\n\n<p>\u73af\u5883\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u64cd\u4f5c\u7cfb\u7edf\uff1aRocky Linux 9.3<\/li>\n\n\n\n<li>\u670d\u52a1\u5668\uff1aDell PowerEdge R750<\/li>\n\n\n\n<li>\u7f51\u5361\uff1a\u677f\u8f7d\u53cc\u5343\u5146 + \u53cc\u4e07\u5146\u7f51\u5361<\/li>\n\n\n\n<li>\u4ea4\u6362\u673a\uff1a\u534e\u4e3aCE6800\u7cfb\u5217\uff0c\u652f\u6301LACP<\/li>\n<\/ul>\n\n\n\n<p>\u65b9\u6848\u8bbe\u8ba1\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4f7f\u7528\u4e24\u5757\u4e07\u5146\u7f51\u5361\u505abond\uff0c\u914d\u7f6eMode 4\uff08LACP\uff09<\/li>\n\n\n\n<li>\u5229\u7528\u7ef4\u62a4\u7a97\u53e3\u671f\u6267\u884c\u53d8\u66f4<\/li>\n\n\n\n<li>\u63d0\u524d\u5728\u6d4b\u8bd5\u73af\u5883\u9a8c\u8bc1<\/li>\n<\/ol>\n\n\n\n<p>\u5b9e\u65bd\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># 1. \u68c0\u67e5\u5f53\u524d\u7f51\u7edc\u914d\u7f6e<\/em><br>ip addr show<br>nmcli connection show<br><br><em># \u5f53\u524d\u914d\u7f6e\uff1a<\/em><br><em># ens33: 192.168.1.100\/24 (\u4e1a\u52a1IP)<\/em><br><em># ens34: \u672a\u914d\u7f6e<\/em><br><em># ens35: \u672a\u914d\u7f6e<\/em><br><em># ens36: 10.0.0.100\/24 (\u7ba1\u7406IP)<\/em><br><br><em># 2. \u4ea4\u6362\u673a\u914d\u7f6e\uff08\u7531\u7f51\u7edc\u5de5\u7a0b\u5e08\u6267\u884c\uff09<\/em><br><em># \u534e\u4e3a\u4ea4\u6362\u673a\u914d\u7f6eLACP<\/em><br><em># interface Eth-Trunk 10<\/em><br><em># &nbsp;mode lacp-static<\/em><br><em># interface 10GE1\/0\/1<\/em><br><em># &nbsp;eth-trunk 10<\/em><br><em># interface 10GE1\/0\/2<\/em><br><em># &nbsp;eth-trunk 10<\/em><br><br><em># 3. \u670d\u52a1\u5668\u7aef\u914d\u7f6e<\/em><br><em># \u5907\u4efd\u5f53\u524d\u914d\u7f6e<\/em><br>nmcli connection show --active &gt; \/root\/network_backup.txt<br><br><em># \u521b\u5efabond\u63a5\u53e3\uff08\u5148\u4e0d\u914dIP\uff09<\/em><br>nmcli connection add&nbsp;type&nbsp;bond \\<br>&nbsp; &nbsp; con-name bond0 \\<br>&nbsp; &nbsp; ifname bond0 \\<br>&nbsp; &nbsp; bond.options&nbsp;\"mode=802.3ad,miimon=100,lacp_rate=fast,xmit_hash_policy=layer3+4\"<br><br><em># \u6dfb\u52a0slave<\/em><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond0-port1 \\<br>&nbsp; &nbsp; ifname ens34 \\<br>&nbsp; &nbsp; master bond0<br><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond0-port2 \\<br>&nbsp; &nbsp; ifname ens35 \\<br>&nbsp; &nbsp; master bond0<br><br><em># 4. \u5173\u952e\u6b65\u9aa4\uff1aIP\u8fc1\u79fb<\/em><br><em># \u8fd9\u4e00\u6b65\u9700\u8981\u5feb\u901f\u6267\u884c\uff0c\u5efa\u8bae\u5199\u6210\u811a\u672c<\/em><br><br>cat &gt; \/root\/migrate_ip.sh &lt;&lt;&nbsp;'EOF'<br>#!\/bin\/bash<br>set&nbsp;-e<br><br><em># \u5220\u9664\u539f\u7f51\u5361IP<\/em><br>nmcli connection down ens33-connection<br><br><em># \u914d\u7f6ebond IP<\/em><br>nmcli connection modify bond0 \\<br>&nbsp; &nbsp; ipv4.addresses 192.168.1.100\/24 \\<br>&nbsp; &nbsp; ipv4.gateway 192.168.1.1 \\<br>&nbsp; &nbsp; ipv4.dns&nbsp;\"8.8.8.8\"&nbsp;\\<br>&nbsp; &nbsp; ipv4.method manual<br><br><em># \u542f\u52a8bond<\/em><br>nmcli connection up bond0<br><br>echo&nbsp;\"Migration completed\"<br>EOF<br><br>chmod +x \/root\/migrate_ip.sh<br><br><em># 5. \u6267\u884c\u8fc1\u79fb\uff08\u7ef4\u62a4\u7a97\u53e3\u5185\uff09<\/em><br><em># \u5148\u901a\u8fc7\u7ba1\u7406IP\u8fde\u63a5\u670d\u52a1\u5668<\/em><br>ssh admin@10.0.0.100<br><br><em># \u6267\u884c\u8fc1\u79fb\u811a\u672c<\/em><br>\/root\/migrate_ip.sh<br><br><em># 6. \u9a8c\u8bc1<\/em><br>cat \/proc\/net\/bonding\/bond0<br>ping -c 3 192.168.1.1<br>nmcli connection show --active<\/code><\/pre>\n\n\n\n<p>\u9a8c\u8bc1\u7ed3\u679c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Bonding Mode: IEEE 802.3ad Dynamic link aggregation<br>Transmit Hash Policy: layer3+4 (1)<br>MII Status: up<br>MII Polling Interval (ms): 100<br>LACP rate: fast<br><br>Slave Interface: ens34<br>MII Status: up<br>Speed: 10000 Mbps<br>Permanent HW addr: 00:11:22:33:44:55<br><br>Slave Interface: ens35<br>MII Status: up<br>Speed: 10000 Mbps<br>Permanent HW addr: 00:11:22:33:44:56<\/code><\/pre>\n\n\n\n<p>\u6545\u969c\u6d4b\u8bd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u6a21\u62df\u7f51\u5361\u6545\u969c<\/em><br>nmcli device disconnect ens34<br><br><em># \u67e5\u770bbond\u72b6\u6001<\/em><br>cat \/proc\/net\/bonding\/bond0<br><em># \u5e94\u663e\u793aens34\u4e3adown\uff0c\u4f46bond\u63a5\u53e3\u4ecd\u7136\u6b63\u5e38<\/em><br><br><em># \u4e1a\u52a1\u9a8c\u8bc1<\/em><br>mysql -h192.168.1.100 -uroot -p -e&nbsp;\"SELECT 1\"<br><em># \u5e94\u8be5\u6b63\u5e38\u8fd4\u56de<\/em><br><br><em># \u6062\u590d<\/em><br>nmcli device connect ens34<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>8.2 \u6848\u4f8b\u4e8c\uff1aKubernetes Worker\u8282\u70b9\u7f51\u7edc\u4f18\u5316<\/strong><\/h3>\n\n\n\n<p>\u80cc\u666f\uff1a \u67d0\u516c\u53f8\u7684Kubernetes\u96c6\u7fa4Worker\u8282\u70b9\u8dd1\u5bb9\u5668\u4e1a\u52a1\uff0c\u5355\u7f51\u5361\u5e26\u5bbd\u7ecf\u5e38\u8dd1\u6ee1\u3002\u9700\u8981\u589e\u52a0\u7f51\u7edc\u5e26\u5bbd\uff0c\u540c\u65f6\u4fdd\u8bc1\u9ad8\u53ef\u7528\u3002<\/p>\n\n\n\n<p>\u73af\u5883\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u64cd\u4f5c\u7cfb\u7edf\uff1aUbuntu 24.04 LTS<\/li>\n\n\n\n<li>Kubernetes\uff1a1.31<\/li>\n\n\n\n<li>\u670d\u52a1\u5668\uff1a\u81ea\u7ec4\u88c5\u670d\u52a1\u5668\uff0c4\u5757Intel i350\u5343\u5146\u7f51\u5361<\/li>\n\n\n\n<li>\u4ea4\u6362\u673a\uff1a\u666e\u901a\u5343\u5146\u4ea4\u6362\u673a\uff0c\u4e0d\u652f\u6301LACP<\/li>\n<\/ul>\n\n\n\n<p>\u65b9\u6848\u8bbe\u8ba1\uff1a \u7531\u4e8e\u4ea4\u6362\u673a\u4e0d\u652f\u6301LACP\uff0c\u9009\u62e9Mode 6\uff08balance-alb\uff09\u6765\u5b9e\u73b0\u8d1f\u8f7d\u5747\u8861\uff0c\u4e0d\u9700\u8981\u4ea4\u6362\u673a\u914d\u5408\u3002<\/p>\n\n\n\n<p>Netplan\u914d\u7f6e\u6587\u4ef6&nbsp;<code>\/etc\/netplan\/01-bond-config.yaml<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>network:<br>&nbsp;&nbsp;version:&nbsp;2<br>&nbsp;&nbsp;renderer:&nbsp;networkd<br><br>&nbsp;&nbsp;ethernets:<br>&nbsp; &nbsp;&nbsp;enp1s0:<br>&nbsp; &nbsp; &nbsp;&nbsp;dhcp4:&nbsp;false<br>&nbsp; &nbsp;&nbsp;enp2s0:<br>&nbsp; &nbsp; &nbsp;&nbsp;dhcp4:&nbsp;false<br>&nbsp; &nbsp;&nbsp;enp3s0:<br>&nbsp; &nbsp; &nbsp;&nbsp;dhcp4:&nbsp;false<br>&nbsp; &nbsp;&nbsp;enp4s0:<br>&nbsp; &nbsp; &nbsp;&nbsp;dhcp4:&nbsp;false<br><br>&nbsp;&nbsp;bonds:<br>&nbsp; &nbsp;&nbsp;bond0:<br>&nbsp; &nbsp; &nbsp;&nbsp;interfaces:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;enp1s0<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;enp2s0<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;enp3s0<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;enp4s0<br>&nbsp; &nbsp; &nbsp;&nbsp;addresses:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;192.168.1.101\/24<br>&nbsp; &nbsp; &nbsp;&nbsp;routes:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;to:&nbsp;default<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;via:&nbsp;192.168.1.1<br>&nbsp; &nbsp; &nbsp;&nbsp;nameservers:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;addresses:<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;-&nbsp;8.8.8.8<br>&nbsp; &nbsp; &nbsp;&nbsp;parameters:<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;mode:&nbsp;balance-alb<br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;mii-monitor-interval:&nbsp;100<br>&nbsp; &nbsp; &nbsp;&nbsp;mtu:&nbsp;9000<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f\u8fd9\u91cc\u8fd8\u914d\u7f6e\u4e86\u5de8\u578b\u5e27\uff08MTU 9000\uff09\uff0c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63d0\u5347\u5927\u6570\u636e\u91cf\u4f20\u8f93\u7684\u6027\u80fd\u3002<\/p>\n\n\n\n<p>\u5e94\u7528\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u9a8c\u8bc1\u914d\u7f6e<\/em><br>netplan try<br><br><em># \u5e94\u7528<\/em><br>netplan apply<br><br><em># \u67e5\u770b\u72b6\u6001<\/em><br>networkctl status bond0<br>cat \/proc\/net\/bonding\/bond0<\/code><\/pre>\n\n\n\n<p>Kubernetes CNI\u914d\u7f6e\u8c03\u6574\uff1a<\/p>\n\n\n\n<p>\u4f7f\u7528Calico\u65f6\uff0c\u9700\u8981\u786e\u4fddCalico\u4f7f\u7528bond\u63a5\u53e3\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u68c0\u67e5Calico\u81ea\u52a8\u53d1\u73b0\u7684IP<\/em><br>kubectl get node k8s-worker-1 -o jsonpath='{.status.addresses}'<br><br><em># \u5982\u679c\u9700\u8981\u6307\u5b9a\uff0c\u4fee\u6539Calico\u914d\u7f6e<\/em><br>kubectl -n kube-system edit daemonset calico-node<br><em># \u6dfb\u52a0\u73af\u5883\u53d8\u91cf\uff1aIP_AUTODETECTION_METHOD=interface=bond0<\/em><\/code><\/pre>\n\n\n\n<p>\u6027\u80fd\u6d4b\u8bd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u5b89\u88c5iperf3<\/em><br>apt install iperf3<br><br><em># \u670d\u52a1\u7aef<\/em><br>iperf3 -s<br><br><em># \u5ba2\u6237\u7aef\uff084\u4e2a\u5e76\u53d1\u8fde\u63a5\u6d4b\u8bd5\uff09<\/em><br>iperf3 -c 192.168.1.101 -P 4<br><br><em># \u9884\u671f\u7ed3\u679c\uff1a\u603b\u5e26\u5bbd\u63a5\u8fd14Gbps\uff084\u5757\u5343\u5146\u7f51\u5361\uff09<\/em><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>8.3 \u6848\u4f8b\u4e09\uff1aVMware ESXi\u73af\u5883\u4e0b\u7684Bond\u914d\u7f6e<\/strong><\/h3>\n\n\n\n<p>\u80cc\u666f\uff1a VMware ESXi 8.0\u73af\u5883\uff0c\u9700\u8981\u5728\u865a\u62df\u673a\uff08RHEL 9\uff09\u4e2d\u914d\u7f6ebonding\uff0c\u865a\u62df\u673a\u6709\u4e24\u5757\u865a\u62df\u7f51\u5361\u8fde\u63a5\u5230\u4e0d\u540c\u7684\u7269\u7406\u4e0a\u884c\u94fe\u8def\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u573a\u666f\u7a0d\u5fae\u7279\u6b8a\uff0c\u56e0\u4e3a\u9700\u8981\u5728\u865a\u62df\u5316\u5c42\u9762\u548c\u865a\u62df\u673a\u5185\u90e8\u540c\u65f6\u505a\u914d\u7f6e\u3002<\/p>\n\n\n\n<p>ESXi\u7aef\u914d\u7f6e\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u786e\u4fdd\u865a\u62df\u673a\u6709\u4e24\u5757\u7f51\u5361\uff0c\u5206\u522b\u8fde\u63a5\u5230\u4e0d\u540c\u7684vSwitch\u4e0a\u884c\u94fe\u8def<\/li>\n\n\n\n<li>\u865a\u62df\u4ea4\u6362\u673a\u9700\u8981\u5f00\u542f&#8221;\u5141\u8bb8MAC\u5730\u5740\u53d8\u66f4&#8221;\u548c&#8221;\u5141\u8bb8\u4f2a\u4f20\u8f93&#8221;\uff08\u56e0\u4e3abonding\u4f1a\u4fee\u6539MAC\uff09<\/li>\n<\/ol>\n\n\n\n<p>vSphere Web Client\u4e2d\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9009\u62e9vSwitch -&gt; \u7f16\u8f91\u8bbe\u7f6e<\/li>\n\n\n\n<li>\u5b89\u5168\u7b56\u7565\uff1a\n<ul class=\"wp-block-list\">\n<li>\u5141\u8bb8MAC\u5730\u5740\u53d8\u66f4\uff1a\u662f<\/li>\n\n\n\n<li>\u5141\u8bb8\u4f2a\u4f20\u8f93\uff1a\u662f<\/li>\n\n\n\n<li>\u6df7\u6742\u6a21\u5f0f\uff1a\u5426\uff08\u4e0d\u9700\u8981\uff09<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p>\u865a\u62df\u673a\u5185\u90e8\u914d\u7f6e\uff1a<\/p>\n\n\n\n<p>\u7531\u4e8eESXi\u4e0d\u652f\u6301\u771f\u6b63\u7684LACP\uff08\u9664\u975e\u7528vDS\uff09\uff0c\u865a\u62df\u673a\u5185\u53ea\u80fd\u7528Mode 1\uff08active-backup\uff09\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u521b\u5efabond<\/em><br>nmcli connection add&nbsp;type&nbsp;bond \\<br>&nbsp; &nbsp; con-name bond0 \\<br>&nbsp; &nbsp; ifname bond0 \\<br>&nbsp; &nbsp; bond.options&nbsp;\"mode=active-backup,miimon=100,fail_over_mac=active\"<br><br><em># fail_over_mac=active \u5f88\u91cd\u8981\uff0c\u8ba9MAC\u8ddf\u968factive\u63a5\u53e3<\/em><br><em># \u5426\u5219VMware\u53ef\u80fd\u4f1a\u4e22\u5305<\/em><br><br><em># \u6dfb\u52a0slave<\/em><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond0-eth0 \\<br>&nbsp; &nbsp; ifname ens192 \\<br>&nbsp; &nbsp; master bond0<br><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond0-eth1 \\<br>&nbsp; &nbsp; ifname ens224 \\<br>&nbsp; &nbsp; master bond0<br><br><em># \u914d\u7f6eIP<\/em><br>nmcli connection modify bond0 \\<br>&nbsp; &nbsp; ipv4.addresses 192.168.1.50\/24 \\<br>&nbsp; &nbsp; ipv4.gateway 192.168.1.1 \\<br>&nbsp; &nbsp; ipv4.method manual<br><br><em># \u542f\u52a8<\/em><br>nmcli connection up bond0<\/code><\/pre>\n\n\n\n<p>\u6d4b\u8bd5failover\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u5728vSphere\u4e2d\u65ad\u5f00\u5176\u4e2d\u4e00\u5757\u7f51\u5361\u7684\u4e0a\u884c\u94fe\u8def<\/em><br><em># \u6216\u8005\u5728VM\u4e2d\uff1a<\/em><br>nmcli device disconnect ens192<br><br><em># \u68c0\u67e5bond\u72b6\u6001<\/em><br>cat \/proc\/net\/bonding\/bond0<br><br><em># \u5e94\u8be5\u81ea\u52a8\u5207\u6362\u5230ens224\uff0c\u7f51\u7edc\u4e0d\u4e2d\u65ad<\/em><br>ping -c 10 192.168.1.1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>8.4 \u6848\u4f8b\u56db\uff1a\u8de8\u673a\u623f\u53cc\u6d3b\u7f51\u7edc\u67b6\u6784<\/strong><\/h3>\n\n\n\n<p>\u80cc\u666f\uff1a \u67d0\u91d1\u878d\u5ba2\u6237\u8981\u5b9e\u73b0\u8de8\u673a\u623f\u53cc\u6d3b\uff0c\u670d\u52a1\u5668\u9700\u8981\u540c\u65f6\u8fde\u63a5\u4e24\u4e2a\u673a\u623f\u7684\u7f51\u7edc\u3002\u6bcf\u4e2a\u673a\u623f\u5404\u6709\u4e00\u6839\u4e13\u7ebf\uff0c\u8981\u6c42\u4efb\u4e00\u4e13\u7ebf\u6545\u969c\u4e1a\u52a1\u4e0d\u53d7\u5f71\u54cd\u3002<\/p>\n\n\n\n<p>\u8fd9\u662f\u4e2a\u76f8\u5bf9\u590d\u6742\u7684\u573a\u666f\uff0c\u9700\u8981\u7ed3\u5408Bonding\u548c\u7b56\u7565\u8def\u7531\u3002<\/p>\n\n\n\n<p>\u7f51\u7edc\u67b6\u6784\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; +-------------------+<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp;\u5e94\u7528\u670d\u52a1\u5668 &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp;bond0: \u53cc\u7f51\u5361 &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; +--------+----------+<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; +--------------+--------------+<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp; &nbsp; &nbsp; +-----+-----+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; +-----+-----+<br>&nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; eth0 &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; eth1 &nbsp; &nbsp;|<br>&nbsp; &nbsp; &nbsp; &nbsp; +-----+-----+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; +-----+-----+<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp; &nbsp; &nbsp; +-----+-----+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; +-----+-----+<br>&nbsp; &nbsp; &nbsp; &nbsp; | \u673a\u623fA\u4ea4\u6362\u673a | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | \u673a\u623fB\u4ea4\u6362\u673a |<br>&nbsp; &nbsp; &nbsp; &nbsp; +-----------+ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; +-----------+<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |<br>&nbsp; &nbsp; &nbsp; &nbsp; \u4e13\u7ebf\u63a5\u5165\u673a\u623fA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u4e13\u7ebf\u63a5\u5165\u673a\u623fB<\/code><\/pre>\n\n\n\n<p>\u914d\u7f6e\u6b65\u9aa4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># 1. \u521b\u5efa\u4e3b\u5907\u6a21\u5f0fbond\uff0ceth0\u4e3a\u4e3b<\/em><br>nmcli connection add&nbsp;type&nbsp;bond \\<br>&nbsp; &nbsp; con-name bond0 \\<br>&nbsp; &nbsp; ifname bond0 \\<br>&nbsp; &nbsp; bond.options&nbsp;\"mode=active-backup,miimon=100,primary=eth0,arp_interval=1000,arp_ip_target=10.1.1.1+10.2.1.1,arp_all_targets=any\"<br><br><em># \u8fd9\u91cc\u4f7f\u7528ARP\u76d1\u63a7\u800c\u4e0d\u662fMII\uff0c\u56e0\u4e3a\u8981\u68c0\u6d4b\u7684\u662f\u5230\u7f51\u5173\u7684\u8fde\u901a\u6027<\/em><br><em># arp_ip_target\u914d\u7f6e\u4e24\u4e2a\u673a\u623f\u7684\u7f51\u5173<\/em><br><br><em># 2. \u6dfb\u52a0slave<\/em><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond0-eth0 \\<br>&nbsp; &nbsp; ifname eth0 \\<br>&nbsp; &nbsp; master bond0<br><br>nmcli connection add&nbsp;type&nbsp;ethernet \\<br>&nbsp; &nbsp; slave-type bond \\<br>&nbsp; &nbsp; con-name bond0-eth1 \\<br>&nbsp; &nbsp; ifname eth1 \\<br>&nbsp; &nbsp; master bond0<br><br><em># 3. \u914d\u7f6eIP<\/em><br>nmcli connection modify bond0 \\<br>&nbsp; &nbsp; ipv4.addresses 10.1.1.100\/24 \\<br>&nbsp; &nbsp; ipv4.gateway 10.1.1.1 \\<br>&nbsp; &nbsp; ipv4.routes&nbsp;\"10.2.0.0\/16 10.1.1.1 100\"&nbsp;\\<br>&nbsp; &nbsp; ipv4.method manual<br><br><em># \u542f\u52a8<\/em><br>nmcli connection up bond0<\/code><\/pre>\n\n\n\n<p>\u914d\u7f6e\u7b56\u7565\u8def\u7531\uff0c\u786e\u4fdd\u56de\u7a0b\u6d41\u91cf\u8d70\u6b63\u786e\u7684\u8def\u5f84\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u6dfb\u52a0\u8def\u7531\u8868<\/em><br>echo&nbsp;\"100 dc_a\"&nbsp;&gt;&gt; \/etc\/iproute2\/rt_tables<br>echo&nbsp;\"200 dc_b\"&nbsp;&gt;&gt; \/etc\/iproute2\/rt_tables<br><br><em># \u914d\u7f6e\u7b56\u7565\u8def\u7531\u89c4\u5219<\/em><br>cat &gt; \/etc\/networkd-dispatcher\/routable.d\/policy-route.sh &lt;&lt;&nbsp;'EOF'<br>#!\/bin\/bash<br><em># \u673a\u623fA\u7684\u6d41\u91cf\u8d70\u673a\u623fA\u7f51\u5173<\/em><br>ip route add default via 10.1.1.1 table dc_a<br>ip rule add from 10.1.1.100 table dc_a priority 100<br><br><em># \u673a\u623fB\u7684\u6d41\u91cf\u8d70\u673a\u623fB\u7f51\u5173\uff08\u5f53failover\u5230\u673a\u623fB\u65f6\uff09<\/em><br>ip route add default via 10.2.1.1 table dc_b<br>ip rule add from 10.2.1.100 table dc_b priority 100<br>EOF<br><br>chmod +x \/etc\/networkd-dispatcher\/routable.d\/policy-route.sh<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e2a\u914d\u7f6e\u786e\u4fdd\u4e86\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u6d41\u91cf\u8d70\u673a\u623fA<\/li>\n\n\n\n<li>\u673a\u623fA\u4e13\u7ebf\u6545\u969c\u65f6\uff0cARP\u68c0\u6d4b\u5931\u8d25\uff0c\u81ea\u52a8\u5207\u6362\u5230\u673a\u623fB<\/li>\n\n\n\n<li>\u5207\u6362\u540e\uff0c\u6d41\u91cf\u81ea\u52a8\u8d70\u673a\u623fB\u7684\u8def\u5f84<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u4e5d\u3001\u6700\u4f73\u5b9e\u8df5\u603b\u7ed3<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>9.1 \u914d\u7f6e\u6700\u4f73\u5b9e\u8df5<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u6a21\u5f0f\u9009\u62e9<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u5355\u7eaf\u9ad8\u53ef\u7528\u9009Mode 1\uff0c\u7b80\u5355\u53ef\u9760<\/li>\n\n\n\n<li>\u9700\u8981\u5e26\u5bbd\u805a\u5408\u4e14\u4ea4\u6362\u673a\u652f\u6301LACP\u9009Mode 4<\/li>\n\n\n\n<li>\u4ea4\u6362\u673a\u4e0d\u652f\u6301\u805a\u5408\u4f46\u9700\u8981\u8d1f\u8f7d\u5747\u8861\u9009Mode 6<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u76d1\u63a7\u95f4\u9694\u8bbe\u7f6e<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>miimon\u5efa\u8bae\u8bbe\u7f6e100ms\uff0c\u65e2\u80fd\u5feb\u901f\u68c0\u6d4b\u6545\u969c\uff0c\u53c8\u4e0d\u4f1a\u9020\u6210\u592a\u5927\u5f00\u9500<\/li>\n\n\n\n<li>\u5982\u679c\u7f51\u7edc\u4e0d\u592a\u7a33\u5b9a\uff0c\u53ef\u4ee5\u9002\u5f53\u589e\u52a0\u5230200ms\uff0c\u907f\u514d\u8bef\u5207\u6362<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>ARP\u76d1\u63a7<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u5173\u952e\u4e1a\u52a1\u5efa\u8bae\u542f\u7528ARP\u76d1\u63a7\uff0c\u80fd\u68c0\u6d4b\u5230\u4e09\u5c42\u7f51\u7edc\u95ee\u9898<\/li>\n\n\n\n<li>arp_ip_target\u8bbe\u7f6e\u4e3a\u7f51\u5173\u6216\u4e0a\u6e38\u53ef\u9760\u8bbe\u5907\u7684IP<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>LACP\u53c2\u6570<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>lacp_rate\u5efa\u8bae\u8bbe\u7f6e\u4e3afast\uff0c\u52a0\u5feb\u6545\u969c\u68c0\u6d4b<\/li>\n\n\n\n<li>xmit_hash_policy\u5efa\u8bae\u7528layer3+4\uff0c\u8d1f\u8f7d\u5747\u8861\u6548\u679c\u66f4\u597d<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u547d\u540d\u89c4\u8303<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>Bond\u63a5\u53e3\u7528bond0\u3001bond1\u547d\u540d<\/li>\n\n\n\n<li>\u8fde\u63a5\u540d\u7528\u6709\u610f\u4e49\u7684\u540d\u5b57\uff0c\u5982bond0-mgmt\u3001bond0-storage<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>9.2 \u8fd0\u7ef4\u6700\u4f73\u5b9e\u8df5<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u53d8\u66f4\u7a97\u53e3<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u7f51\u7edc\u914d\u7f6e\u53d8\u66f4\u52a1\u5fc5\u5728\u7ef4\u62a4\u7a97\u53e3\u6267\u884c<\/li>\n\n\n\n<li>\u4fdd\u7559\u5907\u7528\u8bbf\u95ee\u901a\u9053\uff08\u5982\u7ba1\u7406\u7f51\u3001IPMI\/iDRAC\uff09<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u56de\u6eda\u9884\u6848<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u53d8\u66f4\u524d\u5907\u4efd\u914d\u7f6e<\/li>\n\n\n\n<li>\u51c6\u5907\u56de\u6eda\u811a\u672c<\/li>\n\n\n\n<li>\u8bbe\u7f6e\u5b9a\u65f6\u4efb\u52a1\u81ea\u52a8\u56de\u6eda\uff08\u4e07\u4e00\u8fde\u4e0d\u4e0a\uff09<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code><em># \u81ea\u52a8\u56de\u6eda\u793a\u4f8b<\/em><br><em># \u5728\u53d8\u66f4\u524d\u6267\u884c<\/em><br>echo&nbsp;\"nmcli connection down bond0; nmcli connection up eth0\"&nbsp;| at now + 10 minutes<br><br><em># \u53d8\u66f4\u6210\u529f\u540e\u53d6\u6d88<\/em><br>atrm $(atq | awk&nbsp;'{print $1}')<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>\u76d1\u63a7\u544a\u8b66<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>Bond\u72b6\u6001\u5fc5\u987b\u7eb3\u5165\u76d1\u63a7<\/li>\n\n\n\n<li>Slave\u6570\u91cf\u5c11\u4e8e\u914d\u7f6e\u6570\u91cf\u65f6\u544a\u8b66<\/li>\n\n\n\n<li>\u5b9a\u671f\u68c0\u67e5Bond\u5065\u5eb7\u72b6\u6001<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u6587\u6863\u8bb0\u5f55<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u8bb0\u5f55\u6bcf\u53f0\u670d\u52a1\u5668\u7684Bond\u914d\u7f6e<\/li>\n\n\n\n<li>\u8bb0\u5f55\u4ea4\u6362\u673a\u7aef\u53e3\u5bf9\u5e94\u5173\u7cfb<\/li>\n\n\n\n<li>\u914d\u7f6e\u53d8\u66f4\u8981\u66f4\u65b0\u6587\u6863<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>9.3 \u6545\u969c\u5904\u7406\u6700\u4f73\u5b9e\u8df5<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u6545\u969c\u5b9a\u7ea7<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u6240\u6709Slave down = P0\uff08\u7d27\u6025\uff09<\/li>\n\n\n\n<li>\u90e8\u5206Slave down = P1\uff08\u91cd\u8981\uff0c\u9700\u5c3d\u5feb\u5904\u7406\uff09<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u5e94\u6025\u5904\u7406<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u4e1a\u52a1\u5f71\u54cd\u65f6\u4f18\u5148\u6062\u590d\u670d\u52a1<\/li>\n\n\n\n<li>\u53ef\u4ee5\u4e34\u65f6\u914d\u7f6e\u5355\u7f51\u5361\u8fd0\u884c<\/li>\n\n\n\n<li>\u4e8b\u540e\u518d\u6392\u67e5\u6839\u56e0<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>\u590d\u76d8\u6539\u8fdb<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u6bcf\u6b21\u6545\u969c\u540e\u8981\u590d\u76d8<\/li>\n\n\n\n<li>\u6539\u8fdb\u76d1\u63a7\u548c\u544a\u8b66<\/li>\n\n\n\n<li>\u5b8c\u5584\u5e94\u6025\u9884\u6848<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u5341\u3001\u603b\u7ed3<\/strong><\/h2>\n\n\n\n<p>\u5199\u5230\u8fd9\u91cc\uff0c\u5dee\u4e0d\u591a\u628a\u8fd9\u4e9b\u5e74\u5173\u4e8e\u7f51\u5361Bonding\u7684\u7ecf\u9a8c\u90fd\u638f\u51fa\u6765\u4e86\u3002\u603b\u7ed3\u51e0\u4e2a\u6838\u5fc3\u89c2\u70b9\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Bonding\u662f\u670d\u52a1\u5668\u7684\u57fa\u672c\u4fdd\u969c<\/strong>\u3002\u4efb\u4f55\u7a0d\u5fae\u91cd\u8981\u4e00\u70b9\u7684\u670d\u52a1\u5668\uff0c\u90fd\u5e94\u8be5\u914d\u7f6e\u7f51\u5361\u5197\u4f59\u3002\u4e00\u5757\u51e0\u5341\u5757\u7684\u7f51\u5361\u6545\u969c\u5bfc\u81f4\u51e0\u5341\u4e07\u751a\u81f3\u51e0\u767e\u4e07\u7684\u635f\u5931\uff0c\u8fd9\u79cd\u4e8b\u60c5\u5b8c\u5168\u53ef\u4ee5\u907f\u514d\u3002<\/li>\n\n\n\n<li><strong>\u914d\u7f6e\u4e0d\u590d\u6742\uff0c\u91cd\u5728\u7406\u89e3<\/strong>\u3002Bonding\u7684\u914d\u7f6e\u547d\u4ee4\u5c31\u90a3\u4e48\u51e0\u6761\uff0c\u4f46\u8981\u7528\u597d\u5b83\uff0c\u9700\u8981\u7406\u89e3\u5404\u79cd\u6a21\u5f0f\u7684\u539f\u7406\u3001\u4ea4\u6362\u673a\u7684\u914d\u5408\u3001\u76d1\u63a7\u53c2\u6570\u7684\u542b\u4e49\u3002\u7406\u89e3\u4e86\u8fd9\u4e9b\uff0c\u914d\u7f6e\u5c31\u662f\u6c34\u5230\u6e20\u6210\u7684\u4e8b\u3002<\/li>\n\n\n\n<li><strong>\u9009\u5bf9\u6a21\u5f0f\u5f88\u91cd\u8981<\/strong>\u3002\u5927\u90e8\u5206\u573a\u666fMode 1\u6216Mode 4\u5c31\u591f\u4e86\u3002\u522b\u4e3a\u4e86\u8ffd\u6c42\u82b1\u54e8\u9009\u4e00\u4e9b\u4e0d\u5408\u9002\u7684\u6a21\u5f0f\uff0c\u7b80\u5355\u53ef\u9760\u624d\u662f\u738b\u9053\u3002<\/li>\n\n\n\n<li><strong>\u76d1\u63a7\u548c\u544a\u8b66\u4e0d\u80fd\u5c11<\/strong>\u3002\u914d\u7f6e\u5b8c\u4e0d\u662f\u7ec8\u70b9\uff0c\u8981\u7eb3\u5165\u76d1\u63a7\u3002Slave down\u4e86\u6ca1\u4eba\u77e5\u9053\uff0c\u7b49Bond\u5b8c\u5168\u6302\u4e86\u624d\u53d1\u73b0\u5c31\u665a\u4e86\u3002<\/li>\n\n\n\n<li><strong>\u5b9a\u671f\u6f14\u7ec3<\/strong>\u3002\u627e\u4e2a\u7ef4\u62a4\u7a97\u53e3\uff0c\u624b\u52a8\u62d4\u4e00\u6839\u7f51\u7ebf\uff0c\u9a8c\u8bc1\u4e00\u4e0bfailover\u662f\u4e0d\u662f\u771f\u7684work\u3002\u5149\u914d\u7f6e\u4e0d\u6d4b\u8bd5\uff0c\u5fc3\u91cc\u6ca1\u5e95\u3002<\/li>\n<\/ol>\n\n\n\n<p>\u6700\u540e\uff0c\u6280\u672f\u5728\u4e0d\u65ad\u53d1\u5c55\uff0cLinux\u5185\u6838\u7684Bonding\u6a21\u5757\u4e5f\u5728\u6301\u7eed\u4f18\u5316\u3002\u4fdd\u6301\u5b66\u4e60\uff0c\u5173\u6ce8\u6700\u65b0\u7684\u53d8\u5316\uff0c\u624d\u80fd\u4e0d\u88ab\u6dd8\u6c70\u3002<\/p>\n\n\n\n<p>\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u5927\u5bb6\u6709\u5e2e\u52a9\u3002\u6709\u95ee\u9898\u6b22\u8fce\u4ea4\u6d41\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u53c2\u8003\u8d44\u6599\uff1a<\/p>\n\n\n\n<p>IEEE 802.3ad Link Aggregation Standard<br><\/p>\n\n\n\n<p>Linux Kernel Documentation &#8211; Bonding<\/p>\n\n\n\n<p>Red Hat Enterprise Linux 9 Networking Guide<\/p>\n\n\n\n<p>Ubuntu Server Guide &#8211; Network Configuration<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u5e72\u8fd0\u7ef4\u8fd9\u884c\u5341\u5e74\u4e86\uff0c\u89c1\u8fc7\u592a\u591a\u56e0\u4e3a\u5355\u7f51\u5361\u6545\u969c\u5bfc\u81f4\u7684\u751f\u4ea7\u4e8b\u6545\u3002\u8bb0\u5f972019\u5e74\u90a3\u4f1a\uff0c\u67d0\u7535\u5546\u5ba2\u6237\u53cc\u5341\u4e00\u5f53\u5929\uff0c\u6838\u5fc3\u4ea4\u6613\u670d\u52a1\u5668\u7684\u7f51\u5361\u7a81\u7136\u6302\u4e86\uff0c\u6574\u6574\u65ad\u7f5140\u5206\u949f\uff0c\u76f4\u63a5\u635f\u5931\u51e0\u767e\u4e07\u3002\u4e8b\u540e\u590d\u76d8\uff0c\u5176\u5b9e\u5c31\u662f\u4e00\u5757\u51e0\u5341\u5757\u94b1\u7684\u7f51\u5361\u574f\u4e86\uff0c\u4f46\u56e0\u4e3a\u6ca1\u505a\u4efb\u4f55\u5197\u4f59\uff0c\u7ed3\u679c\u635f\u5931\u60e8\u91cd\u3002 \u4ece\u90a3\u4ee5\u540e\uff0c\u6211\u5c31\u628a\u7f51\u5361Bonding\u5f53\u6210\u670d\u52a1\u5668\u4e0a\u67b6\u7684\u6807\u914d\u64cd\u4f5c\u3002\u8fd9\u73a9\u610f\u914d\u7f6e\u8d77\u6765\u4e0d\u590d\u6742\uff0c\u4f46\u80fd\u5728\u5173\u952e\u65f6\u523b\u6551\u547d\u3002\u4eca\u5929\u5c31\u628a\u8fd9\u4e9b\u5e74\u8e29\u8fc7\u7684\u5751\u3001\u603b\u7ed3\u7684\u7ecf\u9a8c\u90fd\u5199\u51fa\u6765\uff0c\u5e0c\u671b\u80fd\u5e2e\u5230\u540c\u884c\u4eec\u5c11\u8d70\u5f2f\u8def\u3002 \u4e00\u3001Bonding\u6280\u672f\u6982\u8ff0 1.1 \u4ec0\u4e48\u662f\u7f51\u5361Bonding \u7b80\u5355\u8bf4\uff0cBonding\u5c31\u662f\u628a\u591a\u5757\u7269\u7406\u7f51\u5361\u7ed1\u5b9a\u6210\u4e00\u4e2a\u903b\u8f91\u7f51\u5361\u3002\u5bf9\u4e0a\u5c42\u5e94\u7528\u6765\u8bf4\uff0c\u5b83\u53ea\u770b\u5230\u4e00\u4e2a\u7f51\u7edc\u63a5\u53e3\uff0c\u4f46\u5e95\u5c42\u5b9e\u9645\u4e0a\u6709\u591a\u5757\u7f51\u5361\u5728\u5de5\u4f5c\u3002\u8fd9\u6837\u505a\u6709\u4e24\u4e2a\u6838\u5fc3\u597d\u5904\uff1a \u7b2c\u4e00\u662f\u9ad8\u53ef\u7528\u3002\u4efb\u4f55\u4e00\u5757\u7269\u7406\u7f51\u5361\u574f\u4e86\uff0c\u6d41\u91cf\u81ea\u52a8\u5207\u6362\u5230\u5176\u4ed6\u7f51\u5361\uff0c\u4e1a\u52a1\u65e0\u611f\u77e5\u3002 \u7b2c\u4e8c\u662f\u5e26\u5bbd\u805a\u5408\u3002\u591a\u5757\u7f51\u5361\u7684\u5e26\u5bbd\u53ef\u4ee5\u53e0\u52a0\u4f7f\u7528\uff0c\u6bd4\u5982\u4e24\u5757\u5343\u5146\u7f51\u5361\u7ed1\u5b9a\u540e\u7406\u8bba\u4e0a\u80fd\u8dd1\u52302Gbps\u3002 Linux\u5185\u6838\u4ece2.0\u7248\u672c\u5c31\u5f00\u59cb\u652f\u6301Bonding\u4e86\uff0c\u5230\u73b0\u5728\u5df2\u7ecf\u975e\u5e38\u6210\u719f\u7a33\u5b9a\u30022025\u5e74\u7684\u4e3b\u6d41\u53d1\u884c\u7248\uff0c\u4e0d\u7ba1\u662fRHEL 9\u3001Ubuntu 24.04\u8fd8\u662fDebian 12\uff0c\u90fd\u5bf9Bonding\u6709\u5b8c\u5584\u7684\u652f\u6301\u3002 1.2 Bonding\u7684\u5de5\u4f5c\u539f\u7406 Bonding\u9a71\u52a8\u5728\u5185\u6838\u5c42\u9762\u5de5\u4f5c\uff0c\u5b83\u4f1a\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u7684bond\u63a5\u53e3\uff0c\u7136\u540e\u628a\u591a\u4e2a\u7269\u7406\u7f51\u5361\uff08\u79f0\u4e3aslave\uff09\u6302\u8f7d\u5230\u8fd9\u4e2a\u865a\u62df\u63a5\u53e3\u4e0b\u9762\u3002\u6240\u6709\u53d1\u5f80bond\u63a5\u53e3\u7684\u6d41\u91cf\uff0c\u90fd\u4f1a\u6839\u636e\u914d\u7f6e\u7684\u6a21\u5f0f\u5206\u53d1\u5230\u5404\u4e2aslave\u7f51\u5361\u4e0a\u3002 \u4ece\u534f\u8bae\u6808\u7684\u89d2\u5ea6\u770b\uff0c\u6d41\u91cf\u662f\u8fd9\u6837\u8d70\u7684\uff1a Bond\u63a5\u53e3\u6709\u81ea\u5df1\u7684MAC\u5730\u5740\uff0c\u9ed8\u8ba4\u4f1a\u4f7f\u7528\u7b2c\u4e00\u4e2aslave\u7f51\u5361\u7684MAC\u3002\u5f53\u7136\u8fd9\u4e2a\u53ef\u4ee5\u624b\u52a8\u6307\u5b9a\uff0c\u540e\u9762\u4f1a\u8bb2\u5230\u3002 1.3 \u4e3a\u4ec0\u4e48\u8981\u7528Bonding\u800c\u4e0d\u662f\u5176\u4ed6\u65b9\u6848 \u6709\u4eba\u53ef\u80fd\u4f1a\u95ee\uff0c\u73b0\u5728\u4e0d\u662f\u6709\u5f88\u591a\u9ad8\u53ef\u7528\u65b9\u6848\u5417\uff0c\u6bd4\u5982Keepalived\u3001HAProxy\u8fd9\u4e9b\uff0c\u4e3a\u5565\u8fd8\u8981\u7528Bonding\uff1f \u8fd9\u91cc\u8981\u641e\u6e05\u695a\u4e00\u70b9\uff1aBonding\u89e3\u51b3\u7684\u662f\u5355\u673a\u7f51\u5361\u5c42\u9762\u7684\u5197\u4f59\uff0c\u800cKeepalived\u8fd9\u4e9b\u89e3\u51b3\u7684\u662f\u670d\u52a1\u5c42\u9762\u7684\u5197\u4f59\u3002\u4e24\u8005\u4e0d\u662f\u66ff\u4ee3\u5173\u7cfb\uff0c\u800c\u662f\u4e92\u8865\u5173\u7cfb\u3002 \u4e3e\u4e2a\u4f8b\u5b50\uff0c\u4f60\u7528Keepalived\u505a\u4e86MySQL\u4e3b\u4ece\u5207\u6362\uff0c\u4f46\u5982\u679c\u4e3b\u5e93\u7684\u7f51\u5361\u574f\u4e86\uff0cKeepalived\u68c0\u6d4b\u5230\u6545\u969c\u9700\u8981\u65f6\u95f4\uff0c\u5207\u6362\u4e5f\u9700\u8981\u65f6\u95f4\uff0c\u8fd9\u671f\u95f4\u4e1a\u52a1\u5c31\u662f\u4e2d\u65ad\u7684\u3002\u4f46\u5982\u679c\u4e3b\u5e93\u672c\u8eab\u505a\u4e86Bonding\uff0c\u7f51\u5361\u574f\u4e86\u6d41\u91cf\u77ac\u95f4\u5207\u6362\uff0cKeepalived\u6839\u672c\u611f\u77e5\u4e0d\u5230\uff0c\u4e1a\u52a1\u5b8c\u5168\u65e0\u635f\u3002 \u6240\u4ee5\u6211\u7684\u5efa\u8bae\u662f\uff1a\u5173\u952e\u4e1a\u52a1\u670d\u52a1\u5668\uff0cBonding\u662f\u5fc5\u987b\u7684\uff0c\u5728\u6b64\u57fa\u7840\u4e0a\u518d\u53e0\u52a0\u670d\u52a1\u5c42\u9762\u7684\u9ad8\u53ef\u7528\u65b9\u6848\u3002 \u4e8c\u3001Bonding\u6a21\u5f0f\u8be6\u89e3 Linux Bonding\u652f\u63017\u79cd\u5de5\u4f5c\u6a21\u5f0f\uff0c\u7f16\u53f7\u4ece0\u52306\u3002\u6bcf\u79cd\u6a21\u5f0f\u7684\u7279\u70b9\u548c\u9002\u7528\u573a\u666f\u90fd\u4e0d\u4e00\u6837\uff0c\u9009\u9519\u6a21\u5f0f\u53ef\u80fd\u8fbe\u4e0d\u5230\u9884\u671f\u6548\u679c\u3002\u4e0b\u9762\u9010\u4e2a\u5206\u6790\u3002 2.1 Mode 0\uff1abalance-rr\uff08\u8f6e\u8be2\u6a21\u5f0f\uff09 \u8fd9\u662f\u6700\u7b80\u5355\u7684\u6a21\u5f0f\uff0c\u6570\u636e\u5305\u8f6e\u6d41\u4ece\u5404\u4e2aslave\u7f51\u5361\u53d1\u51fa\u53bb\u3002\u6bd4\u5982\u7b2c\u4e00\u4e2a\u5305\u4eceeth0\u53d1\uff0c\u7b2c\u4e8c\u4e2a\u5305\u4eceeth1\u53d1\uff0c\u7b2c\u4e09\u4e2a\u5305\u53c8\u4eceeth0\u53d1\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002 \u4f18\u70b9\uff1a \u7f3a\u70b9\uff1a \u9002\u7528\u573a\u666f\uff1a \u8bf4\u5b9e\u8bdd\uff0c\u751f\u4ea7\u73af\u5883\u6211\u51e0\u4e4e\u4e0d\u7528\u8fd9\u4e2a\u6a21\u5f0f\u3002\u56e0\u4e3a\u6570\u636e\u5305\u4e71\u5e8f\u7684\u95ee\u9898\u5728\u9ad8\u8d1f\u8f7d\u4e0b\u4f1a\u5f88\u660e\u663e\uff0c\u53ef\u80fd\u5bfc\u81f4TCP\u91cd\u4f20\u589e\u52a0\uff0c\u53cd\u800c\u964d\u4f4e\u6027\u80fd\u3002\u5982\u679c\u4f60\u7684\u573a\u666f\u4e3b\u8981\u662fUDP\u6d41\u91cf\uff0c\u53ef\u4ee5\u8003\u8651\u3002 2.2 Mode 1\uff1aactive-backup\uff08\u4e3b\u5907\u6a21\u5f0f\uff09 \u8fd9\u662f\u6211\u7528\u5f97\u6700\u591a\u7684\u6a21\u5f0f\u3002\u987e\u540d\u601d\u4e49\uff0c\u540c\u4e00\u65f6\u95f4\u53ea\u6709\u4e00\u5757\u7f51\u5361\u5728\u5de5\u4f5c\uff0c\u5176\u4ed6\u7f51\u5361\u4f5c\u4e3a\u5907\u4efd\u3002\u4e3b\u7f51\u5361\u6545\u969c\u65f6\uff0c\u81ea\u52a8\u5207\u6362\u5230\u5907\u4efd\u7f51\u5361\u3002 \u4f18\u70b9\uff1a \u7f3a\u70b9\uff1a \u9002\u7528\u573a\u666f\uff1a \u5927\u591a\u6570\u9700\u8981\u9ad8\u53ef\u7528\u4f46\u5bf9\u5e26\u5bbd\u8981\u6c42\u4e0d\u90a3\u4e48\u6781\u7aef\u7684\u573a\u666f\u3002\u6bd4\u5982\u6570\u636e\u5e93\u670d\u52a1\u5668\u3001\u5e94\u7528\u670d\u52a1\u5668\u3001\u7ba1\u7406\u7f51\u7edc\u7b49\u3002\u8fd9\u4e2a\u6a21\u5f0f\u6211\u63a8\u8350\u4f5c\u4e3a\u9ed8\u8ba4\u9009\u62e9\uff0c\u9664\u975e\u6709\u7279\u6b8a\u9700\u6c42\u3002 2.3 Mode 2\uff1abalance-xor\uff08\u5f02\u6216\u6a21\u5f0f\uff09 \u8fd9\u4e2a\u6a21\u5f0f\u6839\u636e\u6e90MAC\u5730\u5740\u548c\u76ee\u6807MAC\u5730\u5740\u505a\u5f02\u6216\u8fd0\u7b97\uff0c\u7ed3\u679c\u51b3\u5b9a\u7528\u54ea\u5757\u7f51\u5361\u53d1\u9001\u3002\u76f8\u540c\u7684\u6e90\u76ee\u5730\u5740\u5bf9\uff0c\u603b\u662f\u8d70\u540c\u4e00\u5757\u7f51\u5361\u3002 \u4f18\u70b9\uff1a \u7f3a\u70b9\uff1a \u9002\u7528\u573a\u666f\uff1a \u9700\u8981\u8d1f\u8f7d\u5747\u8861\u4e14\u4ea4\u6362\u673a\u652f\u6301\u9759\u6001\u805a\u5408\u7684\u573a\u666f\u3002 2.4 Mode 3\uff1abroadcast\uff08\u5e7f\u64ad\u6a21\u5f0f\uff09 \u6240\u6709\u6570\u636e\u5305\u90fd\u4ece\u6240\u6709slave\u7f51\u5361\u53d1\u9001\u51fa\u53bb\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-14066","post","type-post","status-publish","format-standard","hentry","category-killtest"],"_links":{"self":[{"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/14066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14066"}],"version-history":[{"count":3,"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/14066\/revisions"}],"predecessor-version":[{"id":14070,"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/14066\/revisions\/14070"}],"wp:attachment":[{"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.killtest.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}