{"id":531,"date":"2025-07-03T11:02:14","date_gmt":"2025-07-03T03:02:14","guid":{"rendered":"https:\/\/www.htmacg.cn\/?p=531"},"modified":"2025-07-03T11:02:14","modified_gmt":"2025-07-03T03:02:14","slug":"%e6%80%9d%e7%a7%91%e6%a8%a1%e6%8b%9f%e5%99%a8%e9%93%be%e8%b7%af%e8%81%9a%e5%90%88%e9%85%8d%e7%bd%ae%e5%ae%9e%e6%88%98%ef%bc%9a%e4%bb%8e%e5%8e%9f%e7%90%86%e5%88%b0%e5%ae%9e%e9%aa%8c%e5%85%a8%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.htmacg.cn\/?p=531","title":{"rendered":"\u601d\u79d1\u6a21\u62df\u5668\u94fe\u8def\u805a\u5408\u914d\u7f6e\u5b9e\u6218\uff1a\u4ece\u539f\u7406\u5230\u5b9e\u9a8c\u5168\u89e3\u6790"},"content":{"rendered":"<h2>\u4e00\u3001\u94fe\u8def\u805a\u5408\u6280\u672f\u6982\u8ff0<\/h2>\n<p>\u94fe\u8def\u805a\u5408\uff08EtherChannel\uff09\u662f\u5c06\u591a\u4e2a\u7269\u7406\u4ee5\u592a\u7f51\u94fe\u8def\u6346\u7ed1\u6210\u4e00\u4e2a\u903b\u8f91\u94fe\u8def\u7684\u6280\u672f\uff0c\u4e3b\u8981\u4f5c\u7528\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u5e26\u5bbd\u6269\u5c55<\/strong>\uff1a\u5c06\u591a\u6761\u94fe\u8def\u5e26\u5bbd\u53e0\u52a0\uff0c\u5982 2 \u6761 100M \u94fe\u8def\u805a\u5408\u540e\u53ef\u8fbe 200M<\/li>\n<li><strong>\u5197\u4f59\u5907\u4efd<\/strong>\uff1a\u5f53\u4e00\u6761\u94fe\u8def\u6545\u969c\u65f6\uff0c\u6d41\u91cf\u81ea\u52a8\u5207\u6362\u5230\u5176\u4ed6\u94fe\u8def<\/li>\n<li><strong>\u8d1f\u8f7d\u5747\u8861<\/strong>\uff1a\u6839\u636e\u6570\u636e\u5305\u7279\u5f81\u5c06\u6d41\u91cf\u5206\u644a\u5230\u4e0d\u540c\u94fe\u8def\u4e0a<\/li>\n<\/ul>\n<h2>\u4e8c\u3001\u5b9e\u9a8c\u73af\u5883\u51c6\u5907<\/h2>\n<h3>\uff08\u4e00\uff09\u786c\u4ef6\u9700\u6c42<\/h3>\n<ul>\n<li>Cisco 2960 \u4ea4\u6362\u673a 2 \u53f0<\/li>\n<li>PC \u4e3b\u673a 4 \u53f0<\/li>\n<\/ul>\n<h3>\uff08\u4e8c\uff09IP \u5730\u5740\u89c4\u5212\u8868<\/h3>\n<table>\n<thead>\n<tr>\n<td><strong>\u8bbe\u5907<\/strong><\/td>\n<td><strong>IP \u5730\u5740<\/strong><\/td>\n<td><strong>\u5b50\u7f51\u63a9\u7801<\/strong><\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>PC0<\/td>\n<td>192.168.10.1<\/td>\n<td>255.255.255.0<\/td>\n<\/tr>\n<tr>\n<td>PC1<\/td>\n<td>192.168.20.1<\/td>\n<td>255.255.255.0<\/td>\n<\/tr>\n<tr>\n<td>PC2<\/td>\n<td>192.168.10.2<\/td>\n<td>255.255.255.0<\/td>\n<\/tr>\n<tr>\n<td>PC3<\/td>\n<td>192.168.20.2<\/td>\n<td>255.255.255.0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>\u62d3\u6251\u793a\u4f8b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/img.htmacg.cn\/system\/2025\/07\/03\/6865f1b0c131d.png\" \/><\/p>\n<h2>\u4e09\u3001\u914d\u7f6e\u5b9e\u6218\u6b65\u9aa4<\/h2>\n<h3>\uff08\u4e00\uff09\u4ea4\u6362\u673a\u57fa\u7840\u914d\u7f6e\uff08\u4e24\u53f0\u4ea4\u6362\u673a\u76f8\u540c\u6b65\u9aa4\uff09<\/h3>\n<p><strong>1.\u521b\u5efa<\/strong><strong> VLAN<\/strong><\/p>\n<pre>Switch&gt;enable\n\nSwitch#configure terminal\n\nSwitch(config)#vlan 10\n\nSwitch(config-vlan)#name VLAN10\n\nSwitch(config-vlan)#vlan 20\n\nSwitch(config-vlan)#name VLAN20\n\nSwitch(config-vlan)#exit<\/pre>\n<p><strong>2.\u521b\u5efa\u94fe\u8def\u805a\u5408\u7ec4<\/strong><\/p>\n<pre>Switch(config)#interface port-channel 1\n\nSwitch(config-if)#switchport mode trunk\u00a0 # \u8bbe\u7f6e\u4e3a trunk \u6a21\u5f0f\n\nSwitch(config-if)#exit<\/pre>\n<p><strong>3.\u6dfb\u52a0\u7269\u7406\u63a5\u53e3\u5230\u805a\u5408\u7ec4<\/strong><\/p>\n<pre>Switch(config)#interface range fastEthernet 0\/3 - 4\n\nSwitch(config-if-range)#channel-group 1 mode active\u00a0 # \u4f7f\u7528 LACP \u4e3b\u52a8\u6a21\u5f0f\n\nSwitch(config-if-range)#exit<\/pre>\n<h3>\uff08\u4e8c\uff09PC \u8bbe\u5907 IP \u914d\u7f6e<\/h3>\n<p>\u4ee5 PC0 \u4e3a\u4f8b\uff0c\u914d\u7f6e\u6b65\u9aa4\uff1a<\/p>\n<p>1.\u6253\u5f00 PC0 \u7684 &#8220;\u684c\u9762&#8221; \u9009\u9879\u5361<\/p>\n<p>2.\u70b9\u51fb &#8220;IP \u914d\u7f6e&#8221;<\/p>\n<p>3.\u8f93\u5165 IP \u5730\u5740\uff1a192.168.10.1<\/p>\n<p>4.\u5b50\u7f51\u63a9\u7801\uff1a255.255.255.0<\/p>\n<p>5.\u7f51\u5173\uff08\u53ef\u9009\uff09\uff1a192.168.10.254<\/p>\n<h2>\u56db\u3001\u914d\u7f6e\u9a8c\u8bc1\u4e0e\u6d4b\u8bd5<\/h2>\n<h3>\uff08\u4e00\uff09\u67e5\u770b\u94fe\u8def\u805a\u5408\u72b6\u6001<\/h3>\n<pre>Switch#show etherchannel summary<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/img.htmacg.cn\/system\/2025\/07\/03\/6865f1b721288.png\" \/><\/p>\n<h4>\u5173\u952e\u8f93\u51fa\u89e3\u6790\uff1a<\/h4>\n<ul>\n<li>Group\uff1a\u805a\u5408\u7ec4\u7f16\u53f7<\/li>\n<li>Port-channel\uff1a\u903b\u8f91\u63a5\u53e3\u540d\u79f0<\/li>\n<li>Protocol\uff1a\u4f7f\u7528\u7684\u534f\u8bae\uff08LACP\uff09<\/li>\n<li>Ports\uff1a\u52a0\u5165\u805a\u5408\u7ec4\u7684\u7269\u7406\u63a5\u53e3\u72b6\u6001\uff08P \u8868\u793a\u5df2\u805a\u5408\uff09<\/li>\n<\/ul>\n<h3>\uff08\u4e8c\uff09\u8fde\u901a\u6027\u6d4b\u8bd5<\/h3>\n<p>\u5728 PC2 \u4e0a\u6267\u884c ping \u547d\u4ee4\uff1a<\/p>\n<pre>C:\\&gt;ping 192.168.10.1<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/img.htmacg.cn\/system\/2025\/07\/03\/6865f1b0c11d6.png\" \/><\/p>\n<h2>\u4e94\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u89e3\u51b3\u65b9\u6848<\/h2>\n<p><strong>1.\u805a\u5408\u7ec4\u672a\u5f62\u6210<\/strong><\/p>\n<p>\u68c0\u67e5\u4e24\u7aef\u4ea4\u6362\u673a\u7684 channel-group \u6a21\u5f0f\u662f\u5426\u4e00\u81f4\uff08active\/passive\uff09<\/p>\n<p>\u786e\u8ba4\u7269\u7406\u63a5\u53e3\u5747\u4e3a trunk \u6a21\u5f0f\u4e14\u5141\u8bb8\u6240\u6709 VLAN \u901a\u8fc7<\/p>\n<p><strong>2.ping <\/strong><strong>\u6d4b\u8bd5\u4e0d\u901a<\/strong><\/p>\n<p>\u68c0\u67e5 VLAN \u5212\u5206\u662f\u5426\u6b63\u786e<\/p>\n<p>\u4f7f\u7528show interface port-channel 1\u67e5\u770b\u94fe\u8def\u534f\u8bae\u72b6\u6001<\/p>\n<h2>\u516d\u3001\u5b9e\u9a8c\u62d3\u5c55\u5efa\u8bae<\/h2>\n<p>1.\u5c1d\u8bd5\u914d\u7f6e\u4e0d\u540c\u7684 LACP \u6a21\u5f0f\uff08active\/passive\uff09\u89c2\u5bdf\u805a\u5408\u72b6\u6001\u53d8\u5316<\/p>\n<p>2.\u6a21\u62df\u94fe\u8def\u6545\u969c\u573a\u666f\uff0c\u89c2\u5bdf\u6d41\u91cf\u5207\u6362\u65f6\u95f4<\/p>\n<p>\u901a\u8fc7\u672c\u5b9e\u9a8c\uff0c\u6211\u4eec\u6210\u529f\u5b9e\u73b0\u4e86\u57fa\u4e8e LACP \u534f\u8bae\u7684\u94fe\u8def\u805a\u5408\u914d\u7f6e\uff0c\u4e0d\u4ec5\u63d0\u5347\u4e86\u7f51\u7edc\u5e26\u5bbd\uff0c\u8fd8\u5b9e\u73b0\u4e86\u94fe\u8def\u5197\u4f59\u529f\u80fd\u3002\u8fd9\u79cd\u6280\u672f\u5728\u4f01\u4e1a\u7f51\u7edc\u6838\u5fc3\u5c42\u548c\u6c47\u805a\u5c42\u5e94\u7528\u5e7f\u6cdb\uff0c\u662f\u6784\u5efa\u9ad8\u53ef\u7528\u7f51\u7edc\u7684\u57fa\u7840\u6280\u672f\u4e4b\u4e00\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u94fe\u8def\u805a\u5408\u6280\u672f\u6982\u8ff0 \u94fe\u8def\u805a\u5408\uff08EtherChannel\uff09\u662f\u5c06\u591a\u4e2a\u7269\u7406\u4ee5\u592a\u7f51\u94fe\u8def\u6346\u7ed1\u6210\u4e00\u4e2a\u903b\u8f91\u94fe\u8def\u7684\u6280\u672f\uff0c\u4e3b\u8981\u4f5c\u7528\u5305\u62ec\uff1a \u5e26\u5bbd\u6269\u5c55\uff1a\u5c06\u591a\u6761\u94fe\u8def\u5e26\u5bbd\u53e0\u52a0\uff0c\u5982 2 \u6761 100M \u94fe\u8def\u805a\u5408\u540e\u53ef\u8fbe 200M \u5197\u4f59\u5907\u4efd\uff1a\u5f53\u4e00\u6761\u94fe\u8def\u6545\u969c\u65f6\uff0c\u6d41\u91cf\u81ea\u52a8\u5207\u6362\u5230\u5176\u4ed6\u94fe\u8def \u8d1f\u8f7d\u5747\u8861\uff1a\u6839\u636e\u6570\u636e\u5305\u7279\u5f81\u5c06\u6d41\u91cf\u5206\u644a\u5230\u4e0d\u540c\u94fe\u8def\u4e0a &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"class_list":["post-531","post","type-post","status-publish","format-standard","hentry","category-33"],"_links":{"self":[{"href":"https:\/\/www.htmacg.cn\/index.php?rest_route=\/wp\/v2\/posts\/531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.htmacg.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.htmacg.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.htmacg.cn\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.htmacg.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=531"}],"version-history":[{"count":0,"href":"https:\/\/www.htmacg.cn\/index.php?rest_route=\/wp\/v2\/posts\/531\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.htmacg.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.htmacg.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.htmacg.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}