欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Linux下traceroute的安装和使用

Linux下traceroute的安装和使用

一、traceroute的安装

yum install -y traceroute

二、traceroute的使用

  1. SYNOPSIS
  2. traceroute [-46dFITUnreAV] [-f first_ttl] [-g gate,...]
  3. [-i device] [-m max_ttl] [-p port] [-s src_addr]
  4. [-q nqueries] [-N squeries] [-t tos]
  5. [-l flow_label] [-w waittime] [-z sendwait] [-UL] [-D]
  6. [-P proto] [--sport=port] [-M method] [-O mod_options]
  7. [--mtu] [--back]
  8. host [packet_len]
  9. traceroute6  [options]
  1. Options:
  2. -4                          Use IPv4
  3. -6                          Use IPv6
  4. -d  --debug                 Enable socket level debugging
  5. -F  --dont-fragment         Do not fragment packets
  6. -f first_ttl  --first=first_ttl
  7. Start from the first_ttl hop (instead from 1)
  8. -g gate,...  --gateway=gate,...
  9. Route packets through the specified gateway
  10. (maximum 8 for IPv4 and 127 for IPv6)
  11. -I  --icmp                  Use ICMP ECHO for tracerouting
  12. -T  --tcp                   Use TCP SYN for tracerouting (default port is 80)
  13. -i device  --interface=device
  14. Specify a network interface to operate with
  15. -m max_ttl  --max-hops=max_ttl
  16. Set the max number of hops (max TTL to be
  17. reached). Default is 30
  18. -N squeries  --sim-queries=squeries
  19. Set the number of probes to be tried
  20. simultaneously (default is 16)
  21. -n                          Do not resolve IP addresses to their domain names
  22. -p port  --port=port        Set the destination port to use. It is either
  23. initial udp port value for "default" method
  24. (incremented by each probe, default is 33434), or
  25. initial seq for "icmp" (incremented as well,
  26. default from 1), or some constant destination
  27. port for other methods (with default of 80 for
  28. "tcp", 53 for "udp", etc.)
  29. -t tos  --tos=tos           Set the TOS (IPv4 type of service) or TC (IPv6
  30. traffic class) value for outgoing packets
  31. -l flow_label  --flowlabel=flow_label
  32. Use specified flow_label for IPv6 packets
  33. -w waittime  --wait=waittime
  34. Set the number of seconds to wait for response to
  35. a probe (default is 5.0). Non-integer (float
  36. point) values allowed too
  37. -q nqueries  --queries=nqueries
  38. Set the number of probes per each hop. Default is
  39. 3
  40. -r                          Bypass the normal routing and send directly to a
  41. host on an attached network
  42. -s src_addr  --source=src_addr
  43. Use source src_addr for outgoing packets
  44. -z sendwait  --sendwait=sendwait
  45. Minimal time interval between probes (default 0).
  46. If the value is more than 10, then it specifies a
  47. number in milliseconds, else it is a number of
  48. seconds (float point values allowed too)
  49. -e  --extensions            Show ICMP extensions (if present), including MPLS
  50. -A  --as-path-lookups       Perform AS path lookups in routing registries and
  51. print results directly after the corresponding
  52. addresses
  53. -M name  --module=name      Use specified module (either builtin or external)
  54. for traceroute operations. Most methods have
  55. their shortcuts (`-I' means `-M icmp' etc.)
  56.  -O OPTS,...  --options=OPTS,...
  57.                              Use module-specific option OPTS for the
  58.                              traceroute module. Several OPTS allowed,
  59.                              separated by comma. If OPTS is "help", print info
  60.                              about available options
  61.  --sport=num                 Use source port num for outgoing packets. Implies
  62.                              `-N 1'
  63. --fwmark=num                Set firewall mark for outgoing packets
  64. -U  --udp                   Use UDP to particular port for tracerouting
  65. (instead of increasing the port per each probe),
  66. default port is 53
  67. -UL                         Use UDPLITE for tracerouting (default dest port
  68. is 53)
  69. -D  --dccp                  Use DCCP Request for tracerouting (default port
  70. is 33434)
  71. -P prot  --protocol=prot    Use raw packet of protocol prot for tracerouting
  72. --mtu                       Discover MTU along the path being traced. Implies
  73. `-F -N 1'
  74.  --back                      Guess the number of hops in the backward path and
  75.                              print if it differs
  76.  -V  --version               Print version info and exit
  77.  --help                      Read this help and exit
  78. Arguments:
  79. +     host          The host to traceroute to
  80.      packetlen     The full packet length (default is the length of an IP
  81.                    header plus 40). Can be ignored or increased to a minimal
  82.                    allowed value

 


普通分类: