{"id":5292,"date":"2013-07-04T17:54:01","date_gmt":"2013-07-04T09:54:01","guid":{"rendered":"http:\/\/jpuyy.com\/?p=5292"},"modified":"2015-01-26T17:48:28","modified_gmt":"2015-01-26T09:48:28","slug":"c2960s-configure-etherchannel","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=5292","title":{"rendered":"C2960S\u4ea4\u6362\u673a\u6c47\u805a"},"content":{"rendered":"<p>\u8fd9\u91cc\u7684\u6c47\u805a\u8981\u8fbe\u5230\u7684\u76ee\u7684\uff1a\u4ea4\u6362\u673a\u4e4b\u95f4\u53ef\u4ee5\u6269\u5c55\u5e26\u5bbd\uff0c\u540c\u65f6\u589e\u5f3a\u53ef\u7528\u6027\u3002C2960S\u662f\u4e8c\u5c42\u4ea4\u6362\u673a\u3002\u5b9e\u73b0\u6c47\u805a\u7684\u4e24\u4e2a\u534f\u8bae<\/p>\n<p>Link Aggregation Control Protocol (LACP) \u548c Port Aggregation Protocol (PAgP)<\/p>\n<p>LACP\u662fIEEE 802.3ad\u4e2d\u89c4\u5b9a\u7684\u534f\u8bae\uff0c\u6240\u4ee5\u5177\u6709\u901a\u7528\u6027\uff0c\u6240\u4ee5linux\u53c8\u7f51\u5361\u7ed1\u5b9a\u65f6\uff0c\u9700\u8981\u9009\u62e9Mode 4 (802.3ad)\uff0c\u8fd9\u6837\u4ea4\u6362\u673a\u4e0e\u670d\u52a1\u5668\u4e4b\u95f4\u5c31\u80fd\u589e\u52a0\u5e26\u5bbd\u3002<\/p>\n<p>\u800cPAgP\u662f\u601d\u79d1\u81ea\u5df1\u7684\u6c47\u805a\u534f\u8bae\uff0c\u5b83\u9002\u7528\u4e8e\u601d\u79d1\u4ea7\u54c1\u4e4b\u95f4\u7684\u8fde\u63a5\u3002<\/p>\n<p>\u4e00\u53e5\u8bdd\uff0c\u670d\u52a1\u5668\u4e0e\u4ea4\u6362\u673a\uff0c\u53ea\u80fd\u7528LACP\u624d\u6709\u6c47\u805a\u6548\u679c\uff0c\u800c\u4ea4\u6362\u673a\u4e0e\u4ea4\u6362\u673a\u65e2\u53ef\u4ee5\u662fLACP\uff0c\u4e5f\u53ef\u4ee5\u662fPAgP\uff0c\u540c\u65f6\u8981\u6ce8\u610f\uff0c\u4e92\u76f8\u8fde\u63a5\u7684\u7aef\u53e3\u4e4b\u95f4\u534f\u8bae\u8981\u7edf\u4e00\u3002\u4e0d\u7ba1\u662fLACP\u8fd8\u662fPAgP\uff0c\u7ec4\u6210\u7684\u65b0\u7684\u865a\u62df\u901a\u9053\u5728\u601d\u79d1\u91cc\u53eb\u505aetherchannel\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u5c061\/0\/1\u4e0e1\/0\/2\u6c47\u805a\uff0c\u524d\u63d0\u8fdb\u5165enable\u6a21\u5f0f\uff0c<\/p>\n<p>\u914d\u7f6eLACP<\/p>\n<pre>Switch#configure terminal\r\nSwitch(config)#interface range gigabitEthernet 1\/0\/1 - 2\r\nSwitch(config-if-range)#switchport mode trunk\r\nSwitch(config-if-range)#channel-group 1 mode active\r\nSwitch(config-if-range)#end<\/pre>\n<p>\u914d\u7f6ePAgP<\/p>\n<pre>Switch#configure terminal\r\nSwitch(config)#interface range gigabitEthernet 1\/0\/1 - 2\r\nSwitch(config-if-range)#switchport mode trunk\r\nSwitch(config-if-range)#channel-group 1 mode desirable\r\nSwitch(config-if-range)#end<\/pre>\n<p>\u51e0\u4e2a\u6709\u7528\u7684\u67e5\u770b\u547d\u4ee4<\/p>\n<p>show running-config\u67e5\u770b\u5f53\u524d\u914d\u7f6e\u4fe1\u606f<\/p>\n<pre>interface GigabitEthernet1\/0\/1\r\n switchport mode trunk\r\n spanning-tree portfast\r\n channel-group 1 mode active\r\n !\r\n interface GigabitEthernet1\/0\/2\r\n switchport mode trunk\r\n spanning-tree portfast\r\n channel-group 1 mode active<\/pre>\n<p>show ip interfaces brief \u663e\u793ainterfaces\u7684\u72b6\u6001<\/p>\n<pre>Port-channel1 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0unassigned \u00a0 \u00a0 \u00a0YES unset \u00a0up \u00a0 \u00a0 \u00a0 \u00a0  \u00a0 \u00a0 \u00a0up<\/pre>\n<p>show spanning-tree \u67e5\u770b\u751f\u6210\u6811\uff0c\u5982\u679c\u6c47\u805a\u6210\u529f\u4f1a\u53ea\u663e\u793a<\/p>\n<pre>Po1 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Desg FWD 3 \u00a0 \u00a0 \u00a0 \u00a0 128.224 \u00a0P2p<\/pre>\n<p>\u66f4\u6539port-channel\u7684\u8d1f\u8f7d\u5747\u8861\u7684\u65b9\u5f0f\u4e3asrc-mac<\/p>\n<pre>Switch#configure terminal\r\nSwitch(config)#port-channel load-balance\u00a0src-mac<\/pre>\n<p>\u53ef\u9009\u7684\u65b9\u5f0f\u6709\uff1a<\/p>\n<pre>dst-ip Dst IP Addr\r\ndst-mac Dst Mac Addr\r\nsrc-dst-ip Src XOR Dst IP Addr\r\nsrc-dst-mac Src XOR Dst Mac Addr\r\nsrc-ip Src IP Addr\r\nsrc-mac Src Mac Addr<\/pre>\n<p>\u67e5\u770betherchannel\u8d1f\u8f7d\u5747\u8861\u7684\u65b9\u5f0f\uff1a<\/p>\n<pre>Switch#show etherchannel load-balance\r\nEtherChannel Load-Balancing Configuration:\r\nsrc-mac<\/pre>\n<p>\u67e5\u770binterfaces\u7684trunk\u72b6\u6001<\/p>\n<p>Switch#show interfaces trunk<\/p>\n<pre>Port Mode Encapsulation Status Native vlan\r\n Po1 on 802.1q trunking 1\r\n Po3 on 802.1q trunking 1\r\n Po4 on 802.1q trunking 1\r\nPort Vlans allowed on trunk\r\n Po1 1-4094\r\n Po3 1-4094\r\n Po4 1-4094\r\nPort Vlans allowed and active in management domain\r\n Po1 1\r\n Po3 1\r\n Po4 1\r\nPort Vlans in spanning tree forwarding state and not pruned\r\n Po1 1\r\n Po3 1\r\n Po4 1<\/pre>\n<p>\u67e5\u770bether channel\u72b6\u6001<\/p>\n<pre>Switch#show etherchannel summary\r\n\r\nFlags: D - down P - bundled in port-channel\r\nI - stand-alone s - suspended\r\nH - Hot-standby (LACP only)\r\nR - Layer3 S - Layer2\r\nU - in use f - failed to allocate aggregator\r\n\r\nM - not in use, minimum links not met\r\nu - unsuitable for bundling\r\nw - waiting to be aggregated\r\nd - default port\r\nNumber of channel-groups in use: 4\r\nNumber of aggregators: 4\r\n\r\nGroup Port-channel Protocol Ports\r\n------+-------------+-----------+--------------------------------------------\r\n1 Po1(SU) PAgP Gi1\/0\/1(P) Gi1\/0\/2(P)\r\n2 Po2(SD) LACP Gi1\/0\/3(D) Gi1\/0\/4(D)\r\n3 Po3(SU) LACP Gi1\/0\/5(P) Gi1\/0\/6(P)\r\n4 Po4(SD) LACP Gi1\/0\/7(D) Gi1\/0\/8(D)<\/pre>\n<p>\u53ef\u4ee5\u770b\u5230\u6b63\u5728\u8fd0\u884c\u7684\u662f\u7b2c\u4e00\u4e2aPAgP\uff0c\u7b2c3LACP<\/p>\n<p>\u53c2\u8003\uff1a<\/p>\n<p><a href=\"http:\/\/www.cisco.com\/en\/US\/docs\/switches\/lan\/catalyst2960\/software\/release\/12.2_55_se\/configuration\/guide\/swethchl.html#wpxref12539\">http:\/\/www.cisco.com\/en\/US\/docs\/switches\/lan\/catalyst2960\/software\/release\/12.2_55_se\/configuration\/guide\/swethchl.html#wpxref12539<\/a><\/p>\n<p>\u670d\u52a1\u5668 bond0 \u00a0mode0 \u4ea4\u6362\u673a\u505a etherchannel \u4f7f\u4ea4\u6362\u673a show logging \u6ca1\u6709 flapping.<\/p>\n<p>\u5728 configure terminal \u4e0b\uff0c\u505a\u597d port-channel<\/p>\n<pre>switch(config)#interface port-channel 2\r\nswitch(config-if)#switchport mode access\r\nswitch(config-if)#switchport access vlan 6<\/pre>\n<p>\u5c06 gi \u53e3\u52a0\u5165\u5230 port-channel\uff0c\u8fd9\u91cc\u7528\u7684 mode \u662f on<\/p>\n<pre>switch(config-if)#int range gi 1\/0\/10 - 13\r\nswitch(config-if-range)#channel-group 2 mode on<\/pre>\n<p>\u9ed8\u8ba4\u662f no shutdown \uff0c\u8fd9\u6837\u4ee5\u540e\u4f1a\u6709\u51e0\u5341\u79d2\u7684\u4e2d\u65ad\uff0c\u7136\u540e\u67e5\u770b etherchannel<\/p>\n<pre>2 Po2(SU) - Gi1\/0\/10(P) Gi1\/0\/11(P) Gi1\/0\/12(P)\r\n Gi1\/0\/13(P)<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u91cc\u7684\u6c47\u805a\u8981\u8fbe\u5230\u7684\u76ee\u7684\uff1a\u4ea4\u6362\u673a\u4e4b\u95f4\u53ef\u4ee5\u6269\u5c55\u5e26\u5bbd\uff0c\u540c\u65f6\u589e\u5f3a\u53ef\u7528\u6027\u3002C2960S\u662f\u4e8c\u5c42\u4ea4\u6362\u673a\u3002\u5b9e\u73b0\u6c47\u805a\u7684\u4e24\u4e2a\u534f\u8bae Link Aggregation Control Protocol (LACP) \u548c Port Aggregation Protocol (PAgP) LACP\u662fIEEE 802.3ad\u4e2d\u89c4\u5b9a\u7684\u534f\u8bae\uff0c\u6240\u4ee5\u5177\u6709\u901a\u7528\u6027\uff0c\u6240\u4ee5linux\u53c8\u7f51\u5361\u7ed1\u5b9a\u65f6\uff0c\u9700\u8981\u9009\u62e9Mode 4 (802.3ad)\uff0c\u8fd9\u6837\u4ea4\u6362\u673a\u4e0e\u670d\u52a1\u5668\u4e4b\u95f4\u5c31\u80fd\u589e\u52a0\u5e26\u5bbd\u3002 \u800cPAgP\u662f\u601d\u79d1\u81ea\u5df1\u7684\u6c47\u805a\u534f\u8bae\uff0c\u5b83\u9002\u7528\u4e8e\u601d\u79d1\u4ea7\u54c1\u4e4b\u95f4\u7684\u8fde\u63a5\u3002 \u4e00\u53e5\u8bdd\uff0c\u670d\u52a1\u5668\u4e0e\u4ea4\u6362\u673a\uff0c\u53ea\u80fd\u7528LACP\u624d\u6709\u6c47\u805a\u6548\u679c\uff0c\u800c\u4ea4\u6362\u673a\u4e0e\u4ea4\u6362\u673a\u65e2\u53ef\u4ee5\u662fLACP\uff0c\u4e5f\u53ef\u4ee5\u662fPAgP\uff0c\u540c\u65f6\u8981\u6ce8\u610f\uff0c\u4e92\u76f8\u8fde\u63a5\u7684\u7aef\u53e3\u4e4b\u95f4\u534f\u8bae\u8981\u7edf\u4e00\u3002\u4e0d\u7ba1\u662fLACP\u8fd8\u662fPAgP\uff0c\u7ec4\u6210\u7684\u65b0\u7684\u865a\u62df\u901a\u9053\u5728\u601d\u79d1\u91cc\u53eb\u505aetherchannel\u3002 \u4e0b\u9762\u662f\u5c061\/0\/1\u4e0e1\/0\/2\u6c47\u805a\uff0c\u524d\u63d0\u8fdb\u5165enable\u6a21\u5f0f\uff0c \u914d\u7f6eLACP Switch#configure terminal Switch(config)#interface range gigabitEthernet 1\/0\/1 &#8211; 2 Switch(config-if-range)#switchport mode trunk Switch(config-if-range)#channel-group 1 mode active Switch(config-if-range)#end \u914d\u7f6ePAgP Switch#configure terminal Switch(config)#interface range gigabitEthernet 1\/0\/1 &#8211; 2 Switch(config-if-range)#switchport mode trunk Switch(config-if-range)#channel-group 1 mode desirable Switch(config-if-range)#end \u51e0\u4e2a\u6709\u7528\u7684\u67e5\u770b\u547d\u4ee4 show running-config\u67e5\u770b\u5f53\u524d\u914d\u7f6e\u4fe1\u606f [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[153],"class_list":["post-5292","post","type-post","status-publish","format-standard","hentry","category-life","tag-cisco"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5292"}],"version-history":[{"count":19,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5292\/revisions"}],"predecessor-version":[{"id":7123,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/5292\/revisions\/7123"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}