traceroute -r用法
时间: 2023-10-30 08:08:43 浏览: 40
traceroute -r是一个命令行工具,用于追踪数据包从源到目的地的路径。其中-r选项告诉traceroute使用路由跳过选项,这意味着它将使用IP数据包的生存时间(TTL)字段来确定路径,而不是使用ICMP回显请求和响应消息。这可以防止防火墙或其他设备拦截ICMP消息,从而提高traceroute的成功率。
使用traceroute -r的语法如下:
```
traceroute -r [目标主机名/IP地址]
```
例如,要追踪到www.example.com的路径,可以输入以下命令:
```
traceroute -r www.example.com
```
traceroute将显示每个路由器的IP地址和名称,并显示每个路由器的延迟时间。注意,由于某些路由器可能会阻止TTL为0的数据包通过,因此traceroute可能无法显示所有路由器。
相关问题
Traceroute --help
`traceroute` 是一个用于网络故障排除和网络性能分析的命令行工具。 它可以显示从本地计算机到目标计算机的路径,以及每个节点的延迟和丢包情况。
以下是 `traceroute` 命令的帮助信息:
```
Usage: traceroute [-nrv] [-m <max_ttl>] [-p <port>] [-q <nqueries>] [-s <src_addr>] [-t <tos>] [-w <wait>] <host>
Options:
-m <max_ttl> Set the maximum number of hops to <max_ttl> (default: 30)
-p <port> Set the destination port to <port> (default: 33434)
-q <nqueries> Set the number of probes per hop to <nqueries> (default: 3)
-s <src_addr> Set the source address to <src_addr> (default: the primary IP address of the local host)
-t <tos> Set the IP type of service to <tos> (default: 0)
-w <wait> Set the time to wait for a response to each probe to <wait> seconds (default: 5)
-n Do not resolve hostnames to IP addresses
-r Bypass the normal routing tables and send directly to each hop
-v Verbose output (include IP addresses and port numbers)
```
可以使用 `traceroute` 命令加上对应的选项和目标主机名或 IP 地址来使用该命令。例如,`traceroute www.google.com` 将显示到 Google 服务器的路径。
traceroute -w
traceroute -w参数用于设置等待每个设备的响应时间。它指定在等待设备响应之前要等待的时间(以毫秒为单位)。默认情况下,每个设备的响应时间为5秒。您可以使用-w参数来更改这个时间。例如,如果您想将等待时间更改为10秒,您可以使用traceroute -w 10000命令。这将使traceroute等待10秒钟以获取每个设备的响应。