小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

traceroute命令詳解

 mrjbydd 2011-02-25

traceroute命令詳解

默認(rèn)分類 2010-04-06 16:50:33 閱讀921 評論0   字號: 訂閱

定義:

互聯(lián)網(wǎng)中,信息的傳送是通過網(wǎng)中許多段的傳輸介質(zhì)和設(shè)備(路由器,交換機(jī),服務(wù)器,網(wǎng)關(guān)等等)從一端到達(dá)另一端。每一個連接在Internet上的設(shè)備,如主機(jī)、路由器、接入服務(wù)器等一般情況下都會有一個獨(dú)立的IP地址。通過Traceroute我們可以知道信息從你的計算機(jī)到互聯(lián)網(wǎng)另一端的主機(jī)是走的什么路徑。當(dāng)然每次數(shù)據(jù)包由某一同樣的出發(fā)點(diǎn)(source)到達(dá)某一同樣的目的地(destination)走的路徑可能會不一樣,但基本上來說大部分時候所走的路由是相同的。UNIX系統(tǒng)中,我們稱之為Traceroute,MS Windows中為Tracert。 Traceroute通過發(fā)送小的數(shù)據(jù)包到目的設(shè)備直到其返回,來測量其需要多長時間。一條路徑上的每個設(shè)備Traceroute要測3次。輸出結(jié)果中包括每次測試的時間(ms)和設(shè)備的名稱(如有的話)及其IP地址。

在大多數(shù)情況下,作為網(wǎng)絡(luò)工程技術(shù)人員或者系統(tǒng)管理員會在UNIX主機(jī)系統(tǒng)下,直接執(zhí)行命令行:

  Traceroute hostname

  而在Windows系統(tǒng)下是執(zhí)行Tracert的命令:

  Tracert hostname

  比如在北京地區(qū)使用windows NT 主機(jī)(已經(jīng)與北京163建立了點(diǎn)對點(diǎn)的連接后)

  使用NT系統(tǒng)中的Tracert命令:(用戶可用:開始->運(yùn)行,輸入"command" 調(diào)出command窗口使用此命令)traceroute [-46dFITUnrAV] [-f first_ttl] [-g gate,...]
        [-i device] [-m max_ttl] [-p port] [-s src_addr]
        [-q nqueries] [-N squeries] [-t tos]
        [-l flow_label] [-w waittime] [-z sendwait]
        host [packetlen]
traceroute6  [options]
tracert  [options]
tcptraceroute  [options]

說明:
       traceroute  tracks  the route packets take across an IP network on their way to a given host. It utilizes
       the IP protocol’s time to live (TTL) field and attempts to elicit an  ICMP  TIME_EXCEEDED  response  from
       each gateway along the path to the host.

       traceroute6 = traceroute -6
       tracert = traceroute -I
       tcptraceroute = traceroute -T -p 80

選項(xiàng)說明:

      唯一所必須的參數(shù)host是目的主機(jī)的名字或 IP 地址。在這個參數(shù)之后可以選擇跟上探測包的大小[packetlen](默認(rèn)是40)。改變包的大小并使用 -F 參數(shù) 可以用于獲得個別網(wǎng)絡(luò)跳的 MTU 信息。(探測包大小的參數(shù)對于TCP探測來說無用)。

