拓扑
需求
-PC1和PC3属于vlan 10、PC2和PC4属于vlan 20
-设备之间配置lacp模式的链路聚合,并确保同vlan之间的主机可以互通
配置步骤
1)PC配置IP地址
2)所有交换机创建vlan10 和vlan20
3)交换机和PC互联的接口设置为access ,并加入指定的vlan
4)配置SW1和SW2的系统优先级
5)配置Eth-Trunk
-创建eth-trunk 组
-定义 链路聚合的工作模式为lacp
-在链路聚合添加成员接口
-设置trunk模式,允许vlan 10 20 通过
配置命令
SW1配置:
[SW1]vlan batch 10 20
[SW1]lacp priority 100
[SW1]int Eth-Trunk 1
[SW1-Eth-Trunk1]mode lacp-static
[SW1-Eth-Trunk1]trunkport g 0/0/3 to 0/0/4
[SW1-Eth-Trunk1]port link-type trunk
[SW1-Eth-Trunk1]port trunk allow-pass vlan 10 20
[SW1-Eth-Trunk1]quit
[SW1]int eth-trunk 2
[SW1-Eth-Trunk2]mode lacp-static
[SW1-Eth-Trunk2]trunkport g 0/0/5 to 0/0/6
[SW1-Eth-Trunk2]port link-type trunk
[SW1-Eth-Trunk2]port trunk allow-pass vlan 10 20
[SW1-Eth-Trunk2]quit
[SW1]int eth-trunk 3
[SW1-Eth-Trunk3]mode lacp-static
[SW1-Eth-Trunk3]trunkport g 0/0/7 to 0/0/8
[SW1-Eth-Trunk3]port link-type trunk
[SW1-Eth-Trunk3]port trunk allow-pass vlan 10 20
SW2配置:
[SW2]vlan batch 10 20
[SW2]lacp priority 500
[SW2]int eth-trunk 1
[SW2-Eth-Trunk1]mode lacp-static
[SW2-Eth-Trunk1]trunkport g 0/0/3 to 0/0/4
[SW2-Eth-Trunk1]port link-type trunk
[SW2-Eth-Trunk1]port trunk allow-pass vlan 10 20
[SW2-Eth-Trunk1]quit
[SW2]int eth-trunk 2
[SW2-Eth-Trunk2]mode lacp-static
[SW2-Eth-Trunk2]trunkport g 0/0/5 to 0/0/6
[SW2-Eth-Trunk2]port link-type trunk
[SW2-Eth-Trunk2]port trunk allow-pass vlan 10 20
[SW2-Eth-Trunk2]quit
[SW2]int eth-trunk 3
[SW2-Eth-Trunk3]mode lacp-static
[SW2-Eth-Trunk3]trunkport g 0/0/7 to 0/0/8
[SW2-Eth-Trunk3]port link-type trunk
[SW2-Eth-Trunk3]port trunk allow-pass vlan 10 20
SW3配置:
[SW3]vlan batch 10 20
[SW3]int e0/0/1
[SW3-Ethernet0/0/1]port link-type access
[SW3-Ethernet0/0/1]port default vlan 10
[SW3-Ethernet0/0/1]quit
[SW3]int eth-trunk 1
[SW3-Eth-Trunk1]mode lacp-static
[SW3-Eth-Trunk1]trunkport e 0/0/3 to 0/0/4
[SW3-Eth-Trunk1]port link-type trunk
[SW3-Eth-Trunk1]port trunk allow-pass vlan 10 20
SW4配置:
[SW4]vlan batch 10 20
[SW4]int e0/0/1
[SW4-Ethernet0/0/1]port link-type access
[SW4-Ethernet0/0/1]port default vlan 20
[SW4-Ethernet0/0/1]quit
[SW4]int eth-trunk 2
[SW4-Eth-Trunk2]mode lacp-static
[SW4-Eth-Trunk2]trunkport e 0/0/5 to 0/0/6
[SW4-Eth-Trunk2]port link-type trunk
[SW4-Eth-Trunk2]port trunk allow-pass vlan 10 20
SW5配置:
[SW5]vlan batch 10 20
[SW5]int e0/0/1
[SW5-Ethernet0/0/1]port link-type access
[SW5-Ethernet0/0/1]port default vlan 10
[SW5-Ethernet0/0/1]quit
[SW5]int eth-trunk 1
[SW5-Eth-Trunk1]mode lacp-static
[SW5-Eth-Trunk1]trunkport e 0/0/3 to 0/0/4
[SW5-Eth-Trunk1]port link-type trunk
[SW5-Eth-Trunk1]port trunk allow-pass vlan 10 20
SW6配置:
[SW6]vlan batch 10 20
[SW6]int e0/0/1
[SW6-Ethernet0/0/1]port link-type access
[SW6-Ethernet0/0/1]port default vlan 20
[SW6-Ethernet0/0/1]quit
[SW6]int eth-trunk 2
[SW6-Eth-Trunk2]mode lacp-static
[SW6-Eth-Trunk2]trunkport e 0/0/5 to 0/0/6
[SW6-Eth-Trunk2]port link-type trunk
[SW6-Eth-Trunk2]port trunk allow-pass vlan 10 20
验证与测试:
pc1 ping pc 3 通
pc2 ping pc 4 通