以下是从51CTO博客上转载下来,发现这两种邦定端口的办法,所以把它总结在了一起供大家学习参考,Etherchannel出自http://eskystar.blog.51cto.com,在他的博客上学到不少,有兴趣大家可以去访问.

etherchannel特性在switch到switch、switch到router之间提供冗余的、高速的连接方式,简单说就是将两个设备间多条 fe或ge物理链路捆在一起组成一条设备间逻辑链路,从而达到增加带宽,提供冗余的目的。下面具体结合配置了解它的特点:
构成etherchannel的端口必须配置成相同的特性,如双工模式、速度、同为fe或ge端口、native vlan,、vlan range,、and trunking status and type.等当etherchannel中某一条link failed时,etherchannel中其它link照常工作。
当配置layer 2端口作etherchannel时只要在成员端口配置模式下用channel-group n命令指定该端口要加入的channel-group组,这时switch会自动创建port-channel接口,而当配置layer 3端口作etherchannel时,还需现在全局配置模式下用 interface port-channel n 命令手工创建port-channel接口。
具体配置:
switch# conf terminal
switch(config)#interface range fastethernet0/4 -5
switch(config)#switchport mode access
switch(config)# switchport access vlan 10
switch(config)# channel-group 5 mode desirable|auto|on
switch(config)#end
以上配置将f0/4、f0/5端口加入channel-group 5 ,作etherchannel的端口可为access端口也可为trunk端口。在将两个swith间的link作etherchannel与两个 swith间的link作trunk有一点相似的地方就是:配置trunk时两端的端口有几种模式:trunk、auto、desirable等,配置 etherchannel时两端的端口有desirable|auto||passive(使用lacp)几种模式,所不同的是trunk端口间协商是使 用dtp(dynamic trunking protocol);而etherchannel端口间协商是使用pagp(port aggregation protocol,cisco专有)或lacp (link aggregation c protocol,802.3ad )
对于使用pagp的三种模式,
desirable 表示该端口会主动发pagp数据包与对端进行协商
auto 表示该端口不会主动发pagp数据包与对端进行协商
on 表示强制将该端口加入etherchannel,不需用pagp协议与对端进行协商
对于使用lacp的两种模式,
active 表示该端口会主动发lacp数据包与对端进行协商
passive 表示该端口不会主动发lacp数据包与对端进行协商式
了解了这几种模式的意义后,只要两端port的配置匹配即可。
除了以上作etherchannel的基本配置外,还有一些扩展特性。
etherchannel在作数据转发时,我们可以通过接口配置命令 pagp port-priority 改变优先级设定哪条物理link主用,哪条备用,一旦主用物理link上产生阻塞,备用link立即启用。
etherchannel在作数据转发时,是基于数据包的源或目的mac地址随机选择etherchannel中的一条物理link进行数据转发的。 我们可以通过全局配置命令port-channel load-balance选择是根据源mac地址还是根据目的mac地址进行数据转发来实现负载平衡。
例如:当有两台switch,它们之间有几条link 互联作etherchannel,switcha一端连接一台server,switchb一端连接多台clientpc,这时switha一端的数据流 是同一源mac地址的数据包通过etherchannel转发向不同目的mac地址。这时,为了充分利用etherchannel中的所有的物理 link,在switha一端就应该配置为基于数据包的目的mac地址方式,而switchb一端的数据流是不同源mac地址的数据包通过 etherchannel转发向同目的mac地址。在swithb一端就应该配置为基于数据包的源mac地址方式。

以下这种端口的邦定方法出自http://ltyluck.blog.51cto.com/,更详细的方法大家去访问,我这里只转载基本的配置方法

在这里要注意的是我们总部是R2的路由器,分部的是R1的路由器。

我们现在把它的基本配置配置起来!

Router>en
Router#conf t .
Router(config)#host R1
R1(config)#no ip do lo
R1(config)#line con 0
R1(config-line)#logg syn
R1(config-line)#exec-timeout  0 0
R1(config-line)#exit
R1(config)#

Router>en
Router#conf t
Router(config)#host R2
R2(config)#no ip do lo
R2(config)#line con 0
R2(config-line)#logg syn
R2(config-line)#exec-timeout 0 0
R2(config-line)#exit
R2(config)#

我们现在来将两个端口绑定成逻辑上的一个端口使用。

配置我们总部的路由器。

R2(config)#multilink virtual-template 1 //Multilink接口采用虚拟接口模板的配置信息
R2(config)#interface virtual-template 1       //创建虚拟接口模板
R2(config-if)#ip add 172.16.254.13 255.255.255.0  //给我们虚拟接口模板配置一个IP地址。
R2(config-if)#ppp multilink                         //打开ppp multilink功能
R2(config-if)#exit
R2(config)#int s1/0
R2(config-if)#encapsulation ppp               //封闭PPP协议
R2(config-if)#ppp multilink                      //打开ppp multilink功能
R2(config-if)#no shut                               //启用该接口
R2(config-if)#exit
R2(config)#
R2(config)#int s1/1
R2(config-if)#encapsulation ppp               //封闭PPP协议
R2(config-if)#ppp multilink                      //打开ppp multilink功能
R2(config-if)#no shut                               //启用该接口
R2(config-if)#exit
R2(config)#
R2(config)#int lo0
R2(config-if)#ip add 192.168.1.1 255.255.255.0
R2(config-if)#exit
R2(config)#int lo1
R2(config-if)#ip add 192.168.2.1 255.255.255.0
R2(config-if)#exit
R2(config)#

