2010年職稱計算機:利用PING來檢查網(wǎng)絡(luò)狀態(tài)的方法

字號:

1.Ping本機IP
    例如本機IP地址為:172.168.200.2。則執(zhí)行命令Ping 172.168.200.2。如果網(wǎng)卡安裝配置沒有問題,則應(yīng)有類似下列顯示:
    Replay from 172.168.200.2 bytes=32 time<10ms
    Ping statistics for 172.168.200.2
    Packets Sent=4 Received=4 Lost=0 0% loss
    Approximate round trip times in milli-seconds
    Minimum=0ms Maxiumu=1ms Average=0ms
    如果在MS-DOS方式下執(zhí)行此命令顯示內(nèi)容為:Request timed out,則表明網(wǎng)卡安裝或配置有問題。將網(wǎng)線斷開再次執(zhí)行此命令,如果顯示正常,則說明本機使用的IP地址可能與另一臺正在使用的機器IP地址重復了。如果仍然不正常,則表明本機網(wǎng)卡安裝或配置有問題,需繼續(xù)檢查相關(guān)網(wǎng)絡(luò)配置。
    2.Ping網(wǎng)關(guān)IP
    假定網(wǎng)關(guān)IP為:172.168.6.1,則執(zhí)行命令Ping 172.168.6.1。在MS-DOS方式下執(zhí)行此命令,如果顯示類似以下信息:
    Reply from 172.168.6.1 bytes=32 time=9ms TTL=255
    Ping statistics for 172.168.6.1
    Packets Sent=4 Received=4 Lost=0
    Approximate round trip times in milli-seconds
    Minimum=1ms Maximum=9ms Average=5ms
    則表明局域網(wǎng)中的網(wǎng)關(guān)路由器正在正常運行。反之,則說明網(wǎng)關(guān)有問題。
    3.Ping遠程IP
    這一命令可以檢測本機能否正常訪問Internet。比如本地電信運營商的IP地址為:202.102.48.141。在MS-DOS方式下執(zhí)行命令:Ping 202.102.48.141,如果屏幕顯示:
    Reply from 202.102.48.141 bytes=32 time=33ms TTL=252
    Reply from 202.102.48.141 bytes=32 time=21ms TTL=252
    Reply from 202.102.48.141 bytes=32 time=5ms TTL=252
    Reply from 202.102.48.141 bytes=32 time=6ms TTL=252
    Ping statistics for 202.102.48.141
    Packets Sent=4 Received=4 Lost=0 0% loss
    Approximate round trip times in milli-seconds
    Minimum=5ms Maximum=33ms Average=16ms
    則表明運行正常,能夠正常接入互聯(lián)網(wǎng)。反之,則表明主機文件(windows/host)存在問題。
    ping命令的用法
    驗證與遠程計算機的連接。該命令只有在安裝了 TCP/IP 協(xié)議后才可以使用。
    ping [-t] [-a] [-n count] [-l length] [-f] [-i ttl] [-v tos] [-r count] [-s count] [[-j computer-list] | [-k computer-list]] [-w timeout] destination-list
    參數(shù)
    -t
    Ping 指定的計算機直到中斷。
    -a
    將地址解析為計算機名。
    -n count
    發(fā)送 count 指定的 ECHO 數(shù)據(jù)包數(shù)。默認值為 4。
    -l length
    發(fā)送包含由 length 指定的數(shù)據(jù)量的 ECHO 數(shù)據(jù)包。默認為 32 字節(jié);值是 65,527。
    -f
    在數(shù)據(jù)包中發(fā)送“不要分段”標志。數(shù)據(jù)包就不會被路由上的網(wǎng)關(guān)分段。
    -i ttl
    將“生存時間”字段設(shè)置為 ttl 指定的值。
    -v tos
    將“服務(wù)類型”字段設(shè)置為 tos 指定的值。
    -r count
    在“記錄路由”字段中記錄傳出和返回數(shù)據(jù)包的路由。count 可以指定最少 1 臺,最多 9 臺計算機。
    -s count
    指定 count 指定的躍點數(shù)的時間戳。
    -j computer-list
    利用 computer-list 指定的計算機列表路由數(shù)據(jù)包。連續(xù)計算機可以被中間網(wǎng)關(guān)分隔(路由稀疏源)IP 允許的數(shù)量為 9。
    -k computer-list
    利用 computer-list 指定的計算機列表路由數(shù)據(jù)包。連續(xù)計算機不能被中間網(wǎng)關(guān)分隔(路由嚴格源)IP 允許的數(shù)量為 9。
    -w timeout
    指定超時間隔,單位為毫秒。
    destination-list
    指定要 ping 的遠程計算機