双机热备份MSTP+VRRP+负载均衡

1. LSW6(左边那台,负责 VLAN10 主 + VLAN20 备)

system-view

sysname LSW6

vlan batch 10 20 30

接口配置

interface GigabitEthernet 0/0/4

port link-type access

port default vlan 30

quit

port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/3

port link-type trunk

port trunk allow-pass vlan 10 20 30

quit

三层接口 + VRRP(VLAN10 主,VLAN20 备)

interface Vlanif 30

ip address 192.168.3.1 24

quit

interface Vlanif 10

ip address 192.168.1.2 24

vrrp vrid 1 virtual-ip 192.168.1.1

vrrp vrid 1 priority 200

quit

interface Vlanif 20

ip address 192.168.2.2 24

vrrp vrid 2 virtual-ip 192.168.2.1

vrrp vrid 2 priority 195

quit

MSTP 配置(关键!)

stp enable

stp mode mstp

stp region-configuration

region-name 123

instance 1 vlan 10

instance 2 vlan 20

active region-configuration

quit

根桥设置(VLAN10 的根桥在 LSW6)

stp instance 1 root primary

stp instance 2 root secondary

PC1 接入端口设为边缘端口

interface GigabitEthernet 0/0/1 # 接 LSW8 的端口,根据拓扑调整

stp edged-port enable

quit

quit

save

2. LSW7(右边那台,负责 VLAN20 主 + VLAN10 备)

system-view

sysname LSW7

vlan batch 10 20 40

接口配置

interface GigabitEthernet 0/0/4

port link-type access

port default vlan 40

quit

port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/3

port link-type trunk

port trunk allow-pass vlan 10 20 40

quit

三层接口 + VRRP(VLAN10 备,VLAN20 主)

interface Vlanif 10

ip address 192.168.1.2 24

vrrp vrid 1 virtual-ip 192.168.1.1

vrrp vrid 1 priority 195

quit

interface Vlanif 20

ip address 192.168.2.2 24

vrrp vrid 2 virtual-ip 192.168.2.1

vrrp vrid 2 priority 200

quit

MSTP 配置

stp enable

stp mode mstp

stp region-configuration

region-name 123

instance 1 vlan 10

instance 2 vlan 20

active region-configuration

quit

根桥设置(VLAN20 的根桥在 LSW7)

stp instance 1 root secondary

stp instance 2 root primary

接入端口设为边缘端口

interface GigabitEthernet 0/0/1 # 接 LSW9 的端口

stp edged-port enable

quit

quit

save

3. LSW8(接 PC1,只通 VLAN10)

system-view

sysname LSW8

vlan 10

interface GigabitEthernet 0/0/1

port link-type access

port default vlan 10

stp edged-port enable

quit

port-group group-member GigabitEthernet 0/0/2 to GigabitEthernet 0/0/3

port link-type trunk

port trunk allow-pass vlan 10

quit

stp enable

stp mode mstp

stp region-configuration

region-name 123

instance 1 vlan 10

instance 2 vlan 20

active region-configuration

quit

quit

save

4. LSW9(接 PC2,只通 VLAN20)

system-view

sysname LSW9

vlan 20

interface GigabitEthernet 0/0/1

port link-type access

port default vlan 20

stp edged-port enable

quit

port-group group-member GigabitEthernet 0/0/2 to GigabitEthernet 0/0/3

port link-type trunk

port trunk allow-pass vlan 20

quit

stp enable

stp mode mstp

stp region-configuration

region-name 123

instance 1 vlan 10

instance 2 vlan 20

active region-configuration

quit

quit

save

5. R2(路由器,上联核心)

system-view

sysname R2

interface GigabitEthernet 0/0/0

ip address 192.168.3.2 24

quit

interface GigabitEthernet 0/0/1

ip address 192.168.4.2 24

quit

interface GigabitEthernet 0/0/2

ip address 192.168.5.1 24

quit

静态路由(指向 LSW7 的 SVI,通常走 GE0/0/1)

ip route-static 192.168.1.0 24 192.168.4.1

ip route-static 192.168.2.0 24 192.168.4.1

【或者每个网段都用rip宣告自己的网段】

R2rip 1

R2-rip-1v 2

R2-rip-1net

R2-rip-1network 192.168.3.0

R2-rip-1network 192.168.4.0

R2-rip-1network 192.168.5.0

quit

save

相关推荐
网安小白的进阶之路3 小时前
B模块 安全通信网络 第二门课IPv6与WLAN 01
网络·安全
天天进步20154 小时前
Python全栈项目--Python自动化运维工具开发
运维·python·自动化
Soari4 小时前
Ubuntu 根分区文件系统损坏,系统启动时自动检查失败
linux·运维·ubuntu
学习3人组4 小时前
Cisco ASA防火墙 NAT实验:源NAT+目的NAT(Trust/Untrust双区域,无DMZ)
网络·网络安全
杨云龙UP4 小时前
Oracle Health Check巡检脚本使用SOP V2.0:从HTML原始报告→生成Word专业巡检报告→交付客户_2026-06-03
linux·运维·数据库·sql·oracle·报告·巡检
广州灵眸科技有限公司4 小时前
瑞芯微RV1126B开发板(EASY-EAI-PI2) Linux虚拟机准备
linux·运维·服务器
天天进步20154 小时前
Tunnelto 源码解析 #6:数据转发核心:远端 HTTP 请求如何被转发到本地 localhost
网络
Lana学习中5 小时前
【运维杂记】连接不上远程服务器的问题处理
运维·服务器
志栋智能5 小时前
安全超自动化:应对海量安全警报的唯一解
网络·安全·自动化
AOwhisky6 小时前
MySQL 学习笔记(第一期):数据库基础与 MySQL 初探
运维·数据库·笔记·学习·mysql·云计算