当前位置:网站首页>static routing
static routing
2022-08-05 06:13:00 【Magic star,】
静态路由
什么是路由:从源主机到目标主机的转发过程
路由器:Can to forward the packet to the target host,选择路径
路由表的形成
注意:
当打开路由器,设置配置IP地址,路由表是空的.When we give chain on the port configuration of youIPAddress segment of the information will automatically add this address
网关:Is there;To host on the same network segment with you(同一广播域).
静态路由:
缺点:
- Configuration is one-way
- 缺乏灵活性(一个网段变化,全要重新设置)
优点:
Explicit routing path,快
封装
主机A想和主机B通讯
ARP协议
第一次封装:
源IP/目的IP | 源MAC/目的MAC |
---|---|
192.168.1.2/192.168.2.2 | 11-11/22-22 |
第二次封装:
源IP/目的IP | 源MAC/目的MAC |
---|---|
192.168.1.2/192.168.2.2 | 33-33/44-44 |
第三次封装:
源IP/目的IP | 源MAC/目的MAC |
---|---|
192.168.1.2/192.168.2.2 | 55-55/66-66 |
实验(2个路由器)
配置PC1和PC2的IP地址/子网掩码/网关
- 配置路由( R1)的接口GE0/0/0的网关:192.168.1.254(与PC1的网关相同)和接口GE0/0/1的网关:192.168.3.1(自己规定)
- 配置R1静态路由
[ R1 ]ip route-static 192.168.2.0 255.255.255.0 192.168.4.1 - 配置路由( R2)的接口GE0/0/1的网关:192.168.2.254(与PC2的网关相同)和接口GE0/0/0的网关:192.168.4.1(自己规定)
- 配置R2静态路由
[R2]ip route-static 192.168.1.0 255.255.255.0 192.168.3.1 - 路由配置完成后,Test the success(ping 192.168.2.1)
如图所示,则成功
注意:R1接口“GE0/0/0”The gateway andR2接口“GE0/0/0”的网关,Should be on the same network segment,否则无法通信
实验二(三个路由器)
配置PC1和PC2的IP地址/子网掩码/网关
1、 配置路由( R1)的接口GE0/0/0的网关:192.168.1.254(与PC1的网关相同)和接口GE0/0/1的网关:192.168.3.1(自己规定), 配置R1静态路由[ R1 ]ip route-static 0.0.0.0 0.0.0.0 192.168.3.2
2、 配置路由( R2)的接口GE0/0/0的网关:192.168.3.2和接口GE0/0/1的网关:192.168.4.2(自己规定),配置R2静态路由
[R2]ip route-static 192.168.2.0 255.255.255.0 192.168.4.1
[R2]ip route-static 192.168.1.0 255.255.255.0 192.168.3.1
3、 配置路由(R3)的接口GE0/0/0的网关:192.168.4.1(与R2接口GE0/0/1The gateway in the same network segment)和接口GE0/0/1的网关:192.168.2.254
实验三
The same as the experiment 2 onlyR1接口“GE0/0/2”再配个192.168.5.1,And add a static path:
[R1]ip route-static 0.0.0.0 0.0.0.0 192.168.5.2 preference 70(优先级为70)
R3接口“GE0/0/2”再配个192.168.6.1,And add a static route:
[R3]ip route-static 0.0.0.0 0.0.0.0 192.168.6.2 preference 70(优先级为70)
R4与R2操作相同
操作命令
命令 | 注释 |
---|---|
< Huawei > undo terminal monitor | 关闭提示信息(简写u t m) |
[ Huawei ]undo info-center enable | 关闭提示信息 |
[ Huawei ]sysname R1 | 修改路由器名称 |
[ R1 ] int g0/0/0 | 进入g0/0/0口 |
[R1-GigabitEthernet0/0/0]ip add 192.168.1.254 24 | The command configuration address |
[R1-GigabitEthernet0/0/0]display this | 查看配置信息 |
[R1-GigabitEthernet0/0/0]undo shutdown | 打开端口 |
[R1]display ip routing-table | 查看路由表信息 |
undo 命令 | 删除配置(dis this See the copy and paste the command ) |
[R1]display ip interface brief | 查看接口的简要信息 |
Destination/Mask 目的网段/子网掩码
Proto 协议类型
Pre 优先级
Cost 开销值
Flags Information such as routing state
NextHop 下一跳地址
Interface 接口信息
路由的优先级
Each routing protocol agreement priority(数值越小,优先级越高),当有多个路由信息时,Choice is the highest priority routing as a best route.
路由类型 | 优先级 |
---|---|
直连路由 | 0 |
OSPF内部路由 | 10 |
IS-IS路由 | 15 |
静态路由 | 60 |
RIP路由 | 100 |
OSPF ASE路由 | 150 |
OSPF NSSA路由 | 150 |
IBGP路由 | 255 |
EBGP路由 | 255 |
Static routing the default priority is60
优先级越小 越优先
边栏推荐
- 什么是阿里云·速成美站?
- Wireshark抓包及常用过滤方法
- The problem of calling ds18b20 through a single bus
- Unity3D中的ref、out、Params三种参数的使用
- 小度 小度 在呢!
- Getting Started 03 Distinguish between development and production environments ("hot update" is performed only in the production environment)
- Getting Started Document 01 series in order
- spark source code - task submission process - 2-YarnClusterApplication
- Introductory document 05-2 use return instructions the current task has been completed
- 腾讯云消息队列CMQ
猜你喜欢
随机推荐
LinkSLA坚持用户第一,打造可持续的运维服务方案
spark源码-任务提交流程之-5-CoarseGrainedExecutorBackend
[Paper Intensive Reading] Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation (R-CNN)
NIO works is analysed
ROS视频教程
spark source code - task submission process - 3-ApplicationMaster
Remembering my first CCF-A conference paper | After six rejections, my paper is finally accepted, yay!
Mongodb查询分析器解析
Unity3D中的ref、out、Params三种参数的使用
D39_欧拉角与四元数
vim的三种模式
微信小程序页面跳转传参
入职前,没想到他们玩的这么花
spark源码-任务提交流程之-4-container中启动executor
IP地址及子网的划分
运维工程师,快来薅羊毛
Getting Started Document 07 Staged Output
Hard Disk Partitioning and Permanent Mounting
NIO工作方式浅析
spark算子-wholeTextFiles算子