Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux Common Network tools how to use the Route scanning tool traceroute

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "Linux common network tools how to use the routing scanning tool traceroute". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The main purpose of route scanning is to query the number of hops and data delay of the route from this machine to another host.

Basic use of traceroute

The principles of route scanning tools are all implemented by time to Live (TTL). Every time a packet passes through a router, its survival time is reduced by 1. When the survival time is 0, the host cancels the packet and sends an ICMP TTL packet to the sender of the original packet, and the route scanning tool uses the echoed ICMP to obtain the information of each hop route.

The tracert function of traceroute under Linux is similar to that of Windows, except that the tracert of Windows sends ICMP messages and the traceroute of Linux sends UDP packets.

Because traceroute uses the UDP protocol, its destination port number defaults to 33433, which is not used by general applications, so the target host sends back ICMP.

Traceroute also supports sending TCP and ICMP:

The code is as follows:

-I-- icmp Use ICMP ECHO for tracerouting

-T-- tcp Use TCP SYN for tracerouting

-p port-- port=port

General Linux will come with the traceroute tool by default, if not, you can install it on yum.

The simplest basic usage of traceroute is: traceroute hostname, example:

The code is as follows:

# traceroute 192.168.0.99

Traceroute to 192.168.0.99 (192.168.0.99), 30 hops max, 60 byte packets

1 192.168.2.1 (192.168.2.1) 5.642 ms 5.901 ms 12.287 ms

2 192.168.0.99 (192.168.0.99) 0.416 ms 1.193 ms 1.045 ms

Traceroute tests each node three times, so each row has three times, from which time it can be analyzed which routing node has the greatest latency.

Skills of using traceroute

When using traceroute for some websites, the final node may not be reached, such as:

This is mainly because some servers block UDP packets, so they do not return ICMP.

For hosts with HTTP services, you can use the parameter setting traceroute to detect using TCP protocol, and the final node can be obtained:

This is the end of the introduction of "Linux common network tools how to use the route scanning tool traceroute". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report