交换机跨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交换过程分析

相关推荐
天宇&嘘月3 小时前
Nginx的https搭建
网络·nginx·https
_星辰大海乀4 小时前
IP 协议
服务器·网络·tcp/ip·nat·子网掩码·ip协议
屿行屿行4 小时前
【Linux】Socket编程(基于实际工程分析)
linux·服务器·网络
runepic4 小时前
Python + PostgreSQL 批量图片分发脚本:分类、去重、断点续拷贝
服务器·数据库·python·postgresql
Evan芙4 小时前
Rocky Linux 9 网卡改名及静态IP地址配置完整步骤
linux·网络·智能路由器
企鹅侠客5 小时前
Linux性能调优 详解磁盘工作流程及性能指标
linux·运维·服务器·性能调优
企鹅侠客5 小时前
Linux性能调优 再谈磁盘性能指标和进程级IO
linux·运维·服务器·性能调优
虚伪的空想家6 小时前
云镜像,虚拟机镜像怎么转换成容器镜像
服务器·docker·容器·k8s·镜像·云镜像·虚机
不过普通话一乙不改名6 小时前
Linux 网络收包的进阶之路:从普通 socket 到 AF_XDP 零拷贝
linux·运维·网络
在路上@Amos6 小时前
Linux 命令行查看 串口hex数据
linux·运维·服务器