eNSP小实验(vlan和单臂路由)

2023-12-13 21:04
文章标签 路由 实验 ensp vlan 单臂

本文主要是介绍eNSP小实验(vlan和单臂路由),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

一.vlan的划分

实验目的:

①pc1 只可以和pc2通信,不可以和pc3 pc4通信

②pc1和pc2只能到Server1,pc3和pc4到Server2

1.拓扑图

2.配置

PC1-4 同理配置

SW1 

<Huawei>
<Huawei>u t m                      //关闭注释
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys	
[Huawei]sysname SW1                //改名
[SW1]vlan bat	 
[SW1]vlan batch 10 20              //一次性建立vlan 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]int e0/0/1
[SW1-Ethernet0/0/1]p	
[SW1-Ethernet0/0/1]port l	
[SW1-Ethernet0/0/1]port link-t	
[SW1-Ethernet0/0/1]port link-type ac	
[SW1-Ethernet0/0/1]port link-type access    
[SW1-Ethernet0/0/1]p	
[SW1-Ethernet0/0/1]port de	
[SW1-Ethernet0/0/1]port default v	
[SW1-Ethernet0/0/1]port default vlan 10     //选择端口类型,将端口加入到vlan中
[SW1-Ethernet0/0/1]int e0/0/2
[SW1-Ethernet0/0/2]p	
[SW1-Ethernet0/0/2]port l	
[SW1-Ethernet0/0/2]port link-t	
[SW1-Ethernet0/0/2]port link-type ac	
[SW1-Ethernet0/0/2]port link-type access 
[SW1-Ethernet0/0/2]p	
[SW1-Ethernet0/0/2]port de	
[SW1-Ethernet0/0/2]port default v	
[SW1-Ethernet0/0/2]port default vlan 10
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]p	
[SW1-Ethernet0/0/3]port l	
[SW1-Ethernet0/0/3]port link-t	
[SW1-Ethernet0/0/3]port link-type ac	
[SW1-Ethernet0/0/3]port link-type access 
[SW1-Ethernet0/0/3]p	
[SW1-Ethernet0/0/3]port de	
[SW1-Ethernet0/0/3]port default vl	
[SW1-Ethernet0/0/3]port default vlan 20
[SW1-Ethernet0/0/3]int e0/0/4
[SW1-Ethernet0/0/4]p	
[SW1-Ethernet0/0/4]port l	
[SW1-Ethernet0/0/4]port link-t	
[SW1-Ethernet0/0/4]port link-type  ac	
[SW1-Ethernet0/0/4]port link-type  access 
[SW1-Ethernet0/0/4]p	
[SW1-Ethernet0/0/4]port de	
[SW1-Ethernet0/0/4]port default vl	
[SW1-Ethernet0/0/4]port default vlan 20
[SW1]int e0/0/5
[SW1-Ethernet0/0/5]p	
[SW1-Ethernet0/0/5]port l	
[SW1-Ethernet0/0/5]port link-t	
[SW1-Ethernet0/0/5]port link-type t	
[SW1-Ethernet0/0/5]port link-type trunk 
[SW1-Ethernet0/0/5]p	
[SW1-Ethernet0/0/5]port t	
[SW1-Ethernet0/0/5]port trunk al	
[SW1-Ethernet0/0/5]port trunk allow-pass v	
[SW1-Ethernet0/0/5]port trunk allow-pass vlan a	
[SW1-Ethernet0/0/5]port trunk allow-pass vlan all 
[SW1-Ethernet0/0/5]

SW2

