网络学习-eNSP配置路由器

news2024/9/19 9:33:34

在这里插入图片描述

#PC1网关:192.168.1.254
#PC3网关:192.168.3.254
#PC4网关:192.168.4.254
# 注:路由器接口必须配置不同网段IP地址
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
#给路由器两个接口配置IP地址
[Huawei]interface gigabitethernet 0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.254 24
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]interface gigabitethernet 0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.2.1 24
# 显示IP配置信息
[Huawei-GigabitEthernet0/0/1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.254/24     up         up        
GigabitEthernet0/0/1              192.168.2.1/24       up         up        
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s)
#取消IP地址配置
[Huawei-GigabitEthernet0/0/1]undo ip address
[Huawei-GigabitEthernet0/0/1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.254/24     up         up        
GigabitEthernet0/0/1              unassigned           up         down      
GigabitEthernet0/0/2              unassigned           down       down      
NULL0                             unassigned           up         up(s) 
# 网关:设备通往另外一个网段的途径,一般由路由器承担
# 路由器基于路由表转发数据
###
1.直连路由:由设备配置好IP并开启接口后自动产生
2.静态路由:由管理员手工配置,添加所需网段路由 ip route-static dest mask next-hop
3.动态路由:宣告
4.默认路由:特殊静态路由,通常用于访问外部网络  ip route-static 0.0.0.0 0 next-hop
###
# 查看路由表信息
[Huawei]display ip routing-table | include /24                  #过滤显示24位的路径表信息
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public         Destinations : 10       Routes : 10       
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
#去向1网段的数据从GigabitEthernet0/0/0传输
192.168.1.0/24  Direct  0    0           D   192.168.1.254   GigabitEthernet0/0/0
#去向2网段的数据从GigabitEthernet0/0/1传输
192.168.2.0/24  Direct  0    0           D   192.168.2.1     GigabitEthernet0/0/1
# 配置静态路由--192.168.1.0为要到达的网段地址,24为掩码,192.168.2.1为下一跳地址
[Huawei]ip route-static 192.168.1.0 24 192.168.2.1
[Huawei]display ip routing-table | include /24
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 14       Routes : 14       
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
192.168.1.0/24  Static  60   0          RD   192.168.2.1     GigabitEthernet0/0/1
192.168.2.0/24  Direct  0    0           D   192.168.2.2     GigabitEthernet0/0/1
192.168.3.0/24  Direct  0    0           D   192.168.3.254   GigabitEthernet0/0/0
192.168.4.0/24  Direct  0    0           D   192.168.4.254   GigabitEthernet0/0/2

在这里插入图片描述

接入交换机配置
#接入交换机配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
# 批量创建vlan
[Huawei]vlan batch 2 3
Info: This operation may take a few seconds. Please wait for a moment...done.
# 配置0/0/2和0/0/3口为接入链路,放行相应vlan数据
[Huawei]interface ethernet 0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 2
[Huawei-Ethernet0/0/2]quit
[Huawei]interface ethernet 0/0/3
[Huawei-Ethernet0/0/3]port link-type access
[Huawei-Ethernet0/0/3]port default vlan 3
[Huawei-Ethernet0/0/3]quit
# 配置0/0/4口为中继链路,放行所有vlan数据                   
[Huawei]interface ethernet 0/0/4
[Huawei-Ethernet0/0/4]port link-type trunk
[Huawei-Ethernet0/0/4]port trunk allow-pass vlan all
[Huawei-Ethernet0/0/4]quit
[Huawei]display vlan
The total number of vlans is : 3
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------
VID  Type    Ports                                                          
--------------------------------------------------------------------------------
1    common  UT:Eth0/0/1(U)     Eth0/0/4(U)     Eth0/0/5(D)     Eth0/0/6(D)     
                Eth0/0/7(D)     Eth0/0/8(D)     Eth0/0/9(D)     Eth0/0/10(D)    
                Eth0/0/11(D)    Eth0/0/12(D)    Eth0/0/13(D)    Eth0/0/14(D)    
                Eth0/0/15(D)    Eth0/0/16(D)    Eth0/0/17(D)    Eth0/0/18(D)    
                Eth0/0/19(D)    Eth0/0/20(D)    Eth0/0/21(D)    Eth0/0/22(D)    
                GE0/0/1(D)      GE0/0/2(D)                                      
2    common  UT:Eth0/0/2(U)                                                     
             TG:Eth0/0/4(U)                                                     
3    common  UT:Eth0/0/3(U)                                                     
             TG:Eth0/0/4(U)                                                     
VID  Status  Property      MAC-LRN Statistics Description      
--------------------------------------------------------------------------------
1    enable  default       enable  disable    VLAN 0001                         
2    enable  default       enable  disable    VLAN 0002                         
3    enable  default       enable  disable    VLAN 0003 
核心交换机配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
# 批量创建vlan
[Huawei]vlan batch 2 to 4
Info: This operation may take a few seconds. Please wait for a moment...done.
#对虚拟端口vlan1-4设置ip地址
[Huawei]interface vlanif 1
[Huawei-Vlanif1]ip address 192.168.1.254 24
[Huawei-Vlanif1]quit
[Huawei]interface vlanif 2
[Huawei-Vlanif2]ip address 192.168.2.254 24
[Huawei-Vlanif2]quit
[Huawei]interface vlanif 3
[Huawei-Vlanif3]ip address 192.168.3.254 24
[Huawei-Vlanif3]quit
[Huawei]interface vlanif 4
[Huawei-Vlanif4]ip address 192.168.4.254 24
[Huawei-Vlanif4]quit
[Huawei]interface gigabitethernet 0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type trunk
[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[Huawei]interface gigabitethernet 0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 4
[Huawei]display ip routing-table | include /24
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public         Destinations : 10       Routes : 10       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    192.168.1.0/24  Direct  0    0           D   192.168.1.254   Vlanif1
    192.168.2.0/24  Direct  0    0           D   192.168.2.254   Vlanif2
    192.168.3.0/24  Direct  0    0           D   192.168.3.254   Vlanif3
    192.168.4.0/24  Direct  0    0           D   192.168.4.254   Vlanif4
[Huawei]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
MEth0/0/1                         unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Vlanif1                           192.168.1.254/24     up         up        
Vlanif2                           192.168.2.254/24     up         up        
Vlanif3                           192.168.3.254/24     up         up        
Vlanif4                           192.168.4.254/24     up         up        
#配置动态路由
[Huawei]ospf
#定义一个区域
[Huawei-ospf-1]area 0
#宣告自身直连的网段,配置时使用反掩码
[Huawei-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255            
[Huawei-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255

路由器配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]interface gigabitethernet 0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.4.1 24
[Huawei-GigabitEthernet0/0/0]quit
[Huawei]interface gigabitethernet 0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.5.254 24
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]display ip routing-table | include /24
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public         Destinations : 10       Routes : 10       
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
192.168.4.0/24  Direct  0    0           D   192.168.4.1     GigabitEthernet0/0/0
192.168.5.0/24  Direct  0    0           D   192.168.5.254   GigabitEthernet0/0/1
#配置动态路由
[Huawei]ospf
[Huawei-ospf-1]area 0
#宣告自身直连的网段,配置时使用反掩码
[Huawei-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
[Huawei-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
#查看当前配置信息
[Huawei-ospf-1]display this
[V200R003C00]
#
ospf 1 
 area 0.0.0.0 
  network 192.168.4.0 0.0.0.255 
  network 192.168.5.0 0.0.0.255 
#

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2114870.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【Kubernetes】K8s 的安全框架和用户认证

K8s 的安全框架和用户认证 1.Kubernetes 的安全框架1.1 认证&#xff1a;Authentication1.2 鉴权&#xff1a;Authorization1.3 准入控制&#xff1a;Admission Control 2.Kubernetes 的用户认证2.1 Kubernetes 的用户认证方式2.2 配置 Kubernetes 集群使用密码认证 Kubernetes…

基于springboot+vue+uniapp的“共享书角”图书借还管理系统小程序

开发语言&#xff1a;Java框架&#xff1a;springbootuniappJDK版本&#xff1a;JDK1.8服务器&#xff1a;tomcat7数据库&#xff1a;mysql 5.7&#xff08;一定要5.7版本&#xff09;数据库工具&#xff1a;Navicat11开发软件&#xff1a;eclipse/myeclipse/ideaMaven包&#…

天翼云存储资源盘活系统 HBlock:企业级轻量存储的革新与实战

目录 前言关于HBlock系统HBlock的核心优势番外篇&#xff1a;HBlock应用场景结束语参考文献 前言 在数字化转型的浪潮中&#xff0c;数据存储作为支撑企业业务连续性和数据安全的基石&#xff0c;企业对于存储资源的需求日益增长&#xff0c;同时也面临着成本控制和资源优化的…

常见监督学习算法学习总结。

目录 一、K临近算法 二、决策树 三、多层感知器 四、伯努利贝叶斯算法 五、高斯贝叶斯 一、K临近算法 K 临近算法&#xff08;K-Nearest Neighbors&#xff0c;简称 KNN&#xff09;是一种监督学习算法&#xff0c;用于分类和回归任务。 它通过计算样本之间的距离来进行…

前端开发中遇到的小问题以及解决方案记录2

1、H5中适配屏幕的工具-postcss-px-to-viewport postcss-px-to-viewport。因为设计稿一般给的都是375px宽度的&#xff0c;所以假如一个字体是16px&#xff0c;那么在开发中不能直接写死为16px&#xff0c;因为各个厂商的手机屏幕大小是不同的&#xff0c;所以要根据屏幕大小去…

一款支持同一个屏幕界面同时播放多个视频的视频播放软件

GridPlayer 是一款基于 VLC 的免费开源跨平台多视频同步播放工具&#xff0c;支持在一块屏幕上同时播放多个视频。其主要功能包括&#xff1a; 多视频播放&#xff1a;用户可以在一个窗口中同时播放任意数量的视频&#xff0c;数量仅受硬件性能限制。支持多种格式和流媒体&…

半年高达552亿元,锁定云第一,中国电信天翼云紧追不舍

【科技明说 &#xff5c; 科技热点关注】 刚才我注意到中国电信公布2024年中期业绩&#xff0c;报告期内&#xff0c;中国电信实现营业收入为人民币2660亿元&#xff0c;同比增长2.8%&#xff0c;其中服务收入为人民币2462亿元&#xff0c;同比增长4.3%&#xff1b;净利润为人民…

python内置模块datetime.datetime类详细介绍

Python的datetime模块是一个强大的日期和时间处理库&#xff0c;它提供了多个类来处理日期和时间。主要包括几个功能类datetime.date、datetime.time、datetime.datetime、datetime.timedelta,datetime.timezone等。 总结&#xff1a; datetime类的功能函数众多&#xff0c;大…

【代码随想录训练营第42期 续Day52打卡 - 图论Part3 - 卡码网 103. 水流问题 104. 建造最大岛屿

目录 一、做题心得 二、题目与题解 题目一&#xff1a;卡码网 103. 水流问题 题目链接 题解&#xff1a;DFS 题目二&#xff1a;卡码网 104. 建造最大岛屿 题目链接 题解&#xff1a;DFS 三、小结 一、做题心得 也是成功补上昨天的打卡了。 这里继续图论章节&#xff…

AI prompt(提示词)

# 好用的用于学习的AI提示词 ## 费曼学习法 请使用费曼学习法&#xff0c;用简单的语言解释&#xff08;量子力学&#xff09;是什么&#xff0c;并提供一个简单的例子来说明它如何应用 ## 帕累托法则&#xff08;80/20原则&#xff09; 将&#xff08;量子力学&#xff09;最…

Chapter 13 普通组件的注册使用

欢迎大家订阅【Vue2Vue3】入门到实践 专栏&#xff0c;开启你的 Vue 学习之旅&#xff01; 文章目录 前言一、组件创建二、局部注册三、全局注册 前言 在 Vue.js 中&#xff0c;组件是构建应用程序的基本单元。本章详细讲解了注册和使用 Vue 的普通组件的两种方式&#xff1a;…

图像分割分析效果

下面是训练集的效果, # 训练集dice: 0.9219 - iou: 0.8611 - loss: 0.0318 - mae: 0.0220 - total: 0.8915 basnet_model.evaluate(train_dataset) 损失我只用了二元交叉熵,主要比较损失的影响 上面就是模型在训练集上的效果,可见,模型在训练集上拟合的非常好,既学到了一些有用…

百万次使用的高颜值在线绘图平台ImageGP系列教程

在线平台BIC (https://www.bic.ac.cn/BIC/#/, 点击阅读原文或百度搜索皆可访问到)是 ImageGP的重构升级版&#xff0c;重构于2020年初。 该平台采用配置文件快速部署工具、生成结果或结果报告。其绘图和分析基于 R 语言(ImageGP 包, 在早期ImageGP脚本的基础上重新进行了封装&a…

flume 使用 exec 采集容器日志,转储磁盘

flume 使用 exec 采集容器日志&#xff0c;转储磁盘 在该场景下&#xff0c;docker 服务为superset&#xff0c;flume 的sources 选择 exec &#xff0c; sinks选择 file roll 。 任务配置 具体配置文件如下&#xff1a; #simple.conf: A single-node Flume configuration#…

深入理解java并发编程之aqs框架

跟synchronized 相比较&#xff0c;可重入锁ReentrankLock其实原理有什么不同&#xff1f; 所得基本原理是为了达到一个目的&#xff1b;就是让所有线程都能看到某种标记。synchronized通过在对象头中设置标记实现了这一目的&#xff0c;是一种JVM原生的锁实现方式。而Reentran…

基于深度学习 卷积神经网络resnext50的中医舌苔分类系统

项目概述 本项目旨在通过深度学习技术&#xff0c;特别是利用卷积神经网络&#xff08;Convolutional Neural Networks, CNNs&#xff09;中的ResNeXt50架构&#xff0c;实现对中医舌象图像的自动分类。该系统不仅能够识别不同的舌苔类型&#xff0c;还能够在PyQt5框架下提供一…

IBM Storwize V7000存储控制器故障节点报错574

背景&#xff1a;由于客户机房搬迁&#xff0c;需要下电迁移设备。该存储自2016年投入生产使用后&#xff0c;从未关过机&#xff0c;已正常运行七八年时间&#xff0c;期间只更换过硬盘&#xff0c;无其他硬件故障。 在GUI界面点击关闭系统后&#xff0c;大概等了40分钟&…

AIGC简化文件管理:Python自动重命名Word和PDF文件

1.背景 大家应该也有遇到&#xff0c;自己电脑有很多文件命名不合理的文件&#xff0c;比如&#xff1a;文件1、想法3 &#xff0c;当你长时间再看到这个文件的时候&#xff0c;已经很难知道文件内容。 今天我们将借助AIGC的编码能力&#xff0c;帮我们生成一个批量改文件名的…

多个路由器级联实现子网的方式

好久没写博客啦&#xff0c;最近搬家&#xff0c;换了网络环境&#xff0c;简单记录一下网络配置。 拓扑图就不画了&#xff0c;光猫 - > 华为TC7102路由 -> 华为AX2 Pro路由 -> 各种设备&#xff0c;简单表示就是这样。 原因是第一个路由是房东的&#xff0c;我希望自…

绿色能源在日常生活中的革新应用

绿色能源在日常生活中的革新应用 在当今社会&#xff0c;绿色能源已成为推动可持续发展的关键力量。它不仅代表着对环境的尊重与保护&#xff0c;更引领着生活方式的绿色转型。在我们的日常生活中&#xff0c;绿色能源正以多样化的形式&#xff0c;悄然改变着我们的生活方式。…