Linux traceroute命令使用详解
traceroute我们可以知道信息从你的计算机到互联网另一端的主机是走的什么路径。当然每次数据包由某一同样的出发点(source)到达某一同样的目的地(destination)走的路径可能会不一样,但基本上来说大部分时候所走的路由是相同的。
常见命令参数
Options: -4UseIPv4 -6UseIPv6 -d--debugEnablesocketleveldebugging -F--dont-fragmentDonotfragmentpackets -ffirst_ttl--first=first_ttl Startfromthefirst_ttlhop(insteadfrom1) -ggate,...--gateway=gate,... Routepacketsthroughthespecifiedgateway (maximum8forIPv4and127forIPv6) -I--icmpUseICMPECHOfortracerouting -T--tcpUseTCPSYNfortracerouting -idevice--interface=device Specifyanetworkinterfacetooperatewith -mmax_ttl--max-hops=max_ttl Setthemaxnumberofhops(maxTTLtobe reached).Defaultis30 -Nsqueries--sim-queries=squeries Setthenumberofprobestobetried simultaneously(defaultis16) -nDonotresolveIPaddressestotheirdomainnames -pport--port=portSetthedestinationporttouse.Itiseither initialudpportvaluefor"default"method (incrementedbyeachprobe,defaultis33434),or initialseqfor"icmp"(incrementedaswell, defaultfrom1),orsomeconstantdestination portforothermethods(withdefaultof80for "tcp",53for"udp",etc.) -ttos--tos=tosSettheTOS(IPv4typeofservice)orTC(IPv6 trafficclass)valueforoutgoingpackets -lflow_label--flowlabel=flow_label Usespecifiedflow_labelforIPv6packets -wwaittime--wait=waittime Setthenumberofsecondstowaitforresponseto aprobe(defaultis5.0).Non-integer(float point)valuesallowedtoo -qnqueries--queries=nqueries Setthenumberofprobespereachhop.Defaultis 3 -rBypassthenormalroutingandsenddirectlytoa hostonanattachednetwork -ssrc_addr--source=src_addr Usesourcesrc_addrforoutgoingpackets -zsendwait--sendwait=sendwait Minimaltimeintervalbetweenprobes(default0). Ifthevalueismorethan10,thenitspecifiesa numberinmilliseconds,elseitisanumberof seconds(floatpointvaluesallowedtoo) -e--extensionsShowICMPextensions(ifpresent),includingMPLS -A--as-path-lookupsPerformASpathlookupsinroutingregistriesand printresultsdirectlyafterthecorresponding addresses -Mname--module=nameUsespecifiedmodule(eitherbuiltinorexternal) fortracerouteoperations.Mostmethodshave theirshortcuts(`-I'means`-Micmp'etc.) -OOPTS,...--options=OPTS,... Usemodule-specificoptionOPTSforthe traceroutemodule.SeveralOPTSallowed, separatedbycomma.IfOPTSis"help",printinfo aboutavailableoptions --sport=numUsesourceportnumforoutgoingpackets.Implies `-N1' -U--udpUseUDPtoparticularportfortracerouting (insteadofincreasingtheportpereachprobe), defaultportis53 -ULUseUDPLITEfortracerouting(defaultdestport is53) -Pprot--protocol=protUserawpacketofprotocolprotfortracerouting --mtuDiscoverMTUalongthepathbeingtraced.Implies `-F-N1' --backGuessthenumberofhopsinthebackwardpathand printifitdiffers -V--versionPrintversioninfoandexit --helpReadthishelpandexit
常见命令展示
多命令使用
traceroute-n-m5-q4-w3www.baidu.com
说明:-n显示IP地址,不查主机名,-m设置跳数
-q4每个网关发送4个数据包-w把对外发探测包的等待响应时间设置为3秒
探测包使用的基本UDP端口设置6888
traceroute-p6888www.baidu.com
绕过正常的路由表,直接发送到网络相连的主机
traceroute-rwww.baidu.com
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持毛票票。
声明:本文内容来源于网络,版权归原作者所有,内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎发送邮件至:czq8825#qq.com(发邮件时,请将#更换为@)进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。