Linux traceroute Command : traceroute Command In Linux

Blogs ❯❯ Linux

Image could not load

Image by pixabay

traceroute Command in Linux

Linux में traceroute command का use किसी IP network से लिए गए सभी route packet को track करने के लिए किया जाता है। मतलब traceroute command किसी packet को host तक पहुंचने के follow किये गए route को trace / print करता है।

traceroute command local networks को mapping करने में भी useful है। ध्यान रहे traceroute use करते समय, कुछ devices Routers में bug होने की वजह से या ISPs rate-limiting की वजह से सही interact भी नहीं करती है। और कुछ networks को traceroute requests को block करने के लिए भी configure किया जाता है।

Linux Install traceroute

by default , system में traceroute install नहीं होता है। इसे install करने के लिए नीचे दी गयी command को run करें।

$ sudo apt update
$ sudo apt install traceroute

Linux traceroute Example

traceroute को use करने का सबसे basic method बहुत simple है , traceroute को check करने के लिए सिर्फ किसी destination की जरूरत होती है। destination कोई domain name या कोई IP Address हो सकता है।

Example :

$ traceroute google.com
traceroute to google.com (142.251.163.139), 30 hops max, 60 byte packets
 1  * ec2-3-236-62-175.compute-1.amazonaws.com (3.236.62.175)  3.765 ms *
 2  240.0.60.65 (240.0.60.65)  0.324 ms 240.0.60.96 (240.0.60.96)  0.314 ms 100.66.33.220 (100.66.33.220)  6.913 ms
 3  240.0.60.94 (240.0.60.94)  0.310 ms * 100.66.28.208 (100.66.28.208)  2.054 ms
 .
 .
 and so on..
 press ctrl+c to stop. 

और इसी तरह से domain name की IP Address जगह भी use कर सकते हैं।

$ traceroute 142.251.163.139
traceroute to 142.251.163.139 (142.251.163.139), 30 hops max, 60 byte packets
 1  ec2-3-236-60-69.compute-1.amazonaws.com (3.236.60.69)  2.049 ms * 216.182.239.99 (216.182.239.99)  6.392 ms
 2  100.65.57.192 (100.65.57.192)  5.184 ms 100.66.8.38 (100.66.8.38)  13.701 ms 240.0.60.64 (240.0.60.64)  0.417 ms
 3  240.0.60.114 (240.0.60.114)  0.401 ms 100.66.34.248 (100.66.34.248)  20.860 ms 100.66.29.52 (100.66.29.52)  2.292 ms

traceroute Command Options

traceroute command के और भी कई options available हैं , जिन्हे आप traceroute --help run करके देख सकते हैं।

$ traceroute --help
-4                          Use IPv4
-6                          Use IPv6
-d  --debug                 Enable socket level debugging
-F  --dont-fragment         Do not fragment packets
-f first_ttl  --first=first_ttl
                            Start from the first_ttl hop (instead from 1)
-g gate,...  --gateway=gate,...
                            Route packets through the specified gateway(maximum 8 for IPv4 and 127 for IPv6)
-I  --icmp                  Use ICMP ECHO for tracerouting
-T  --tcp                   Use TCP SYN for tracerouting (default port is 80)
-i device  --interface=device
                            Specify a network interface to operate with
-m max_ttl  --max-hops=max_ttl
                            Set the max number of hops (max TTL to be reached). Default is 30
-N squeries  --sim-queries=squeries
                            Set the number of probes to be tried simultaneously (default is 16) Do not resolve IP addresses to their domain names
-p port  --port=port        Set the destination port to use. It is either initial udp port value for "default" method (incremented by each probe, default is 33434), 
														or initial seq for "icmp" (incremented as well, default from 1), or some constant destination port for other methods 
														(with default of 80 for "tcp", 53 for "udp", etc.)
 .
 .
 and so on.
Recent Blogs

Loading ...

Rahul Kumar

Rahul Kumar

Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)

Get connected with me. :) LinkedIn Twitter Instagram Facebook