结合以太通道的vlan配置

拓扑图

在switch 1与switch 2 之间建立以太通道,提高网络性能

进入全局配置模式,在全局配置模式下创建以太通道,使用命令nterface port-channel

Switch#conf t

Switch(config)#

Switch(config)#interface port-channel 1

Switch(config-if)#exit

将端口划分到以太通道

Switch(config)#int range f0/3-4

Switch(config-if-range)#channel-group 1 mode on

在switch 2中做相同的配置

以太通道配置完成

配置以太通道的负载均衡

Switch(config)#interface port-channel 1
Switch(config-if)#port-channel load-balance dst-mac

负载均衡的类型有六种 源ip(src-ip) ,源mac(src-mac),目标ip(dst-ip),目标mac(dat-mac),源到目标的ip(src-dst-ip),源到目标的mac(src-dst-mac)

 接下来做vlan的配置

switch 1

Switch(config)#
Switch(config)#
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch(config)#int f0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#
Switch(config)#int f0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
 
switch  2的配置和switch 1的配置一样
接下来为vlan配置中继链路
这里直接将以太通道配置为两台交换机的中继链路
Switch(config)#interface port-channel 1
Switch(config-if)#switchport mode trunk
 
switch 1查看以太通道的汇总信息
Switch#show etherchannel summary
Flags:  D - down        P - in port-channel
        I - stand-alone s - suspended
        H - Hot-standby (LACP only)
        R - Layer3      S - Layer2
        U - in use      f - failed to allocate aggregator
        u - unsuitable for bundling
        w - waiting to be aggregated
        d - default port

Number of channel-groups in use: 1
Number of aggregators:           1
Group  Port-channel  Protocol    Ports
------+-------------+-----------+----------------------------------------------
1      Po1(SU)           -      Fa0/3(P) Fa0/4(P)
 
用ping命令检查
pc 1 ping pc 2

可以通信(同一vlan)

pc 1 ping pc 2

无法通信(vlan不同)

原文地址:https://www.cnblogs.com/knightysa/p/9178071.html