当前位置:网站首页>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
优先级越小 越优先
边栏推荐
- Spark source code-task submission process-6.2-sparkContext initialization-TaskScheduler task scheduler
- The spark operator - coalesce operator
- 技术分享杂七杂八技术
- Cocos Creator小游戏案例《棍子士兵》
- 入门文档09 独立的watch
- Getting Started Documentation 12 webserve + Hot Updates
- markdown编辑器模板
- [Day8] (Super detailed steps) Use LVM to expand capacity
- VRRP原理及命令
- 网络不通?服务丢包?看这篇就够了
猜你喜欢

【机器学习】1单变量线性回归

入门文档08 条件插件

spark源码-RPC通信机制

I/O性能与可靠性

TensorFlow ObjecDetectionAPI在win10系统Anaconda3下的配置
![[Day1] (Super detailed steps) Build a soft RAID disk array](/img/40/cda8e5522c2795e03c0d47e8a689f8.png)
[Day1] (Super detailed steps) Build a soft RAID disk array

IJCAI 2022|Boundary-Guided Camouflage Object Detection Model BGNet

The problem of redirecting to the home page when visiting a new page in dsf5.0

markdown编辑器模板

Cocos Creator小游戏案例《棍子士兵》
随机推荐
spark source code - task submission process - 2-YarnClusterApplication
单臂路由与三成交换机
硬盘分区和永久挂载
Spark source code-task submission process-6.2-sparkContext initialization-TaskScheduler task scheduler
TCP/IP four-layer model
ACLs and NATs
Contextual non-local alignment of full-scale representations
The idea of commonly used shortcut key
D41_缓冲池
[Day6] File system permission management, file special permissions, hidden attributes
SSL证书提示过期或者无效,该怎么处理呢?
Getting Started Document 09 Standalone watch
Introductory document 05-2 use return instructions the current task has been completed
Three modes of vim
Configuration of TensorFlow ObjecDetectionAPI under Anaconda3 of win10 system
ROS video tutorial
[Pytorch study notes] 8. How to use WeightedRandomSampler (weight sampler) when the training category is unbalanced data
正则表达式小示例--获取重复最多的字符及其数量
[Day1] VMware software installation
什么是阿里云·速成美站?