当前位置:网站首页>How routers work
How routers work
2022-08-06 06:13:00 【Jing Shenhuo】
目录
What are the tables in the computer?
The router concept
子网划分:大的网络划分成很多小的网络
路由器(route):实现跨网段通信
Across from the source host to the target host an Internet to forward a datagram process
路由器组
Can will数据包Forwarded to the right目的地,And in the process of forward selection最佳路径的设备
路由表
作用:存放路由信息,在内存中,停电会丢失 ----> Can be stored in the disk a file
字段:
目标网段
接口: The router itself interface
下一跳(gateway)
[[email protected] network-scripts]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.222.2 0.0.0.0 UG 100 0 0 ens33 192.168.222.0 0.0.0.0 255.255.255.0 U 100 0 0 ens33 [[email protected] network-scripts]#
ARP address resolution protocol 地址解析协议,解析出mac地
路由器的工作原理:
According to the routing table to do forward,By default, a router forwarding data,不修改ip包里的源ip和目的ip,But will modify frame in the sourcemac和目的mac,Routing table targeted segment forward,Without discarding the data
Routing table entry is how?
Routing table routing type:
1. 直连路由:第一个条件:必须**配置ip地址** 第二个条件:接口**必须激活**,链路是up 2. 静态路由:需要管理员(人)手工配置,而且是单向
ip route add 192.168.1.0/24 via 192.168.2.1 dev ens33
ip route Is the command of routing management
add 表示添加
192.168.1.0/24 目标网段
via 192.168.2.1 下一跳为192.168.2.1
dev ens33 从ens33接口出去3. 默认路由: 是特殊的静态路由,在pcMachine add gateway,Is to configure a default route,当路由器在路由表中找不到目标网络的路由条目时,路由器把请求转发到默认路由接口 ip route default via 192.168.2.1 dev ens33 配置默认路由 4. 动态路由:Routers learn each other,自动学习,Don't need to configure the routing entry (Relatively large network)
路由优先级
1. 直连路由 **** 2. 静态路由 *** 3. 动态路由 ** 4. 默认路由 *
ping 的过程
ping 不同网段
A : 192.168.20.1
B : 192.168.30.1
A ping B
1. 封装icmp数据和ip包数据
2. Take first purposeipAnd their own subnet mask and the operation to get the target segment is192.164.30.0,And then to query their routing table
直连路由: 192.168.20.0 ens33
默认路由: 192.168.20.254
ip包的封装:
源: 192.168.20.1 目的ip: 192.168.30.1
3. 走默认路由,下一跳地址是192.168.20.254
帧: 源mac :自己 目的mac:192.168.20.254的mac地址
4. 发arpRadio and get20.254的mac地址
5. 封装帧
6. 比特流ipAddress in the Internet use,macAddress is used in the local area network (LAN)
What are the tables in the computer?
1. 路由表
linux:ip route
route -n number,以数字形式显示
windows10:route print
2. arp表
[[email protected] network-scripts]# arp -n
Address HWtype HWaddress Flags Mask Iface
192.168.222.2 ether 00:50:56:f4:7b:e2 C ens33
192.168.222.1 ether 00:50:56:c0:00:08 C ens33
[[email protected] network-scripts]# 边栏推荐
猜你喜欢

类和对象随手记

External Interrupts and Timers

Docker 快速安装&搭建 Redis 环境

分布式,微服务,集群概念和区别

Docker quickly installs & builds Redis environment

详解树莓派上如何安装Home Assistant Supervised,让家里的智能设备更智能

树莓派官方系统取消pi用户,没有显示器如何初始化默认用户并进行SSH连接?

树莓派安装高版本Chromium和Chromedriver

Kindle接入HomeAssistant:实现锁屏壁纸显示HA内设备信息并在HA内获取Kindle电量

ARMv7-M Debug Part
随机推荐
IO流文件复制
初识网络层
3.2 定位shellcode
如何根据页面标签自动生成文章目录?分析+代码详解
谷歌浏览器反复提示PageOffice安装
多线程:定时器
After the Xiaomi AX3600 router is expanded and flashed OpenWrt, how to flash back to the official system and partition
性能测试分析与使用
Fortinet :《2021 年OT与网络安全现状报告》之「实践解读」
纯小白也能玩转PXE自动化安装系统
LVS负载均衡服务器搭建
树莓派官方系统取消pi用户,没有显示器如何初始化默认用户并进行SSH连接?
动态规划之不同路径
案例精述|Fortinet安全SD-WAN助力国际物流企业降本增效
mysql服务器参数设置总结
Kindle接入HomeAssistant:实现锁屏壁纸显示HA内设备信息并在HA内获取Kindle电量
3.1 shellcode 概述
学好免交互expect解放双手
动态规划之最大子数组和
LAMP+DISCUZ论坛搭建流程