Linux traceroute Command

Linux 命令大全Linux Command Encyclopedia

The Linux traceroute command is used to display the path of data packets to the host.

The traceroute command allows you to trace the routing path of network data packets. The default packet size is 40 bytes, and users can set it separately.

Syntax

traceroute [-dFlnrvx][-f<存活数值>][-g<网关>...][-i<网络界面>][-m<存活数值>][-p<通信端口>][-s<来源地址>][-t<服务类型>][-w<超时秒数>][主机名称或IP地址][数据包大小]

Parameter Description:

  • -d Use Socket-level debugging functionality.
  • -f<ttl> Set the TTL (Time To Live) value of the first probe packet.
  • -F Set the don't fragment bit.
  • -g<gateway> Set the source route gateway, up to 8 can be set.
  • -i<network interface> Use the specified network interface to send data packets.
  • -I Use ICMP Echo to replace UDP data information.
  • -m<ttl> Set the maximum TTL (Time To Live) value of the probe packet.
  • -n Use IP addresses directly instead of hostnames.
  • -p<port> Set the communication port for the UDP transport protocol.
  • -r Ignore the normal Routing Table and send the data packet directly to the remote host.
  • -s<source address> Set the IP address from which the local host sends data packets.
  • -t<service type> Set the TOS (Type of Service) value of the probe packet.
  • -v Display the execution process of the command in detail.
  • -w<timeout seconds> Set the time to wait for the remote host to respond.
  • -x Enable or disable packet correctness checking.

Examples

Display the route of data packets to the destination.

# traceroute www.google.com
traceroute: Warning: www.google.com has multiple addresses; using 66.249.89.99
traceroute to www.l.google.com (66.249.89.99), 30 hops max, 38 byte packets
1 192.168.0.1 (192.168.0.1) 0.653 ms 0.846 ms 0.200 ms
2 118.250.4.1 (118.250.4.1) 36.610 ms 58.438 ms 55.146 ms
3 222.247.28.177 (222.247.28.177) 54.809 ms 39.879 ms 19.186 ms
4 61.187.255.253 (61.187.255.253) 18.033 ms 49.699 ms 72.147 ms
5 61.137.2.177 (61.137.2.177) 32.912 ms 72.947 ms 41.809 ms
6 202.97.46.5 (202.97.46.5) 60.436 ms 25.527 ms 40.023 ms
7 202.97.35.69 (202.97.35.69) 40.049 ms 66.091 ms 44.358 ms
8 202.97.35.110 (202.97.35.110) 42.140 ms 70.913 ms 41.144 ms
9 202.97.35.14 (202.97.35.14) 116.929 ms 57.081 ms 60.336 ms
10 202.97.60.34 (202.97.60.34) 54.871 ms 69.302 ms 64.353 ms
11 * * *
12 209.85.255.80 (209.85.255.80) 95.954 ms 79.844 ms 76.052 ms
   MPLS Label=385825 CoS=5 TTL=1 S=0
13 209.85.249.195 (209.85.249.195) 118.687 ms 120.905 ms 113.936 ms
14 72.14.236.126 (72.14.236.126) 115.843 ms 137.109 ms 186.491 ms
15 nrt04s01-in-f99.1e100.net (66.249.89.99) 168.024 ms 140.551 ms 161.127 ms

Linux 命令大全Linux Command Encyclopedia

Other Extensions