<Huawei>
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys 	
[Huawei]sysname SW2
[SW2]vlan bat	
[SW2]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2]int e0/0/1
[SW2-Ethernet0/0/1]p	
[SW2-Ethernet0/0/1]port l	
[SW2-Ethernet0/0/1]port link-t	
[SW2-Ethernet0/0/1]port link-type t	
[SW2-Ethernet0/0/1]port link-type trunk 
[SW2-Ethernet0/0/1]p	
[SW2-Ethernet0/0/1]port t	
[SW2-Ethernet0/0/1]port trunk a	
[SW2-Ethernet0/0/1]port trunk allow-pass v	
[SW2-Ethernet0/0/1]port trunk allow-pass vlan a	
[SW2-Ethernet0/0/1]port trunk allow-pass vlan all 
[SW2-Ethernet0/0/1]int e0/0/2
[SW2-Ethernet0/0/2]p	
[SW2-Ethernet0/0/2]port l	
[SW2-Ethernet0/0/2]port link-t	
[SW2-Ethernet0/0/2]port link-type a	
[SW2-Ethernet0/0/2]port link-type access 
[SW2-Ethernet0/0/2]p	
[SW2-Ethernet0/0/2]port de	
[SW2-Ethernet0/0/2]port default v	
[SW2-Ethernet0/0/2]port default vlan 10
[SW2-Ethernet0/0/2]int e0/0/3
[SW2-Ethernet0/0/3]p	
[SW2-Ethernet0/0/3]port l	
[SW2-Ethernet0/0/3]port link-t	
[SW2-Ethernet0/0/3]port link-type a	
[SW2-Ethernet0/0/3]port link-type access 
[SW2-Ethernet0/0/3]p	
[SW2-Ethernet0/0/3]port de	
[SW2-Ethernet0/0/3]port default v	
[SW2-Ethernet0/0/3]port default vlan 20
[SW2-Ethernet0/0/3]

Server1配置IP地址,配置好一定点保存  Server2同理

3.测试

Server1--->PC1  成功

Server2-----PC3  成功

Server1---->PC3 失败

二.单臂路由

实验目的:实现不同网段间的通信

1.拓扑图

2.配置

PC1配置IP地址,子网掩码,网关    PC2同理

SW1

<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys	
[Huawei]sysname SW1
[SW1]vla	
[SW1]vlan  ba	
[SW1]vlan  batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]p	
[SW1-GigabitEthernet0/0/1]port l	
[SW1-GigabitEthernet0/0/1]port link-t	
[SW1-GigabitEthernet0/0/1]port link-type a	
[SW1-GigabitEthernet0/0/1]port link-type access 
[SW1-GigabitEthernet0/0/1]p	
[SW1-GigabitEthernet0/0/1]port d	
[SW1-GigabitEthernet0/0/1]port default v	
[SW1-GigabitEthernet0/0/1]port default vlan 10
[SW1-GigabitEthernet0/0/1]int g0/0/2
[SW1-GigabitEthernet0/0/2]p	
[SW1-GigabitEthernet0/0/2]port l	
[SW1-GigabitEthernet0/0/2]port link-t	
[SW1-GigabitEthernet0/0/2]port link-type a	
[SW1-GigabitEthernet0/0/2]port link-type access 
[SW1-GigabitEthernet0/0/2]p	
[SW1-GigabitEthernet0/0/2]port de	
[SW1-GigabitEthernet0/0/2]port default v	
[SW1-GigabitEthernet0/0/2]port default vlan 20
[SW1-GigabitEthernet0/0/2]int g0/0/3
[SW1-GigabitEthernet0/0/3]p	
[SW1-GigabitEthernet0/0/3]port l	
[SW1-GigabitEthernet0/0/3]port link-t	
[SW1-GigabitEthernet0/0/3]port link-type t	
[SW1-GigabitEthernet0/0/3]port link-type trunk 
[SW1-GigabitEthernet0/0/3]p	
[SW1-GigabitEthernet0/0/3]port t	
[SW1-GigabitEthernet0/0/3]port trunk a	
[SW1-GigabitEthernet0/0/3]port trunk allow-pass v	
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan a	
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan all 
[SW1-GigabitEthernet0/0/3]

R1

