当前位置:网站首页>为什么ping不通,而traceroute却可以通
为什么ping不通,而traceroute却可以通
2022-06-24 07:05:00 【格格巫 MMQ!!】
ping是走ICMP协议。tracert走追踪路由的吓一跳。。两个命令是不一样。
如果服务器没有启用ICMP协议或者防火墙禁用ICMP,还有地址映射的时候没有做ICMP的映射,都会导致ping不通。。
tracertoute 需要路由交换开启ip追踪才行。

说明目标机拒绝响应ICMP的echo而已。
ping的时候,是发一个icmp的echo,目标机相应一个reply。然后就认为是通了。
traceroute也是发icmp echo,但是,把TTL从1开始,逐渐增加。在通路上的节点,收到一个TTL为0的ICMP的时候,就会回一个错误信息。通过这样的方式,获知通路上的节点的情况。
如果某个目标机,不响应icmp echo,却还是响应了icmp echo中TTL为0的情况,就是你这个表现了。
ping与traceroute都使用icmp协议,但其工作原理及ICMP中类型字段的定义是不同的:
对于ping,发送的是一个echo request包,类型为 8 0,当被ping者接到相关icmp包的时候,根据实际情况,逻辑是,就发回 reply 0 0,逻辑否,则根据具体情况发出一些其他的信息,总结起来的说,是看目的是否能及时的把icmp reply包送回到源,一当路径上的某个节点把reply包给deny掉了,就肯定ping不通了,比如会是time out,
对于traceroute,本质可以理解为hop by hop的ping,但这个ping和上面讲的ping不一样,这个ping和我们的ping命令不同,traceroute包发出去后,途经的每个站点都会发回一个 类型代码为11 0的icmp 包回去,到了终点,才回发送一个代码为3 3的icmp包回到源
因此,如果在某些途径的节点(路由器)上,限制了类型11的ICMP报文(ICMP报文是防火墙最常见的限制),就会出现你的情况。
边栏推荐
- Rust procedure macro simply imitates Lombok function
- Fundamentals of 3D mathematics [17] inverse square theorem
- 小黑ai4code代码baseline啃食1
- 什么是SRE?一文详解SRE运维体系
- js中通过key查找和更新对象中指定值的方法
- ZUCC_ Principles of compiling language and compilation_ Experiment 03 getting started with compiler
- JS merge multiple objects and remove duplicates
- xtrabackup做数据备份
- How to mount a USB hard disk with NTFS file format under RHEL5 system
- Using sonar for code checking
猜你喜欢
随机推荐
Win10 cloud, add Vietnamese
日本大阪大学万伟伟研究员介绍基于WRS系统机器人的快速集成方法和应用
Live broadcast appointment: growth of Mengxin Product Manager
Ordering of MySQL composite index
Three categories of financial assets under the new standards: AMC, fvoci and FVTPL
数据平台简介
利用sonar做代码检查
MATLAB Camera Calibrator相机标定
5 minutes, excellent customer service chat handling skills
Rust procedure macro simply imitates Lombok function
QPS, TPS, concurrent users, throughput relationship
【无标题】
Fund raising, trading and registration
ZUCC_ Principles of compiling language and compilation_ Experiment 05 regular expression, finite automata, lexical analysis
ZUCC_ Principles of compiling language and compilation_ Experiment 04 language and grammar
Building a static website with eleventy
ZUCC_ Principles of compiling language and compilation_ Experiment 03 getting started with compiler
Use cpulimit to free up your CPU
获取屏幕宽高工具类
ZUCC_ Principles of compiling language and compilation_ Experiment 08 parsing LR parsing









![[micro services ~nacos] Nacos service providers and service consumers](/img/b7/47ecd6979ccfeb270261681d6130be.png)