配置分部1的路由器

R1(config)#multilink virtual-template 1
R1(config)#interface virtual-template 1
R1(config-if)#ip add 172.16.254.14 255.255.255.0
R1(config-if)#ppp multilink
R1(config-if)#exit
R1(config)#int s1/0
R1(config-if)#encapsulation ppp
R1(config-if)#ppp multilink
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#int s1/1
R1(config-if)#en ppp
R1(config-if)#ppp multilink
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#
R1(config)#int lo0
R1(config-if)#ip add 192.168.3.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#int lo1
R1(config-if)#ip add 192.168.4.1 255.255.255.0
R1(config-if)#exit
R1(config)#

这里面的配置与上面我们总部的配置都是一样的,我们从上面的一些日志我们可以看到我们配置的端口绑定已经起来了,我们下面来查看一下呢?

R1#show ip int bri
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down   
Serial1/0                  unassigned      YES unset  up                    up     
Serial1/1                  unassigned      YES unset  up                    up     
Serial1/2                  unassigned      YES unset  administratively down down   
Serial1/3                  unassigned      YES unset  administratively down down   
Virtual-Access1            unassigned      YES unset  down                  down   
Virtual-Template1          172.16.254.14   YES manual down                  down   
Virtual-Access2            172.16.254.14   YES TFTP   up                    up     
Loopback0                  192.168.3.1     YES manual up                    up     
Loopback1                  192.168.4.1     YES manual up                    up     
R1#

测试一下

R1#ping 172.16.254.13 //这个是我们公司总部的路由器上面的IP地址

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.254.13, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/36/72 ms
R1#

我们可以看见,是不是将两个端口绑定成一个虚拟端口,然后通过这个虚拟端口的IP地址来进行通信,我们现在来查看一下它的接口信息。

R1#show ppp multilink

Virtual-Access2
  Bundle name: R2
  Remote Endpoint Discriminator: [1] R2 远端的路由器名
  Local Endpoint Discriminator: [1] R1    本地的路由器名
  Bundle up for 00:05:48, total bandwidth 3088, load 1/255   我们可以看见总带宽是3088=1544k*2
  Receive buffer limit 24384 bytes, frag timeout 1000 ms
    0/0 fragments/bytes in reassembly list
    0 lost fragments, 0 reordered
    0/0 discarded fragments/bytes, 0 lost received
    0xA received sequence, 0xA sent sequence
  Member links: 2 (max not set, min not set)
    Se1/0, since 00:05:49
    Se1/1, since 00:05:37
No inactive multilink interfaces
R1#

我们来查看一下我们的虚拟接口信息:

R1#show interfaces virtual-access 2
Virtual-Access2 is up, line protocol is up //我们可以看见我们两个都是up
  Hardware is Virtual Access interface
  Internet address is 172.16.254.14/24     //我们本地的IP地址
  MTU 1500 bytes, BW 3088 Kbit, DLY 100000 usec,   //在这里我们可以看见总带宽是3088k
     reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, LCP Open, multilink Open     //我们可以查看到我们使用的是PPP   多链路已经打开了
  Open: IPCP
  MLP Bundle vaccess, cloned from Virtual-Template1
  Vaccess status 0x40, loopback not set
  Keepalive set (10 sec)
  DTR is pulsed for 5 seconds on reset
   R1#

查看一下路由表:

R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C       172.16.254.0/24 is directly connected, Virtual-Access2
C       172.16.254.13/32 is directly connected, Virtual-Access2 //我们可以看见,我们总部的IP地址显示在这里了
C    192.168.4.0/24 is directly connected, Loopback1
C    192.168.3.0/24 is directly connected, Loopback0
R1#

我们现在在两边来运行一个路由协议(EIGRP)

R1(config)#router eigrp 100
R1(config-router)#no au
R1(config-router)#net 192.168.3.0 0.0.0.255
R1(config-router)#net 192.168.4.0 0.0.0.255
R1(config-router)#net 172.16.254.0 0.0.0.255
R1(config-router)#exit

在R2里面配置一下路由协议(EIGRP)

R2(config)#router eigrp 100
R2(config-router)#no au
R2(config-router)#net 192.168.1.0 0.0.0.255
R2(config-router)#net 192.168.2.0 0.0.0.255
R2(config-router)#net 172.16.254.0 0.0.0.255
R2(config-router)#exit
R2(config)#
*Oct 20 13:12:01.943: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 172.16.254.14 (Virtual-Access2) is up: new adjacency

我们可以看见,它是通过我们的172.16.254.14 (Virtual-Access2)来建立邻居的。而不是通过我们的物理接口来建立邻居的。

现在再来查看一下路由表:

R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C       172.16.254.0/24 is directly connected, Virtual-Access2
C       172.16.254.13/32 is directly connected, Virtual-Access2
C    192.168.4.0/24 is directly connected, Loopback1
D    192.168.1.0/24 [90/3516928] via 172.16.254.13, 00:01:50, Virtual-Access2
D    192.168.2.0/24 [90/3516928] via 172.16.254.13, 00:01:50, Virtual-Access2
C    192.168.3.0/24 is directly connected, Loopback0
R1#

从上面我们可以看见这两个网段是通过我们的虚拟接口来建立起来的。