<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]int g0/0/0.10
[R1-GigabitEthernet0/0/0.10]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0.10]do	
[R1-GigabitEthernet0/0/0.10]dot1q ter	
[R1-GigabitEthernet0/0/0.10]dot1q termination vi	
[R1-GigabitEthernet0/0/0.10]dot1q termination vid 10    //在子接口上,做vlan10
[R1-GigabitEthernet0/0/0.10]ar	
[R1-GigabitEthernet0/0/0.10]arp br	
[R1-GigabitEthernet0/0/0.10]arp broadcast en	
[R1-GigabitEthernet0/0/0.10]arp broadcast enable    //开启arp广播
[R1-GigabitEthernet0/0/0.10]int g0/0/0.20
[R1-GigabitEthernet0/0/0.20]ip add 192.168.2.254 24
[R1-GigabitEthernet0/0/0.20]do	
[R1-GigabitEthernet0/0/0.20]dot1q ter	
[R1-GigabitEthernet0/0/0.20]dot1q termination vi	
[R1-GigabitEthernet0/0/0.20]dot1q termination vid 20       //在子接口上,做vlan20
[R1-GigabitEthernet0/0/0.20]ar	
[R1-GigabitEthernet0/0/0.20]arp br	
[R1-GigabitEthernet0/0/0.20]arp broadcast en	
[R1-GigabitEthernet0/0/0.20]arp broadcast enable 
[R1-GigabitEthernet0/0/0.20]

3.测试

PC1----->PC2  成功

三:组合

1.拓扑图

2.配置

SW3

<Huawei>
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys	
[Huawei]sysname SW3
[SW3]vlan ba	
[SW3]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3]int g0/0/1
[SW3-GigabitEthernet0/0/1]p	
[SW3-GigabitEthernet0/0/1]port l	
[SW3-GigabitEthernet0/0/1]port link-t	
[SW3-GigabitEthernet0/0/1]port link-type a	
[SW3-GigabitEthernet0/0/1]port link-type access 
[SW3-GigabitEthernet0/0/1]p	
[SW3-GigabitEthernet0/0/1]port de	
[SW3-GigabitEthernet0/0/1]port default vlan 10
[SW3-GigabitEthernet0/0/1]int g0/0/2
[SW3-GigabitEthernet0/0/2]p	
[SW3-GigabitEthernet0/0/2]port l	
[SW3-GigabitEthernet0/0/2]port link-t	
[SW3-GigabitEthernet0/0/2]port link-type a	
[SW3-GigabitEthernet0/0/2]port link-type access 
[SW3-GigabitEthernet0/0/2]p	
[SW3-GigabitEthernet0/0/2]port de	
[SW3-GigabitEthernet0/0/2]port default v	
[SW3-GigabitEthernet0/0/2]port default vlan 10
[SW3-GigabitEthernet0/0/2]
[SW3-GigabitEthernet0/0/2]int g0/0/3
[SW3-GigabitEthernet0/0/3]p	
[SW3-GigabitEthernet0/0/3]port l	
[SW3-GigabitEthernet0/0/3]port link-t	
[SW3-GigabitEthernet0/0/3]port link-type a	
[SW3-GigabitEthernet0/0/3]port link-type access 
[SW3-GigabitEthernet0/0/3]p	
[SW3-GigabitEthernet0/0/3]port de	
[SW3-GigabitEthernet0/0/3]port default v	
[SW3-GigabitEthernet0/0/3]port default vlan 20
[SW3-GigabitEthernet0/0/3]int g0/0/4
[SW3-GigabitEthernet0/0/4]p	
[SW3-GigabitEthernet0/0/4]port l	
[SW3-GigabitEthernet0/0/4]port link-t	
[SW3-GigabitEthernet0/0/4]port link-type a	
[SW3-GigabitEthernet0/0/4]port link-type access 
[SW3-GigabitEthernet0/0/4]p	
[SW3-GigabitEthernet0/0/4]port de	
[SW3-GigabitEthernet0/0/4]port default vlan 20
[SW3-GigabitEthernet0/0/4]int g0/0/5
[SW3-GigabitEthernet0/0/5]p	
[SW3-GigabitEthernet0/0/5]port l	
[SW3-GigabitEthernet0/0/5]port li	
[SW3-GigabitEthernet0/0/5]port link-t	
[SW3-GigabitEthernet0/0/5]port link-type t	
[SW3-GigabitEthernet0/0/5]port link-type trunk 
[SW3-GigabitEthernet0/0/5]p	
[SW3-GigabitEthernet0/0/5]port t	
[SW3-GigabitEthernet0/0/5]port trunk a	
[SW3-GigabitEthernet0/0/5]port trunk allow-pass v	
[SW3-GigabitEthernet0/0/5]port trunk allow-pass vlan a	
[SW3-GigabitEthernet0/0/5]port trunk allow-pass vlan all 
[SW3-GigabitEthernet0/0/5]q
[SW3]

