实验要求
本实验模拟内网冗余网络环境,完成以下需求:
1.如图所示,配置设备名称和IP地址。
2.在SW1与SW2之间配置链路聚合协议LACP,完成以下需求:
2.1 SW1作为主动端,设置系统优先级为最高。
2.2 eth-trunk链路的编号为0
2.3 采用静态lacp的方式聚合链路。
2.4 根据源/目MAC地址进行负载均衡。
2.5 将对应端口划入eth-turnk。
3. 在SW1/2/3/4上创建vlan10和vlan20,并完成以下需求:
3.1 四台交换机之间的链路使用trunk模式,并仅允许vlan10和20
3.2 连接PC的链路使用access模式,PC1属于vlan10,PC2属于vlan20.
3.3 SW1上创建vlan10的网关,SW2上创建vlan20的网关,IP地址如图所示。
4. 在SW1/2/3/4之间运行MSTP,完成以下需求:
4.1 配置mstp域名为spoto
4.2 vlan10属于实例1,vlan20属于实例2.
4.3 设置sw1为实例1的根桥,优先级为0;设置sw2为实例1的次根桥,优先级为4096.
4.4 设置sw2为实例2的根桥,优先级为0;设置sw1为实例2的次根桥,优先级为4096.
4.5 SW3/4上与PC互联端口配置为边缘端口。
4.6 使用display stp brief命令,观察各交换机的接口角色与状态,分析vlan10与vlan20的流量走向。
实验拓扑图
![](https://img-blog.csdnimg.cn/422b8448d89943d7a1205d6e8bf18a38.png)
实验步骤
1.配置PC,SW1,2配置LACP
SW1
lacp priority 0
int eth-trunk 0
mode lacp-static
load-balance src-dst-mac
int g0/0/2
eth-trunk 0
int g0/0/3
eth-trunk 0
SW2
int eth-trunk 0
mode lacp-static
load-balance src-dst-mac
int g0/0/2
eth-trunk 0
int g0/0/3
eth-trunk 0
2.在交换机上创建vlan 10 20
SW1
vlan batch 10 20
int eth-trunk 0
port link-type trunk
port trunk allow-pass vlan 10 20
int g0/0/1
port link-type trunk
port trunk allow-paas vlan 10 20
int vlanif 10
ip add 192.168.1.254 24
SW2
vlan batch 10 20
int eth-trunk 0
port link-type trunk
port trunk allow-paas vlan 10 20
int g0/0/1
port link-type trunk
port trunk allow-paas vlan 10 20
int vlanif 20
ip add 192.168.2.254 24
SW3
vlan batch 10 20
int g0/0/1
port link-type trunk
port trunk allow-paas vlan 10 20
int g0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20
int g0/0/3
port link-type access
port default vlan 10
SW4
vlan batch 10 20
int g0/0/1
port link-type trunk
port trunk allow-paas vlan 10 20
int g0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20
int g0/0/3
port link-type access
port default vlan 20
4.交换机上运行MSTP
SW1
stp mode mstp
stp region-configuration
region-name spoto
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
SW2
stp mode mstp
stp region-configuration
region-name spoto
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
SW3,4同理配置,再设置实例根桥和次根桥。
SW1
stp instance 1 priority 0
stp instance 2 priority 4096
SW2
stp instance 1 priority 4096
stp instance 2 priority 0
配置边缘端口
SW3
int g0/0/3
stp edged-port enable
SW4
int g0/0/3
stp edged-port enable