思科交换机配置链路聚合
组网如下图所示,使用GNS3模拟器运行2台思科三层交换机。
SW1 配置:
SW1(config)#int range g0/0-2
SW1(config-if-range)#switchport
SW1(config)#int range g0/0-1
SW1(config-if-range)#channel-protocol lacp
SW1(config-if-range)#channel-group 1 mode active
SW1(config-if-range)#switchport trunk encapsulation dot1q
SW1(config-if-range)#switchport mode trunk
SW1(config-if-range)#switchport trunk allow vlan all
SW2配置:
SW2(config)#int range g0/0-2
SW2(config-if-range)#switchport
SW2(config)#int range g0/0-1
SW2(config-if-range)#channel-protocol lacp
SW2(config-if-range)#channel-group 1 mode active
SW2(config-if-range)#switchport trunk encapsulation dot1q
SW2(config-if-range)#switchport mode trunk
SW2(config-if-range)#switchport trunk allow vlan all
PC配置IP地址
PC1> ip 192.168.1.1 255.255.255.0
PC2> ip 192.168.1.2 255.255.255.0
查看端口状态
SW1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 unassigned YES unset up up
GigabitEthernet0/1 unassigned YES unset up up
GigabitEthernet0/2 unassigned YES unset up up
......
Port-channel1 unassigned YES unset up up
验证连通性
PC1> ping 192.168.1.2
84 bytes from 192.168.1.2 icmp_seq=1 ttl=64 time=6.181 ms
84 bytes from 192.168.1.2 icmp_seq=2 ttl=64 time=6.007 ms
84 bytes from 192.168.1.2 icmp_seq=3 ttl=64 time=5.537 ms
84 bytes from 192.168.1.2 icmp_seq=4 ttl=64 time=8.162 ms
84 bytes from 192.168.1.2 icmp_seq=5 ttl=64 time=7.173 ms