拓扑图
要求:
- 配置所有主机划分在vlan10内
- LSW1和LSW2配置链路聚合
- 主机配置如图所示,这里不作展示
LSW1配置vlan
vlan batch 10
#
interface Ethernet0/0/1
port link-type access
port default vlan 10
#
interface Ethernet0/0/2
port link-type access
port default vlan 10
LSW2配置vlan
vlan batch 10
#
interface Ethernet0/0/1
port link-type access
port default vlan 10
下面开始配置交换机链路聚合
LSW1链路聚合配置
[LSW1]interface Eth-Trunk 1 # 进入以太网链路聚合接口视图
[LSW1-Eth-Trunk1]mode manual load-balance # 配置链路聚合模式为手工模式
[LSW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/2 # 添加链路聚合接口
[LSW1-Eth-Trunk1]load-balance src-mac # 配置基于源mac地址的负载均衡模式
[LSW1-Eth-Trunk1]port link-type trunk # 配置该逻辑接口为干道模式
[LSW1-Eth-Trunk1]port trunk allow-pass vlan 10 1 # 允许vlan 10 和 vlan 1通过
[LSW1-Eth-Trunk1]quit
LSW2链路聚合配置
[LSW2]interface Eth-Trunk 1
[LSW2-Eth-Trunk1]mode manual load-balance
[LSW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/2
[LSW2-Eth-Trunk1]load-balance dst-mac
[LSW2-Eth-Trunk1]port link-type trunk
[LSW2-Eth-Trunk1]port trunk allow-pass vlan 10 1
[LSW2-Eth-Trunk1]quit
至此交换机的链路聚合配置完成,下面查看交换机的Eth-trunk状态