Traceroute command usage example

Source: Internet
Author: User
Tags traceroute command

Traceroute command usage instance traceroute is the routing tool used to track data packets arriving at the network host. traceroute is the gateway tool used to send data packets between the host and the target host. The principle of traceroute is to try to send a test packet with the smallest TTL to track the gateway that the data packet passes through to the target host, and then listen for a response from the gateway ICMP. The default size of the sent data packet is 38 bytes. Traceroute [Parameter options] hostname, domain name, or IP address Parameter options:-I indicates the network interface, which is useful for multiple network interfaces. For example,-I eth1 or-I ppp1;-m sets the maximum lifetime used in the test package to max-ttl forwarding, and the default value is 30; -n: the IP address is displayed. The host name is not checked. This parameter is often used when DNS does not work. The basic UDP port used by the-p port test package is set to port. The default value is 334-q n, set the number of probe packages to value n. The default value is 3.-r bypasses the normal route table and directly sends it to the host connected to the network; -w n: Set the waiting time for sending a test package to n seconds. The default value is 3 seconds. instance 1: traceroute is a simple and most commonly used method. It is followed by an IP address, hostname, or domain name. For example, in the following example, [root @ localhost ~] # Traceroute linuxsir. orgtraceroute to linuxsir.org (211.93.98.20), 30 hops max, 40 byte packets 1 sir01.localdomain (192.168.1.1) 0.151 MS 0.094 MS 2 221.201.88.1 (221.201.88.1) 5.867 ms 7.588 ms 5.178 ms 3 218.25.158.149 (218.25.158.149) 6.546 ms 6.230 ms 8.297 ms 4 218.25.138.20.( 218.25.138.20.) 7.129 ms 7.644 ms 8.311 ms ...... note: In this example, the record starts from 1 by serial number, each record is a hop, each hop represents a gateway, we see that each row has three times, the unit is MS, in fact Is the default parameter of-q. The time that the gateway returns after the detection packet sends three data packets to each gateway. If you use traceroute-q 4 linuxsir.org, four data packets are sent to each gateway; sometimes when we traceroute a host, we will see some rows represented by asterisks. In this case, the firewall may block ICMP return information, so we cannot get any related data packets to return data. Sometimes we have a long latency at a certain gateway, which may be caused by a blocking of a gateway or physical device. Of course, if a DNS server encounters a problem and the host name or domain name cannot be resolved, there will also be a long delay. You can add the-n parameter to avoid DNS resolution and output data in IP Format; if the network segments in the LAN are different, we can use traceroute to troubleshoot the problem, whether it is a host problem or a gateway problem. If a problem occurs when we remotely access a server, we use the gateway that traceroute traces the data packet and submits it to the IDC service provider, which also helps solve the problem; however, it seems that it is difficult to solve such problems in China, that is, we find that the problem is located, and the IDC service provider cannot help us solve it. Why? Because China north and China South Telecom are independent of each other. In the past, it was a single network, and now it is two networks, which is smooth. Let's just look at the Internet. instance 2: Some parameter usage examples; [root @ localhost ~] # Traceroute-m 10 linuxsir.org sets the number of hops to 10; [root @ localhost ~] # Traceroute-n linuxsir.org note: the IP address is displayed and the host name is not checked. [Root @ localhost ~] # Traceroute-p 6888 linuxsir.org Note: set the basic UDP port used by the test package to 6888 [root @ localhost ~] # Traceroute-q 4 linuxsir.org Note: set the number of test packets to 4. [root @ localhost ~] # Traceroute-r linuxsir.org Note: attackers can bypass normal route tables and directly send them to connected hosts. [root @ localhost ~] # Traceroute-w 3 linuxsir.org Note: Set the waiting response time of the external probe package to 5 seconds. In the XP system, use tracert to track routes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.