SW4

<Huawei>
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys	
[Huawei]sysname  R4
[R4]v	
[R4]vlan bat	
[R4]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]p	
[R4-GigabitEthernet0/0/1]port l	
[R4-GigabitEthernet0/0/1]port link-t	
[R4-GigabitEthernet0/0/1]port link-type t	
[R4-GigabitEthernet0/0/1]port link-type trunk 
[R4-GigabitEthernet0/0/1]p	
[R4-GigabitEthernet0/0/1]port t	
[R4-GigabitEthernet0/0/1]port trunk a	
[R4-GigabitEthernet0/0/1]port trunk allow-pass  v	
[R4-GigabitEthernet0/0/1]port trunk allow-pass  vlan a	
[R4-GigabitEthernet0/0/1]port trunk allow-pass  vlan all 
[R4-GigabitEthernet0/0/1]int g0/0/2
[R4-GigabitEthernet0/0/2]p	
[R4-GigabitEthernet0/0/2]port l	
[R4-GigabitEthernet0/0/2]port link-t	
[R4-GigabitEthernet0/0/2]port link-type a	
[R4-GigabitEthernet0/0/2]port link-type access 
[R4-GigabitEthernet0/0/2]p	
[R4-GigabitEthernet0/0/2]port de	
[R4-GigabitEthernet0/0/2]port default v	
[R4-GigabitEthernet0/0/2]port default vlan 10
[R4-GigabitEthernet0/0/2]int g0/0/3
[R4-GigabitEthernet0/0/3]port link-type access
[R4-GigabitEthernet0/0/3]port default vlan 20
[R4-GigabitEthernet0/0/3]int g0/0/4
[R4-GigabitEthernet0/0/4]p	
[R4-GigabitEthernet0/0/4]port l	
[R4-GigabitEthernet0/0/4]port link--	
[R4-GigabitEthernet0/0/4]port link-t	
[R4-GigabitEthernet0/0/4]port link-type t	
[R4-GigabitEthernet0/0/4]port link-type trunk 
[R4-GigabitEthernet0/0/4]p	
[R4-GigabitEthernet0/0/4]port t	
[R4-GigabitEthernet0/0/4]port trunk a	
[R4-GigabitEthernet0/0/4]port trunk allow-pass  v	
[R4-GigabitEthernet0/0/4]port trunk allow-pass  vlan a	
[R4-GigabitEthernet0/0/4]port trunk allow-pass  vlan all 
[R4-GigabitEthernet0/0/4]
[R4-GigabitEthernet0/0/4]
[R4-GigabitEthernet0/0/4]q
[R4]

R1

<Huawei>
<Huawei>u t m
Info: Current terminal monitor is off.
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys	
[Huawei]sysname R1
[R1]int g0/0/0.10
[R1-GigabitEthernet0/0/0.10]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0.10]d	
[R1-GigabitEthernet0/0/0.10]do	
[R1-GigabitEthernet0/0/0.10]dot1q  ter	
[R1-GigabitEthernet0/0/0.10]dot1q  termination vi	
[R1-GigabitEthernet0/0/0.10]dot1q  termination vid 10
[R1-GigabitEthernet0/0/0.10]ar	
[R1-GigabitEthernet0/0/0.10]arp br	
[R1-GigabitEthernet0/0/0.10]arp broadcast en	
[R1-GigabitEthernet0/0/0.10]arp broadcast enable 
[R1-GigabitEthernet0/0/0.10]int g0/0/0.20
[R1-GigabitEthernet0/0/0.20]ip add 192.168.2.254 24
[R1-GigabitEthernet0/0/0.20]do	
[R1-GigabitEthernet0/0/0.20]dot1q ter	
[R1-GigabitEthernet0/0/0.20]dot1q termination vid 20
[R1-GigabitEthernet0/0/0.20]arp bro	
[R1-GigabitEthernet0/0/0.20]arp broadcast en	
[R1-GigabitEthernet0/0/0.20]arp broadcast enable 
[R1-GigabitEthernet0/0/0.20]

