linux+trace+端口,Linux:traceroute参数详解

traceroute 参数详解【linux命令 traceroute --help】

traceroute [ -46dFITnreAUV ] [ -f first_ttl ] [ -g gate,... ] [ -i device ] [ -m max_ttl ] [ -N squeries ] [ -p port ] [ -t tos ] [ -l flow_label ]

[ -w waittime ] [ -q nqueries ] [ -s src_addr ] [ -z sendwait ] host [ packetlen ]

Options:

-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

-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)

-n                          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.)

-t tos  --tos=tos           Set the TOS (IPv4 type of service) or TC (IPv6

traffic class) value for outgoing packets

-l flow_label  --flowlabel=flow_label

Use specified flow_label for IPv6 packets

-w waittime  --wait=waittime

Set the number of seconds to wait for response to

a probe (default is 5.0). Non-integer (float

point) values allowed too

-q nqueries  --queries=nqueries

Set the number of probes per each hop. Default is

3

-r                          Bypass the normal routing and send directly to a

host on an attached network

-s src_addr  --source=src_addr

Use source src_addr for outgoing packets

-z sendwait  --sendwait=sendwait

Minimal time interval between probes (default 0).

If the value is more than 10, then it specifies a

number in milliseconds, else it is a number of

seconds (float point values allowed too)

-e  --extensions            Show ICMP extensions (if present), including MPLS

-A  --as-path-lookups       Perform AS path lookups in routing registries and

print results directly after the corresponding

addresses

-M name  --module=name      Use specified module (either builtin or external)

for traceroute operations. Most methods have

their shortcuts (`-I' means `-M icmp' etc.)

-O OPTS,...  --options=OPTS,...

Use module-specific option OPTS for the

traceroute module. Several OPTS allowed,

separated by comma. If OPTS is "help", print info

about available options

--sport=num                 Use source port num for outgoing packets. Implies

`-N 1'

-U  --udp                   Use UDP to particular port for tracerouting

(instead of increasing the port per each probe),

default port is 53

-UL                         Use UDPLITE for tracerouting (default dest port

is 53)

-P prot  --protocol=prot    Use raw packet of protocol prot for tracerouting

--mtu                       Discover MTU along the path being traced. Implies

`-F -N 1'

--back                      Guess the number of hops in the backward path and

print if it differs

-V  --version               Print version info and exit

--help                      Read this help and exit

Arguments:

+     host          The host to traceroute to

packetlen     The full packet length (default is the length of an IP

header plus 40). Can be ignored or increased to a minimal

allowed value

部分解释如下:

唯一所必须的参数host是目的主机的名字或 IP 地址。

在这个参数之后可以选择跟上探测包的大小[packetlen](默认是40)。

改变包的大小并使用 -F 参数 可以用于获得个别网络跳的 MTU 信息。(探测包大小的参数对于TCP探测来说无用)。

其余的选项 :

--help 打印帮助信息,并退出。

-4, -6 显示地指定使用IPv4或IPv6 traceroute。默认情况下,traceroute会解析给定的主机名,并自动选择合适的协议。如果解析主机名既得到了IPv4的地址,又得到了IPv6的地址,traceroute会使用IPv4。

-I     使用ICMP ECHO进行探测。

-T     使用TCP SYN进行探测。

-U     使用UDP报文进行探测(默认情况)。对于无特权用户来说,只允许使用UDP报文进行探测。

-d     允许进行socket级别的调试(当Linux kernel支持它的时候)Enable socket level debugging (when the Linux kernel supports it)

-F     将“不要分段Don't Fragment”位置位。这将告诉中间路由器不要将该包分段(当路由器发现该探测包对于网络中MTU来说太大的时候)

-f

设置第一个检测数据包的存活数值TTL的大小。默认是1 。

-g

告诉traceroute为发出的packet增加IP源路由选项,以此告诉网络在路由该packet时需要通过指定的网关。不是十分有用,大多数的路由器因为安全方面的考虑将源路由设置为失效。

-i

指定traceroute发送包时经过的端口。默认的端口是依照路由表选定的。

-m

指定traceroute将要探测的最大跳数(最大的生存时间)。默认值为30。

-N

指定同时发送的探测包数目。同时发送几个探测包可以适当加快traceroute的速度。默认值为15。注:有些路由器和主机会使用ICMP速率限制,在这种情况下,指定同时发送大量的探测包会使一些响应丢失。

-n     显示的时候无需将IP地址和主机名相对应。直接使用IP地址而非主机名称。

-p

使用UDP的跟踪,基础的traceroute会使用指定的目的端口(每个探测包的目的端口号会递增)。

使用ICMP跟踪,指定初始的icmp序列号(每个探测包递增)。

使用TCP跟踪,指定要连接的端口号(常数)

-t

对于IPv4,设置服务类型(Type of Service,TOS)及优先值。有用的数值有16(低延迟)和8(高吞吐量)。注意在使用某些TOS优先值时,你必须是超级用户。

对于IPv6,设置流量控制值。

-w

设置对探测包响应的等待时间(秒),默认值是5秒。

-q

设置每一跳的探测包数量。默认是3 。

-r     忽略普通的路由表,直接发送到所在网络(attacked network)的远端主机上。如果该主机不是直接附在网络(directly-attached network)中,

会返回一个错误。该选项可用于ping一个本地主机,而该主机所经过的端口没有路由。

-s

设置本地主机发出数据包的地址。注意你必须选择某一端口的地址,这个地址就是发出数据包的端口所使用的。

-z

探测包之间最小的时间间隔(默认值为0)。如果该值大于10,则它指定的为毫秒,否则,它指定的为秒(允许使用浮点数)。当某些路由器对ICMP报文实行速率限制时有用。

-A     在路由注册中查找AS path,并将结果直接打印在相应的地址后面

-V     打印出版本并退出。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值