配置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


相关推荐
liulilittle2 小时前
C++ TAP(基于任务的异步编程模式)
服务器·开发语言·网络·c++·分布式·任务·tap
guts°6 小时前
17-VRRP
网络·智能路由器
Jewel Q6 小时前
动态路由协议基础
网络·智能路由器
宇称不守恒4.07 小时前
2025暑期—06神经网络-常见网络2
网络·人工智能·神经网络
Dreams_l7 小时前
网络编程2(应用层协议,传输层协议)
运维·服务器·网络
数据与人工智能律师7 小时前
数字迷雾中的安全锚点:解码匿名化与假名化的法律边界与商业价值
大数据·网络·人工智能·云计算·区块链
先知后行。7 小时前
网络协议HTTP、TCP(草稿)
网络·网络协议
xzkyd outpaper7 小时前
QUIC协议如何在UDP基础上解决网络切换问题
网络·计算机网络·udp·quic
碳酸的唐8 小时前
Inception网络架构:深度学习视觉模型的里程碑
网络·深度学习·架构
Jewel Q8 小时前
VRRP技术
网络·智能路由器