其余的選項(xiàng) :

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

       -4, -6 顯示地指定使用IPv4或IPv6 traceroute。默認(rèn)情況下,traceroute會解析給定的主機(jī)名,并自動選擇合適的協(xié)議。如果解析主機(jī)名既得到了IPv4的地址,又得到了IPv6的地址,traceroute會使用IPv4。

       -I     使用ICMP ECHO進(jìn)行探測。

       -T    使用TCP SYN進(jìn)行探測。

       -U     使用UDP報文進(jìn)行探測(默認(rèn)情況)。對于無特權(quán)用戶來說,只允許使用UDP報文進(jìn)行探測。

       -d     允許進(jìn)行socket級別的調(diào)試(當(dāng)Linux kernel支持它的時候)Enable socket level debugging (when the Linux kernel supports it)

       -F     將“不要分段Don't Fragment”位置位。這將告訴中間路由器不要將該包分段(當(dāng)路由器發(fā)現(xiàn)該探測包對于網(wǎng)絡(luò)中MTU來說太大的時候)

       -f <first_ttl>   
               設(shè)置第一個檢測數(shù)據(jù)包的存活數(shù)值TTL的大小。默認(rèn)是1 。

       -g <gateway>   
               告訴traceroute為發(fā)出的packet增加IP源路由選項(xiàng),以此告訴網(wǎng)絡(luò)在路由該packet時需要通過指定的網(wǎng)關(guān)。不是十分有用,大多數(shù)的路由器因?yàn)榘踩矫娴目紤]將源路由設(shè)置為失效。

       -i <interface>
               指定traceroute發(fā)送包時經(jīng)過的端口。默認(rèn)的端口是依照路由表選定的。

       -m <max_ttl>
               指定traceroute將要探測的最大跳數(shù)(最大的生存時間)。默認(rèn)值為30。

       -N <squeries>
               指定同時發(fā)送的探測包數(shù)目。同時發(fā)送幾個探測包可以適當(dāng)?shù)丶涌靦raceroute的速度。默認(rèn)值為15。注意:有些路由器和主機(jī)會使用ICMP速率限制,在這種情況下,指定同時發(fā)送大量的探測包會導(dǎo)致一些響應(yīng)丟失。

       -n     顯示的時候無需將IP地址和主機(jī)名相對應(yīng)。直接使用IP地址而非主機(jī)名稱。

       -p <port>
               使用UDP的跟蹤,基礎(chǔ)的traceroute會使用指定的目的端口(每個探測包的目的端口號會遞增)。
               使用ICMP跟蹤,指定初始的icmp序列號(每個探測包遞增)。
               使用TCP跟蹤,指定要連接的端口號(常數(shù))

       -t <tos>
               對于IPv4,設(shè)置服務(wù)類型(Type of Service,TOS)及優(yōu)先值。有用的數(shù)值有16(低延遲)和8(高吞吐量)。注意在使用某些TOS優(yōu)先值時,你必須是超級用戶。
              對于IPv6,設(shè)置流量控制值。

       -w <waittime>
               設(shè)置對探測包響應(yīng)的等待時間(秒),默認(rèn)值是5秒。

       -q <nqueries>
               設(shè)置每一跳的探測包數(shù)量。默認(rèn)是3 。

       -r     忽略普通的路由表,直接發(fā)送到所在網(wǎng)絡(luò)(attacked network)的遠(yuǎn)端主機(jī)上。如果該主機(jī)不是直接附在網(wǎng)絡(luò)(directly-attached network)中,會返回一個錯誤。該選項(xiàng)可用于ping一個本地主機(jī),而該主機(jī)所經(jīng)過的端口沒有路由。

-s <source_addr>
       設(shè)置本地主機(jī)發(fā)出數(shù)據(jù)包的地址。注意你必須選擇某一端口的地址,這個地址就是發(fā)出數(shù)據(jù)包的端口所使用的。

-z <sendwait>
       探測包之間最小的時間間隔(默認(rèn)值為0)。如果該值大于10,則它指定的為毫秒,否則,它指定的為秒(允許使用浮點(diǎn)數(shù))。當(dāng)某些路由器對ICMP報文實(shí)行速率限制時有用。

-A     在路由注冊中查找AS path,并將結(jié)果直接打印在相應(yīng)的地址后面

-V     打印出版本并退出。

       This program attempts to trace the route an IP packet would follow to some internet host by  launching  a
       probe  packets  with  a  small ttl (time to live) then listening for an ICMP "time exceeded" reply from a
       gateway.  We start our probes with a ttl of one and increase by one until we get an ICMP  "port  unreach-
       able"  (or  TCP reset), which means we got to "host", or hit a max (which defaults to 30 hops). Three (by
       default) probes are sent at each ttl setting and a line is printed showing the ttl, address of the  gate-
       way and round trip time of each probe.  If the probe answers come from different gateways, the address of
       each responding system will be printed.  If there is no response within a 5.0 (default) seconds, a "*" is
       printed for that probe.

       We  don’t want the destination host to process the UDP probe packets so the destination port is set to an
       unlikely value (you can change it with the -p flag). There is no such problem for ICMP or TCP  tracerout-
       ing (for TCP we close sessions immediately after connect).

       After  the  time  some  additional  annotation  can  be printed: !H, !N, or !P (host, network or protocol
       unreachable), !S (source route failed), !F (fragmentation  needed),  !X  (communication  administratively
       prohibited),  !V  (host precedence violation), !C (precedence cutoff in effect), or !<num> (ICMP unreach-
       able code <num>).  If almost all the probes result in some kind of unreachable, traceroute will  give  up
       and exit.

SEE ALSO
       ping(8), ping6(8), tracepath(8), netstat(8).

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多