In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use the traceroute command in Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The common Linux command traceroute command is used to track the entire path of a packet as it travels over the network, and the default packet size is 40 bytes.
Traceroute displays the path between packets and hosts
Add that through traceroute we can know the path of information from your computer to the host on the other side of the Internet. Of course, each packet from the same starting point (source) to a certain same destination (destination) may take a different path, but basically, most of the time the route is the same.
Traceroute measures how long it takes to send a small packet to the destination device until it returns. The traceroute of each device on a path is tested 3 times. The output includes the time of each test (ms) and the name of the device, if any, and its ip address.
Syntax traceroute (option) (parameter) option-d: use debugging at the Socket level;-f: set the size of the survival value TTL for the first detect packet;-F: set the do not break bit;-g: set the source routing gateway, up to 8;-I: send packets using the specified network interface;-I: use ICMP response instead of UDP data information -m: set the size of the maximum survival value TTL for the inspection packet;-n: directly use the IP address instead of the host name;-p: set the communication port of the UDP transport protocol;-r: ignore the normal Routing Table and send the packet directly to the remote host. -s: set the IP address of the data packet sent by the local host;-t: set the TOS value of the detection packet;-v: display the execution process of the instruction in detail;-w: set the time to wait for the remote host to report back;-x: turn on or off the correctness check of the packet. Parameter host: specify the destination host IP address or hostname.
Instance traceroute www.58.com traceroute to www.58.com (211.151.111.30), 30 hops max 40 byte packets 1 unknown (192.168.2.1) 3.453 ms 3.801 ms 3.937 ms 2 221.6.45.33 (221.6.45.33) 7.768 ms 7.816 ms 7.840 ms 3 221.0.233 (221.6.0.233) 13.784 ms 13.827 ms 221.6.9.81 (221.6.9.81) 9.758 ms 4 221.6.169 (221.6.2.169) ) 11.777 ms 122.96.66.13 (122.96.66.13) 34.952 ms 221.6.2.53 (221.6.2.53) 41.372 ms 5219.158.96.149 (219.158.96.149) 39.167 ms 39.210 ms 39.238 ms 6 123.126.0.194 (123.126.0.194) 37.270 ms 123.126.0.66 (123.126.0.66) 37.163 Ms 37.441 ms 7 124.65.57.26 (124.65.57.26) 42.787 ms 42.799 ms 42.809 ms 8 61.148.146.210 (61.148.146.210) 30.176 ms 61.148.154.98 (61.148.154.98) 32.613 ms 32.675 ms 9 202.106.42.102 (202.106.42.102) 44.563 ms 44.600 ms 44.627 ms 10 210.77.139.150 (210.77.139.150) 53.302 ms 53.233 ms 53.032 ms 11 211.151.104.6 (211.151.104.6) 39.585 ms 39.502 ms 39.598 ms 12 211.151.111.30 (211.151.111.30) 35.161 ms 35.938 ms 36.005 ms records start with serial number 1 Each record is a hop, and each hop represents a gateway. We see that each row has three times in ms, which is actually the default parameter of-Q. Probe the time after the gateway responds after sending three packets to each gateway; if traceroute-Q 4 www.58.com is used, four packets are sent to each gateway.
Sometimes when we traceroute a host, we see lines with asterisks. When this happens, it may be that the firewall has blocked the return information of ICMP, so we can't get any relevant packet return data.
Sometimes we have a long delay at a gateway, which may be due to the congestion of a gateway or to the physical device itself. Of course, if there is a problem with a DNS, there will be a long delay when the host name and domain name cannot be resolved. You can add the-n parameter to avoid DNS parsing and output the data in IP format.
If between different network segments in the local area network, we can use traceroute to find out what the problem is, whether it is the problem of the host or the gateway. If we encounter a problem when we access a server remotely, we use traceroute to track the gateway through which the packet passes and submit it to the IDC service provider, which will also help to solve the problem. But at present, it seems that it is more difficult to solve such a problem in China, even if we find the problem, the IDC service provider cannot help us solve it.
Hop count settin
[root@localhost] # traceroute-m 10 www.baidu.com traceroute to www.baidu.com (61.135.169.105), 10 hops max 40 byte packets 1 192.168.74.2 (192.168.74.2) 1.534 ms 1.775 ms 1.961 ms 2 211.151.56.1 (211.151.56.1) 0.508 ms 0.514 ms 0.507 ms 3 211.151.227.206 (211.151.227.206) 0.571 ms 0.558 ms 0.550 ms 4 210.77.139.145 (210.77.139.145) 0.708 ms 0.729 ms 0 .785 ms 5 202.106.42.101 (202.106.42.101) 7.978 ms 8.155 ms 8.311 ms 6 bt-228-037.bta.net.cn (202.106.228.37) 772.460 ms bt-228-025.bta.net.cn (202.106.228.25) 2.152 ms 61.148.154.97 (61.148.154.97) 772.107 ms 7 124.65.58.221 (124.65.58. 4.875 ms 61.148.146.29 (61.148.146.29) 2.124 ms 124.65.58.221 (124.65.58.221) 4.854 ms 8 123.126.198 (123.126.198) 2.944 ms 61.148.156.6 (61.148.156.6) 3.505 ms 123.126.198 (123.126.198) 2.885 ms 9 * 10 * other examples
Traceroute-m 10 www.baidu.com # hop setting traceroute-n www.baidu.com # display IP address, do not check hostname traceroute-p 6888 www.baidu.com # basic UDP port setting for probe packets 6888 traceroute-Q 4 www.baidu.com # set the number of probe packets to a value of 4 traceroute-r www.baidu.com # bypass the normal routing table Send it directly to the network-connected host traceroute-w 3 www.baidu.com # set the wait response time of the external probe packet to 3 seconds. Thank you for reading! This is the end of the article on "how to use traceroute commands in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.