配置vlan和vlan间路由、配置vlan的ip和vrrp、mstp和主次根

简单的通信实验

拓扑图

1.配置vlan和链路聚合

Sw1 & sw2

复制代码
undo info-center enable
vlan batch 10 20 30 40
int eth-trunk 1
trunkport g 0/0/1 to 0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20 30 40
int g0/0/3
port link-type trunk 
port trunk allow-pass vlan 10 20 30 40
int g0/0/4
port link-type trunk 
port trunk allow-pass vlan 10 20 30 40

sw3

复制代码
undo info-center enable
vlan batch 10 20 30 40
int g0/0/1 
port link-type trunk 
port trunk allow-pass vlan 10 20 30 40
int g0/0/2
port link-type trunk 
port trunk allow-pass vlan 10 20 30 40
int g0/0/3
port link-type access
port default vlan 10
int g0/0/4
port link-type access
port default vlan 20

sw4

复制代码
undo info-center enable
vlan batch 10 20 30 40
int g0/0/1 
port link-type trunk 
port trunk allow-pass vlan 10 20 30 40
int g0/0/2
port link-type trunk 
port trunk allow-pass vlan 10 20 30 40
int g0/0/3
port link-type access
port default vlan 30
int g0/0/4
port link-type access
port default vlan 40

2.配置vrrp和vlan

sw1

复制代码
int vlan 10
ip address 192.168.10.252 24
vrrp vrid 1 virtual-ip 192.168.10.254
vrrp vrid 1 priority 150
int vlan 20
ip address 192.168.20.252 24
vrrp vrid 2 virtual-ip 192.168.20.254
vrrp vrid 2 priority 150

int vlan 30
ip address 192.168.30.252 24
vrrp vrid 3 virtual-ip 192.168.30.254
int vlan 40
ip address 192.168.40.252 24
vrrp vrid 4 virtual-ip 192.168.40.254

sw2

复制代码
int vlan 10
ip address 192.168.10.253 24
vrrp vrid 1 virtual-ip 192.168.10.254
int vlan 20
ip address 192.168.20.253 24
vrrp vrid 2 virtual-ip 192.168.20.254

int vlan 30
ip address 192.168.30.253 24
vrrp vrid 3 virtual-ip 192.168.30.254
vrrp vrid 3 priority 150
int vlan 40
ip address 192.168.40.253 24
vrrp vrid 4 virtual-ip 192.168.40.254
vrrp vrid 4 priority 150

3.配置mstp

sw1 ~sw4

复制代码
stp region-configuration
region-name name
ins 1 vlan 10 20
ins 2 vlan 30 40
active region-configuration

4.配置主次根

Sw1

复制代码
stp ins 1 root pri
stp ins 2 root sec

sw2

复制代码
stp ins 1 root sec
stp ins 2 root pri

sw3 & sw4

复制代码
int g0/0/3
stp edg enable
int g0/0/4
stp edg enable

5.查看

  1. dis vrrp b
  1. dis stp b
  1. dis stp
  1. 查看链路聚合
    dis eth 1

sw2

  1. dis stp b
  1. dis vrrp b
  1. dis eth 1
  1. dis stp
  1. 配置pc



  1. ping


相关推荐
瑾珮1 小时前
nmcli命令网络配置
linux·网络
网络研究院1 小时前
2026年智能体人工智能的激增引发新的网络安全风险
网络·人工智能·安全·web安全·ai
Dev7z1 小时前
基于MATLAB的GA–PSO混合算法无线传感器网络节点部署优化研究
网络·算法·matlab
乾元2 小时前
AI 如何从配置历史与变更日志中推理出“变更引发的故障”——自动化根因分析的因果推理引擎
网络·人工智能·运维开发
sc.溯琛2 小时前
计算机网络试题分类及解析文档
网络
longvoyage2 小时前
MindSpore社区活动:在对抗中增强网络
网络·人工智能·深度学习
huangyuchi.2 小时前
【Linux 网络】理解并应用应用层协议:HTTP(附简单HTTP服务器C++代码)
linux·服务器·网络·网络协议·http·c/c++
AI即插即用2 小时前
即插即用系列 | MICCAI EM-Net:融合 Mamba 与频域学习的高效 3D 医学图像分割网络
网络·人工智能·深度学习·神经网络·学习·计算机视觉·视觉检测
捧 花2 小时前
Go Web 中 WebSocket 原理与实战详解
网络·后端·websocket·网络协议·http·golang·web
编程乐学(Arfan开发工程师)2 小时前
渗透测试基础详解:通往 CISP-PTE 的第一步
网络·安全·web安全