交换机跨VLAN交换数据ip跳转分析(不一定对)

在网上看到这样一个实验:

交换机1、交换机2分别连接到一台防火墙上,要求使VLAN 2、VLAN3、VLAN5、VLAN6中的终端可互相访问。

拓补

参考链接

【数通网络交换基础梳理2】三层设备、网关、ARP表、VLAN、路由表及跨网段路由下一跳转发原理_网管型交的机为什么会有路由表-CSDN博客

交换机及防火墙配置

交换机1

vlan batch 2 3 192 ##创建Vlan

int g 0/0/3 ##进入接口模式

port link-type access ##配置接口类型,终端一般为access

port default vlan 2 ##配置vlan

quit ##退出接口模式

int g 0/0/1

port link-type access

port default vlan 2

quit

int g 0/0/2

port link-type access

port default vlan 3

quit

int g 0/0/4

port link-type access

port default vlan 3

quit

int vlanif 2 ##进入vlan2虚拟子接口

ip address 192.168.1.3 24 ##配置子接口地址

quit

int vlanif 3

ip address 172.16.3.3 24

quit

int vlanif 192

ip address 192.168.3.2

quit

int g0/0/5

port link-type access

port default vlan 192

quit

ip route-static 172.16.30.0 24 192.168.3.1

ip route-static 172.16.29.0 24 192.168.3.1

交换机2

vlan batch 2 3 193 ##创建Vlan

int g 0/0/2 ##进入接口模式

port link-type access ##配置接口类型,终端一般为access

port default vlan 6 ##配置vlan

quit ##退出接口模式

int g 0/0/3

port link-type access

port default vlan 6

quit

int g 0/0/4

port link-type access

port default vlan 5

quit

int g 0/0/5

port link-type access

port default vlan 5

quit

int vlanif 6 ##进入vlan2虚拟子接口

ip address 172.16.30.1 24 ##配置子接口地址

quit

int vlanif 5

ip address 172.16.29.1 24

quit

int vlanif 193

ip address 192.168.2.2

quit

int g0/0/1

port link-type access

port default vlan 193

quit

ip route-static 192.168.1.0 24 192.168.2.1

ip route-static 172.16.3.0 24 192.168.2.1

防火墙

vlan batch 192 193

int vlanif 192 ##进入vlan2虚拟子接口

ip address 192.168.3.1 ##配置子接口地址

quit

int vlanif 193

ip address 192.168.2.1

quit

int e0/0/1

port link-type access

port default vlan 193

quit

int e0/0/0

port link-type access

port default vlan 192

quit

ip route-static 192.168.1.0 24 192.168.3.2

ip route-static 172.16.3.0 24 192.168.3.2

ip route-static 172.16.30.0 24 192.168.2.2

ip route-static 172.16.29.0 24 192.168.2.2

结果是各个VLAN之间是可以ping通的;

IP交换过程分析

相关推荐
u01090535935 分钟前
黑群晖安装教程
网络
IPFoxy6662 小时前
在线安全干货|如何更改IP地址?
网络
古猫先生2 小时前
YMTC Xtacking 4.0(Gen5)技术深度分析
服务器·人工智能·科技·云计算
青年有志3 小时前
Web 服务器介绍 | 通过 Tomcat 说明其作用
服务器·前端·tomcat
二进制杯莫停3 小时前
k8s pod网络故障注入,命令行实现
网络·容器·kubernetes
hgdlip3 小时前
电脑ip地址怎么换地区:操作步骤与利弊分析
网络·电脑·ip地址
域智盾系统3 小时前
电脑USB端口禁止软件有哪些?什么软件能指定USB端口禁用?分享四款好用软件!
网络·电脑
一个很帅的帅哥4 小时前
axios(基于Promise的HTTP客户端) 与 `async` 和 `await` 结合使用
javascript·网络·网络协议·http·async·promise·await
学习3人组4 小时前
集群服务器主机实现主机名与IP绑定
运维·服务器·tcp/ip
做人求其滴4 小时前
信安 实验1 用Wireshark分析典型TCP/IP体系中的协议
tcp/ip·wireshark