下面是局域网二层交换2950之间的端口聚合的操作实例:
两台2950交换机使用各自的两个吉比特以太网接口GIG0/1和GIG0/2实现聚合:
下面是配置:
Switch-1:
interface GigabitEthernet0/1
channel-group 1 mode on
!
interface GigabitEthernet0/2
channel-group 1 mode on
!
Switch-2:
interface GigabitEthernet0/1
channel-group 1 mode on
!
interface GigabitEthernet0/2
channel-group 1 mode on
!
检查下:
Switch#sh ip int b
Interface IP-Address OK? Method Status Protocol
Vlan1 192.168.1.1 YES NVRAM up up
FastEthernet0/1 unassigned YES unset down down
FastEthernet0/2 unassigned YES unset down down
FastEthernet0/3 unassigned YES unset down down
FastEthernet0/4 unassigned YES unset down down
FastEthernet0/5 unassigned YES unset down down
FastEthernet0/6 unassigned YES unset down down
FastEthernet0/7 unassigned YES unset down down
FastEthernet0/8 unassigned YES unset down down
FastEthernet0/9 unassigned YES unset down down
FastEthernet0/10 unassigned YES unset down down
FastEthernet0/11 unassigned YES unset down down
FastEthernet0/12 unassigned YES unset down down
FastEthernet0/13 unassigned YES unset down down
FastEthernet0/14 unassigned YES unset down down
FastEthernet0/15 unassigned YES unset down down
FastEthernet0/16 unassigned YES unset down down
FastEthernet0/17 unassigned YES unset down down
FastEthernet0/18 unassigned YES unset down down
FastEthernet0/19 unassigned YES unset down down
FastEthernet0/20 unassigned YES unset down down
FastEthernet0/21 unassigned YES unset down down
FastEthernet0/22 unassigned YES unset down down
FastEthernet0/23 unassigned YES unset down down
FastEthernet0/24 unassigned YES unset down down
GigabitEthernet0/1 unassigned YES unset down down
GigabitEthernet0/2 unassigned YES unset down down
Port-channel1 unassigned YES unset down down
00:11:13: %SYS-5-CONFIG_I: Configured from console by console int port
Switch#sh int port-channel 1
Port-channel1 is up, line protocol is up (connected)
Hardware is EtherChannel, address is 0014.1c41.9e9a (bia 0014.1c41.9e9a)
MTU 1500 bytes, BW 2000000 Kbit, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Full-duplex, 1000Mb/s, media type is unknown media type
input flow-control is off, output flow-control is off
Members in this channel: Gi0/1 Gi0/2
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:00:01, output 00:00:01, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 2000 bits/sec, 3 packets/sec
5 minute output rate 1000 bits/sec, 1 packets/sec
1277 packets input, 101974 bytes, 0 no buffer
Received 1223 broadcasts (0 multicast)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 1220 multicast, 0 pause input
0 input packets with dribble condition detected
217 packets output, 21170 bytes, 0 underruns
0 output errors, 0 collisions, 7 interface resets
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier, 0 PAUSE output
0 output buffer failures, 0 output buffers swapped out
Switch#
不知道大家配置完以后,有没有成功UP并且两个端口聚合为2GB的速度,我没有,不知道具体原因,分别进入两台交换机后,执行sh和no sh后问题解决。
下面是局域网的核心交换机(三层交换)和二层交换之间的端口聚合的操作实例:
2950
Switch>en
Switch#conf t
Switch(config)#int f0/1
Switch(config-if)#channel-group 1 mode on
Switch(config-if)#int f0/2
Switch(config-if)#channel-group 1 mode on
3560
Switch(config)#ip routing(默认已经启用了路由功能)
Switch(config)#int port-channel 1
Switch(config-if)#no switchport
Switch(config-if)#ip add 1.1.1.1 255.0.0.0
Switch(config-if)#no shut
Switch(config-if)#exit
Switch(config)#int f0/1
Switch(config-if)#no switchport
Switch(config-if)#no ip add
Switch(config-if)#channel-group 1 mode on
Switch(config-if)#int f0/2
Switch(config-if)#no switchport
Switch(config-if)#no ip address
Switch(config-if)#channel-group 1 mode on
Switch(config-if)#exit
Switch(config)#int f0/3
Switch(config-if)#no switchport
Switch(config-if)#ip add 2.2.2.1 255.0.0.0
Switch(config-if)#no shut
端口聚合可使流量在多条物理链路上负载均衡,同时也起到了链路的备份作用。但是在某些设备里,应注意聚合链路两端接口的速率,工作模式,例如在快以中,可将各个端口设置为speed 100,duplex full。