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

相关推荐
白帽黑客沐瑶2 天前
【网络安全就业】信息安全专业的就业前景(非常详细)零基础入门到精通,收藏这篇就够了
网络·安全·web安全·计算机·程序员·编程·网络安全就业
christine-rr2 天前
linux常用命令(4)——压缩命令
linux·服务器·redis
東雪蓮☆2 天前
深入理解 LVS-DR 模式与 Keepalived 高可用集群
linux·运维·服务器·lvs
树码小子2 天前
Java网络编程:(socket API编程:TCP协议的 socket API -- 回显程序的服务器端程序的编写)
java·网络·tcp/ip
乌萨奇也要立志学C++2 天前
【Linux】进程概念(二):进程查看与 fork 初探
linux·运维·服务器
绿箭柠檬茶2 天前
Ubuntu 服务器配置转发网络访问
服务器·网络·ubuntu
real 12 天前
传输层协议UDP
网络·网络协议·udp
獭.獭.2 天前
Linux -- 信号【上】
linux·运维·服务器
路由侠内网穿透2 天前
本地部署 GPS 跟踪系统 Traccar 并实现外部访问
运维·服务器·网络·windows·tcp/ip
ZERO_pan2 天前
服务器装机遇到的问题
运维·服务器