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

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-25 20:56:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-25 20:56:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-25 20:56:01       82 阅读
  4. Python语言-面向对象

    2024-01-25 20:56:01       91 阅读

热门阅读

  1. go语言下划线、变量和常量

    2024-01-25 20:56:01       70 阅读
  2. 第二章第16节:Excel时间序列类函数 9大时间函数

    2024-01-25 20:56:01       51 阅读
  3. 我的创作纪念日

    2024-01-25 20:56:01       56 阅读
  4. 7. Spring Boot 与MyBatis集成

    2024-01-25 20:56:01       62 阅读
  5. 强化学习 - Q-learning(Q学习)

    2024-01-25 20:56:01       61 阅读
  6. 深入剖析C语言中的神秘字符——NULL

    2024-01-25 20:56:01       64 阅读
  7. Docker容器化运行Oracle 19c数据库

    2024-01-25 20:56:01       63 阅读
  8. torchsummary库的使用

    2024-01-25 20:56:01       64 阅读
  9. 数据结构编程题:Phone List

    2024-01-25 20:56:01       60 阅读
  10. python学习笔记11(程序跳转语句、空语句)

    2024-01-25 20:56:01       65 阅读