3.测试

Server1---->PC3

PC1---->PC4

这篇关于eNSP小实验(vlan和单臂路由)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/489954

相关文章

SpringIntegration消息路由之Router的条件路由与过滤功能

《SpringIntegration消息路由之Router的条件路由与过滤功能》本文详细介绍了Router的基础概念、条件路由实现、基于消息头的路由、动态路由与路由表、消息过滤与选择性路由以及错误处理... 目录引言一、Router基础概念二、条件路由实现三、基于消息头的路由四、动态路由与路由表五、消息过滤

Go路由注册方法详解

《Go路由注册方法详解》Go语言中,http.NewServeMux()和http.HandleFunc()是两种不同的路由注册方式,前者创建独立的ServeMux实例,适合模块化和分层路由,灵活性高... 目录Go路由注册方法1. 路由注册的方式2. 路由器的独立性3. 灵活性4. 启动服务器的方式5.

关于Gateway路由匹配规则解读

《关于Gateway路由匹配规则解读》本文详细介绍了SpringCloudGateway的路由匹配规则,包括基本概念、常用属性、实际应用以及注意事项,路由匹配规则决定了请求如何被转发到目标服务,是Ga... 目录Gateway路由匹配规则一、基本概念二、常用属性三、实际应用四、注意事项总结Gateway路由

STM32(十一):ADC数模转换器实验

AD单通道: 1.RCC开启GPIO和ADC时钟。配置ADCCLK分频器。 2.配置GPIO,把GPIO配置成模拟输入的模式。 3.配置多路开关,把左面通道接入到右面规则组列表里。 4.配置ADC转换器, 包括AD转换器和AD数据寄存器。单次转换,连续转换;扫描、非扫描;有几个通道,触发源是什么,数据对齐是左对齐还是右对齐。 5.ADC_CMD 开启ADC。 void RCC_AD

网络学习-eNSP配置NAT

NAT实现内网和外网互通 #给路由器接口设置IP地址模拟实验环境<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]undo info-center enableInfo: Information center is disabled.[Huawei]interface gigabit

HNU-2023电路与电子学-实验3

写在前面: 一、实验目的 1.了解简易模型机的内部结构和工作原理。 2.分析模型机的功能,设计 8 重 3-1 多路复用器。 3.分析模型机的功能,设计 8 重 2-1 多路复用器。 4.分析模型机的工作原理,设计模型机控制信号产生逻辑。 二、实验内容 1.用 VERILOG 语言设计模型机的 8 重 3-1 多路复用器; 2.用 VERILOG 语言设计模型机的 8 重 2-1 多

网络学习-eNSP配置ACL

AR1路由器配置 <Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]undo info-center enableInfo: Information center is disabled.[Huawei]interface gigabitethernet 0/0/0[Huawei-G

【vue3|第28期】 Vue3 + Vue Router:探索路由重定向的使用与作用

日期:2024年9月8日 作者:Commas 签名:(ง •_•)ง 积跬步以致千里,积小流以成江海…… 注释:如果您觉在这里插入代码片得有所帮助,帮忙点个赞,也可以关注我,我们一起成长;如果有不对的地方,还望各位大佬不吝赐教,谢谢^ - ^ 1.01365 = 37.7834;0.99365 = 0.0255 1.02365 = 1377.4083;0.98365 = 0.0006 说

61.以太网数据回环实验(4)以太网数据收发器发送模块

(1)状态转移图: (2)IP数据包格式: (3)UDP数据包格式: (4)以太网发送模块代码: module udp_tx(input wire gmii_txc ,input wire reset_n ,input wire tx_start_en , //以太网开始发送信

LTspice模拟CCM和DCM模式的BUCK电路实验及参数计算

关于BUCK电路的原理可以参考硬件工程师炼成之路写的《 手撕Buck!Buck公式推导过程》.实验内容是将12V~5V的Buck电路仿真,要求纹波电压小于15mv. CCM和DCM的区别: CCM:在一个开关周期内,电感电流从不会到0. DCM:在开关周期内,电感电流总会到0. CCM模式Buck电路仿真: 在用LTspice模拟CCM电路时,MOS管驱动信号频率为100Khz,负载为10R(可自